ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Modbus functions
  • Overview
  • Use in WINDEV and WEBDEV
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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 with several variants: make a data read request, make a data write request...
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 ModbusConnecteRTU.
  • Modbus TCP using an Ethernet link. To connect using this mode, simply use ModbusConnecteTCP.
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: As writing operations involve the manipulation of automation devices, it is advisable to test the various commands before putting them into production, to ensure that the devices 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/28/2025

Send a report | Local help