ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Modbus functions
  • Overview
  • Use in WINDEV and WEBDEV
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
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
WEBDEV - Server code This feature is now available for WEBDEV websites in Windows and Linux.
Use in WINDEV and WEBDEV
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:
ModbusReadBitReads one or more bits from a Modbus slave, starting at a specific address.
ModbusReadFloatReads one or more single-precision floats from a Modbus slave, starting at a specific address.
ModbusReadRegisterReads one or more registers from a Modbus slave, starting at a specific address.
and write functions:
ModbusWriteBitWrites one or multiple bits to a specific address in a Modbus slave.
ModbusWriteFloatWrites one or more single-precision floats to a Modbus slave, starting at a specific address.
ModbusWriteRegisterWrites one or more registers (16-bit values) to a Modbus slave, starting at a specific address.
ModbusDisconnect is used to close the session.
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.
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/05/2024

Send a report | Local help