Status and command variables
Below are possible diagnostic and status information available:
Information |
Description |
Data exchange |
Variable is used for process data exchange. |
Error report |
The variable is set to an error value when the last unsuccessful exchange is performed on the request. It is reset to 0 on the next successful exchange. |
Enable connection |
Selected operation mode to dynamically open or close a port. The port will be opened:
The port will be closed, when the linked variable changes to FALSE. Hint: When the port is disabled, the "error report" status variable shows the value 131. |
Error report (set only) |
Same as upper, but the variable is not reset by the MODBUS stack. The application is in charge of resetting the variable. |
On-going request |
The variable is set to 1 when the request is sent to the slave and reset to 0 after either an answer from the slave or a timeout. |
Success counter |
The variable is increased each time the request is exchanged successfully. |
Fail counter |
The variable is increased each time the exchange of the request leads to an error. |
Retry counter |
The variable is set to 0 on the first trial and increased each time the request is retried. |
Slave: last error |
The variable contains the error code of the last error detected on this slave. |
Slave: last error date stamp |
The variable contains the date stamp of the last error detected on this slave. |
Slave: last error time stamp |
The variable contains the time stamp of the last error detected on this slave. |
Slave: last reset date stamp |
The variable contains the date stamp of the last "reset" action performed on slave counters. |
Slave: last reset time stamp |
The variable contains the time stamp of the last "reset" action performed on slave counters. |
Slave: transaction counter |
The variable is increased on any new exchange performed with this slave, whatever the exchange is successful or faulty. |
Slave: failed transaction counter |
This variable is increased on any new faulty exchange with this slave. |
Below are the possible commands you can map:
Command |
Description |
Command (enable) |
The request is sent continuously as long as the mapped command variable is TRUE (or not zero). |
Command (one shot) |
The request is sent only once when the mapped command variable becomes TRUE (or not zero). The variable is reset to 0 after the exchange. |
Reset counters |
The request counters are reset to 0 when the variable becomes TRUE (or not zero), and the command variable is then reset to 0. |
Slave: reset counters |
The slave counters are reset to 0 when the variable becomes TRUE (or not zero), and the command variable is then reset to 0. |
Below are possible error codes for "status" variables:
Error code |
Meaning |
0 |
OK |
1 |
MODBUS function not supported. |
2 |
Invalid MODBUS address. |
3 |
Invalid MODBUS value. |
4 |
MODBUS server failure. |
6 |
Server is busy. |
8 |
Data parity error. |
10 |
Invalid gateway path. |
11 |
Gateway target failed. |
128 |
Communication timeout. |
129 |
Bad CRC16. |
130 |
RS232 communication error. |
131 |
Port is disabled via command variable value FALSE. |
When you map a variable to a data block in a master configuration, you can select it to be a command. In that case, the data block is exchanged only when the variable is TRUE (or non zero for numerical data types).
Data types
You can freely map a variable of any data type to a MODBUS item. The Runtime Service automatically converts the value to the type of the variable.
For exchanging boolean variables through MODBUS words, a hexadecimal mask is available in order to define to which bit of a word a variable is attached. For example, enter the mask "0001" to map a boolean variable to the less significant bit of a word. For exchanging 32 bit variables (DINT, REAL...), you can select to map the variable on two consecutive words.
STRING variables are supported only if a "string" data format is specified. 64 bit variable (LINT and LREAL) cannot be extracted directly without lost of accuracy or data.
Status and command variables |
IEC 61131-3 Automation platform > Drivers - Fieldbus configuration > MODBUS Master > Variables > Variable Parameters > Status and command variables |
Created with the Personal Edition of HelpNDoc: Easily convert your WinHelp HLP help files to CHM with HelpNDoc's step-by-step guide