|
|
|
|
- Properties specific to modbusSession variables
- WLanguage functions that use modbusSession variables
modbusSession (Variable type) In french: modbusSession
The modbusSession type is used to identify a connection to a Modbus server. Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable. New in version 2024
Session is modbusSession
Session = ModbusConnectTCP("192.168.1.18",3275)
IF ErrorOccurred = True THEN
Trace(ErrorInfo())
ELSE
ModbusWriteRegister(Session, 0x42,0xCAFE)
END
ModbusDisconnect(Session)
Remarks Properties specific to modbusSession variables The following properties can be used to handle Modbus sessions: | | | Property name | Type used | Effect |
---|
ResponseTimeout | Integer | Maximum timeout for a Modbus server response. | SlaveID | Integer | Slave ID. Used to change the slave ID without having to open a session again. |
WLanguage functions that use modbusSession variables modbusSession variables can be handled using the following WLanguage functions:
| | ModbusConnectRTU | Connects a client to a Modbus slave via a serial port. | ModbusConnectTCP | Connects a client to a Modbus server via transmission control protocol (TCP). | ModbusDisconnect | Closes the Modbus session. | 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. | 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. |
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|