MODBUSA Driver Parameters
- Last UpdatedDec 02, 2021
- 9 minute read
These parameters default to a value which have shown to be suitable for the majority of circumstances.
|
|
|
UNINTENDED EQUIPMENT OPERATION Do not change these protocol parameters, except on the advice of Technical Support for this product. Failure to follow these instructions can result in death, serious injury, or equipment damage. |
Note: Always seek the advice of Technical Support personnel for this product regarding undocumented features.
With certain parameters, the MODBUSA driver can apply different initialization parameter values to specific I/O devices or groups of I/O devices. For details see Device/group-specific parameters.
[MODBUSA]Block
A value (bytes) used by the I/O server to determine if two or more packets can be blocked into one data request before being sent to the I/O device. For example, if you set the value to 10 and the I/O server receives two simultaneous data requests (one for byte 3 and another for byte 8) the two requests are blocked into a single physical data request packet. This single request packet is then sent to the I/O device, saving on bandwidth and processing.
Allowable Values: 5 to 256
Default Value: 50
[MODBUSA.<Port_Name>.<IODevice_Name>]Broadcast
Sends a write request to a specified device on a Modbus network.
Note: This parameter can only be used as a device-specific parameter, for example, [MODBUSA.<Port_Name>.<IODevice_Name>]Broadcast=1. It should not be used globally. For more details, see Device/Group-specific Parameters.
To use this feature:
Define an I/O device with address 0 (zero) for the Channel of interest.
Define the value for the BroadcastDelay parameter in the Citect.ini file (default is 50ms). This parameter defines the amount of time the driver will delay after submitting a broadcast request before it will send another request to the PLCs.
Define tags (Coils and Registers) associated with this I/O device.
Implement a Plant SCADA application that requests writes to the tags (via Cicode, application display, and so on).
Requests for Variable Tag READs to the I/O device with the address zero (0) will return a Driver Error of Unknown Command (driver error 15 decimal). Requests for Variable Tag WRITEs to the I/O device with the address zero (0) will be issued to ALL controllers on the SAME Channel (port) as the I/O device with the assigned address of zero. The Modbus protocol does not provide a response to broadcast requests so inspect the appropriate coils or registers in each controller to observe completion of the request.
Allowable Values:
0 = Broadcast disabled
1 = write request will be issued
Default Value: 1
[MODBUSA]BroadcastDelay
Defines the amount of time the driver will delay after submitting a broadcast request before sending another request to the PLCs.
Allowable Values: 0 to 300 (milliseconds)
Default Value: 50
Note: This parameter is only available at the MODBUSA level, i.e. [MODBUSA]
[MODBUSA]Delay
The period (in milliseconds) to wait between receiving a response and sending the next command.
Allowable Values: 0 to 32767 (milliseconds)
Default Value: 0
[MODBUSA]DoCRC
Enables or disables the Modbus Cyclic Redundancy Check (CRC), a communications check. The MODBUSA driver does a CRC on incoming data and provides a CRC remainder in outgoing data blocks. In some limited cases, such as the testing of "slave" drivers, it may be necessary to disable the CRC.
Allowable Values: 1 or 0, where:
1 = enable CRC
0 = disable CRC
Default Value: 1
The CRC should remain "enabled" under normal circumstances. If the CRC is disabled, no checks are performed on incoming data and the CRC field in the data transmitted by the driver remains 0. This will mean the driver cannot detect lack off communication between itself and the I/O device.
[MODBUSA]FailOnBadData
Used by the MODBUSA driver to determine whether or not to force the display of good data within a block read which contains bad tags during tag read.
Allowable Values: 1 or 0, where:
1 = A block read which contains a bad tag would result in the whole block returning #BAD
0 = The MODBUSA driver will not return "#BAD" for a block of data if at least one valid value is in the read block.
Default Value: 1
[MODBUSA]FloatMode
Note: This parameter is not applicable if you are using the protocol variant MODBUS20 or MODBUS30 to communicate with a device. Under these circumstances, a value of 0 (zero) will be hardcoded for this parameter.
This INI parameter sets the byte order for floating point values (the MODBUSA driver supports floating point values). Some systems expect to use a different byte order for their floating point data.
Allowable Values: 0 to 3, where:
0 - Byte order = 1 0 3 2
1 - Byte order = 3 2 1 0
2 - Byte order = 0 1 2 3
3 - Byte order = 2 3 0 1
Default Value: 0
With this parameter, you can set different values for specific I/O devices or groups of I/O devices. See Device/Group-specific Parameters.
[MODBUSA]ForceMultiCoilsOnly
Forces the use of only function code 15 (multiple coils) for coil writes.
Allowable Values:
0 - (function code 5 and 15)
1 - (function code 15 only)
Default Value: 0
[MODBUSA]InitType
The type of variable the MODBUSA protocol tries to read on startup, to allow communication to start.
Allowable Values: 1 to 4.
|
InitType |
Address |
Variable |
|
1 |
00001 - 00017 |
Output status |
|
2 |
10001 - 10017 |
Input status |
|
3 |
40001 |
Output registers |
|
4 |
30001 |
Input registers |
Default Value: 2
With this parameter, you can set different values for specific I/O devices or groups of I/O devices. See Device/group-specific parameters.
[MODBUSA]InitUnitAddress
The MODBUSA driver reads the citect.ini file to determine the correct unit address for initialization of a PLC. InitUnitAddress is the parameter used to set the unit address.
Allowable Values: 0 to 65535
Default Value: 0
With this parameter, you can set different values for specific I/O devices or groups of I/O devices. See Device/Group-specific Parameters.
[MODBUSA]LongDataType
Note: This parameter is not applicable if you are using the protocol variant MODBUS20 or MODBUS30 to communicate with a device. Under these circumstances, a value of 3 will be hardcoded for this parameter.
In the Modbus protocol, LONG data types default to a simplified implementation, with a shortened range of 0 to 99,999,999 - mode 0. Mode 2 has the same range as mode 0, but with the register order swapped. Mode 1 supports the complete LONG range of -2,147,483,648 to +2,147,483,647. Mode 3 has the same range as mode 1, but with the register order swapped.
Allowable Values: 0 to 3, where:
0 = 10000 x low register + high register
1 = 65536 x low register + high register
2 = 10000 x high register + low register
3 = 65536 x high register + low register
Default Value: 3
With this parameter, you can set different values for specific I/O devices or groups of I/O devices. See Device/Group-specific Parameters.
[MODBUSA]MaxBits
Note: This parameter is not applicable if you are using the protocol variant MODBUS20 or MODBUS30 to communicate with a device. If MODBUS20 is being used, a value of 1904 will be hardcoded for this parameter. If MODBUS30 is being used, a value of 1024 will be hardcoded.
The maximum read size in one request. Decrease the value for non-standard I/O devices that do not support large reads.
Allowable Values: 8 to 32767
Default Value: 1904
[MODBUSA]MaxBitsExt
Note: This parameter is not applicable if you are using the protocol variant MODBUS20 or MODBUS30 to communicate with a device. If MODBUS20 is being used, a value of 1904 will be hardcoded for this parameter. If MODBUS30 is being used, a value of 1024 will be hardcoded.
This INI parameter sets the maximum bits blocked for the Quantum PLCs "Ex:y[.z]" address type.
Allowable Values: 8 to 32767
Default Value: 1904
[MODBUSA]MaxPending
The maximum number of pending commands that the driver holds ready for immediate execution.
Allowable Values: 1 to 32
Default Value: 2
[MODBUSA]Pad
The number of characters with which to pad protocol messages. The padding characters wake the radio modem to allow the rest of the message to be transmitted. A value of 20 is recommended for non-standard I/O devices that operate over radio modems.
Allowable Values: 0 to 65535
Default Value: 0
[MODBUSA]PadChar
The ASCII code of the padding character with which to pad protocol messages. The padding characters wake the radio modem to allow the rest of the message to be transmitted.
Allowable Values: 0 to 255
Default Value: 255
[MODBUSA]PollTime
The interrupt or polling service time (in milliseconds). Setting the polling time to 0 puts the driver in interrupt mode.
Allowable Values: 0 to 300 (milliseconds)
Default Value: 0
[MODBUSA]PresetMultiRegistersOnly
Forces the use of only function code 16 (multiple registers) for register writes.
Allowable Values: 0 or 1:
0 - (function code 6 and 16)
1 - (function code 16 only)
Default Value: 0
[MODBUSA]RegisterBitReverse
Note: This parameter is not applicable if you are using the protocol variant MODBUS20 or MODBUS30 to communicate with a device. Under these circumstances, a value of 1 will be hardcoded for this parameter.
This INI parameter allows reverse interpretation of Most Significant Bit (MSB) and Least Significant Bit (LSB) in words. The Modbus specification defines bit 1 of a word as the MSB, and bit16 of the word as the LSB. Some devices use a different order, causing bit 1 of a word to be the LSB and bit 16 to be the MSB.
Allowable Values: 0 or 1, where:
1 - Bit 1= LSB, Bit 16 = MSB
0 - Bit 1 = MSB, Bit 16 = LSB
Default Value: 1
With this parameter, you can set different values for specific I/O devices or groups of I/O devices. See Device/Group-specific Parameters.
[MODBUSA]Retry
The number of times to retry a command after a timeout.
Allowable Values: 0 to 8
Default Value: 0
[MODBUSA]SendBCDSwap
Reverses the byte order for BCDs on writes (the MODBUSA driver supports BCDs). Some systems expect to use a different byte order for their data; in the case of BCDs, this causes "1234" to be written to the device as "3412".
Allowable Values: 0 or 1, where:
1 = 1 2 3 4
0 = 3 4 1 2
Default Value: 1
With this parameter, you can set different values for specific I/O devices or groups of I/O devices. See Device/Group-specific Parameters.
[MODBUSA]Status
Sometimes you can read data from a device even though the processor module is not running. In view of this, it can be useful to detect this situation by monitoring a continuously changing register or a digital. If the register is unable to change in a given period or the digital becomes zero, the processor can be assumed to have stopped running.
If enabled, the MODBUSA driver will check on startup and approximately every watchtime the status of a user specified variable in the PLC is changing. If a digital is specified, the value should be on, otherwise the unit is put offline. If an analog is specified, on startup two consecutive reads with an interval of 1000ms (specified by [MODBUSA]Timeout) should return different values before the unit can be put online. At every watchtime, if the digital is off or the analog data does not change from the last value read, the driver returns an error and the unit is put offline.
Allowable Values:
RawType
BitWidth
UnitType
UnitAddress
UnitAddress
where:
|
RawType |
BitWidth |
UnitType |
UnitAddress |
UnitCount |
|
0 = Digital |
1 = Digital |
See variable specification .dbf files |
The item number or bit number |
1 = analog 16 = digital |
|
1 = Int |
16 = Int |
|||
|
4 = Long |
32 = Long |
|||
|
8 = Byte |
8 = Byte |
Default Value:
Zero length string
Examples
To specify Modbus address 40001 as the analog tag variable which must change to indicate the device is online, use:
[MODBUSA]
status=1,16,3,0,1
To use Modbus address 00001 as the digital tag variable which must remain set to 1 to indicate the device is online, then use:
[MODBUSA]
status=0,1,1,0,16
[MODBUSA]StringReverse
Reverse byte order for strings. The MODBUSA driver supports strings. Some systems expect to use a different byte order for their data, which in the case of string variables, causes "ABCD" to appear as "BADC".
Allowable Values: 0 or 1
Default Value: 0 (do not reverse byte order)
With this parameter, you can set different values for specific I/O devices or groups of I/O devices. See Device/Group-specific Parameters.
[MODBUSA]Timeout
Specifies how many milliseconds to wait for a response before displaying an error message.
Allowable Values: 0 to 32000 (milliseconds)
Default Value: 3000
Note: This parameter is only available at the MODBUSA Portlevel, i.e. [MODBUSA.Port] but values are overridden by the default values in the syslog and Kernel page.
[MODBUSA]WatchTime
The frequency (in seconds) that the driver uses to check the communications link to the I/O device.
Allowable Values: 0 to 128 (seconds)
Default Value: 30
