19.5. Modbus
The Modbus is a software library that can be operated physically on the RS-485 and RS-232 modules. Thus, Modbus is a software
layer which provides with interesting services.
Technical details:
•
Protocol: Modbus
•
Data area: Up to 255 bytes per job
•
Interface: Layer 7 of the ISO-OSI reference model
•
Connector: DB9 (RS-485 / RS-232 modules)
Number of possible connections: up to 32 in multi point systems
•
Frame format: RTU
•
Applications:
•
Multiple master-slave applications
•
Sensors and Instruments
•
Industrial Networking
•
Building and infrastructure
•
Transportation and energy applications
19.6. Operating with the modules
The functions implemented in the API allow to configure the modules and send information in a simple way, calling functions
such as:
{
W485.send("Data from analog1 input: ");
W485.send(analog1);
}
{
W232.send("Data from analog1 input: ");
W232.send(analog1);
}
{
// Read the last message received
CAN.getMessage(&CAN.messageRx);
// Print in the serial monitor the received message
CAN.printMessage(&CAN.messageRx);
}
Related API libraries:
•
Wasp485.h, Wasp485.cpp.
•
Wasp232.h, Wasp232.cpp.
•
WaspCAN.h, WaspCAN.cpp.
•
ModbusMaster485.h, ModbusMaster485.cpp, ModbusSlave485.h, ModbusSlave485.cpp.
•
ModbusMaster232.h, ModbusMaster232.cpp, ModbusSlave232.h, ModbusSlave232.cpp.
-103-
Industrial Protocols
Figure: RS-485 module
v6.3
Need help?
Do you have a question about the Waspmote and is the answer not in the manual?