|
|
|
|
- Overview
- Use in WINDEV and WEBDEV
Modbus is a "field" (industrial and/or restricted environments) communication protocol created in 1979. This protocol is widely used in industrial environments to control programmable logic controllers (PLCs). It is known for its versatility, robustness, simplicity, and the large number of compatible devices. A Modbus network is composed of at least 1 master (or client) which will ask slaves (or servers) to perform an action. In Modbus, there are only two basic actions, which have several variants: query to read data, query to write data. New in version 2024 WINDEV and WEBDEV support two communication methods with Modbus slaves (or servers). - Modbus RTU using serial lines (serial port, USB port converted to serial port, etc.). Slaves that use RS-232 can connect directly to the serial port of the PC. However, for RS-422 or RS-485, a converter is required (in almost all cases, computer serial ports only support RS-232). To connect using this mode, simply use ModbusConnectRTU.
- Modbus TCP using an Ethernet link. To connect using this mode, simply use ModbusConnectTCP.
WLanguage offers read functions:
| | ModbusReadBit | Reads one or more bits from a Modbus slave, starting at a specific address. | ModbusReadFloat | Reads one or more single-precision floats from a Modbus slave, starting at a specific address. | ModbusReadRegister | Reads one or more registers from a Modbus slave, starting at a specific address. |
and write functions:
| | ModbusWriteBit | Writes one or multiple bits to a specific address in a Modbus slave. | ModbusWriteFloat | Writes one or more single-precision floats to a Modbus slave, starting at a specific address. | ModbusWriteRegister | Writes one or more registers (16-bit values) to a Modbus slave, starting at a specific address. |
CAUTION: Since write operations make it possible to control PLCs, it is recommended to test the different commands before the production phase to make sure the PLCs perform the required operations.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|