Function Block: ModbusRequest
Library: IoDrvModbusTCP
In addition to the predefined Modbus commands defined in the tab Modbus Server Channel, this function block allows to execute dynamically additional commands in the application. For this programmatically created commands CODESYS does not provide an I/O mapping but input/output data ranges of type ARRAY OF BYTE or ARRAY OF WORD.
Name | Data Type | Initial Value | Description |
---|---|---|---|
|
| ||
|
| Rising edge: The action starts. Falling edge: The outputs are reset when a falling edge occurs before the function block has ended the action. The outputs behave as usual and are reset only if the action is ended or has been aborted ( | |
|
| TRUE: The action is aborted immediately and all outputs are set to their initial values. | |
|
| 16#FF | The unit ID is only used for forwarding (gateway) to a Modbus Serial Bus. For TCP/IP, the MODBUS-Server is addressed by means of the IP address. In this case, the MODBUS unit ID is not used (the value 0xFF has to be used). For a serial connection, the Modbus devices are addressed with unit IDs from 1 to 247 (0 is used for broadcast addresses). |
|
| The Modbus command to be executed. Function blocks for bit and word access are supported. | |
|
| Pointer to a buffer with data which is sent to the server. For register access, the buffer is of type | |
|
| Pointer to a buffer where the data which has been received by the server is written. For register access, the buffer is of type |
Name | Data Type | Initial Value | Description |
---|---|---|---|
|
|
| TRUE when a request has been ended successfully |
|
|
| TRUE as long as the request is being processed |
|
|
| TRUE when a request has been ended with errors |
|
|
| TRUE when the request has been aborted by the user |
|
| Current error; defined in the |