Modbus Compatible Device Driver
Not counted towards your tag license limit.
Driver Errors: To learn more about the cause of an error condition, refer to the Driver Summary Report and the Driver Error Report, both of which are available in the Reports page. The Show Stats button will also provide current and last error messages: Show Statistics Button Widget
Modbus drivers will commonly connect to TCP on port # 502, although variations may be found.
This driver supports multiple TCP/IP port connections between a single instance of the driver and the RTU.
Any of the following communication channels may be used:
- Serial RTU
- Serial ASCII
- SA-85 I/O card for ModBus Plus communications
- Embedded TCP/IP
- Open Modbus TCP
This driver has the ability to save the last value written to each output tag, and to rewrite those values, either automatically when lost communications are restored, or manually by the press of a button. Carefully review the information in the Options tab to decide whether this feature should be used in your application. If this driver is being used in conjunction with a Driver Multiplexer, then configure the Driver Multiplexer to store the last values, not the drivers connected to the Multiplexer. In this case, only the Multiplexer should be configured to re-write automatically.
The number of bytes in a Modbus message is limited by the setting: ModiconVTSMaxBlock. By default, this is 125.
When this driver is used in combination with a TCP/IP tag, the standard TCP port is 502.
"Type specified" means addresses such as the HC1 and IR2 format. This does not apply to addresses written as numbers only. (For example, 40001 is always the first address in the 40000 block, and is equivalent to HR1 when ModiconTypedAddr1Offset is 0, or HR0 when ModiconTypedAddr1Offset is 1) If you change the property ModiconTypedAddr1Offset, it will be changed for all Modbus-compatible drivers in the application. If you need some drivers to be zero-based and others to be one based, you can achieve this by creating a parent Context tag for each driver, adding a property named ModiconTypedAddr1Offset to that Context tag. The child driver tag will take the value in the parent Context tag instead of the global property value. (See: Context tag properties, Settings tab)
Modbus Compatible Device Properties
Properties folder tab | Property | Value |
---|---|---|
Options tab | Comm Channel | Serial RTU |
Serial tab | PLC Address | 1 |
Serial tab | Time-Out Limit | 0.5 (Make it shorter if Scan Interval is going to be very short) |
Serial tab | Port | COM2 (name of Serial Port tag) |
Serial tab | Retry Delay | 0 |
Serial tab | Hold | deselected |
Serial tab | Retries | 2 |
Serial tab | RTS Key Off Delay | 0 |
Modbus Compatible Device I/O Addressing
The ID tab of every tag includes the same common elements: Name, Area, Description, and Help ID.
Name:
Uniquely identifies each tag in the application. If the tag is a child of another, the parent names will be displayed in a separate area before the name field.
You may right-click on the tag's name to add or remove a conditional start expression.
Area
The area field is used to group similar tags together. By defining an area, you make it possible to:
- Filter for particular tag groups when searching in the tag browser
- Link dial-out alarm rosters to Alarm tags having a particular area
- Limit the number of tags loaded upon startup.
- Filter the alarm display to show only certain areas.
- Filter tag selection by area when building reports
When working with Parent-Child tag structures, the area property of all child tags will automatically match the configured area of a parent. Naturally, you can change any tag's area as required. In the case of a child tag, the field background will turn yellow to indicate that you have applied an override. (Orange in the case of user-defined types. Refer to Configuration Field Colors)
To use the area field effectively, you might consider setting the same Area for each I/O driver and its related I/O tags to group all the tags representing the equipment processes installed at each I/O device. You might also consider naming the Area property for the physical location of the tag (i.e. a station or name of a landmark near the location of the I/O device). For serial port or Roster tags, you might configure the Area property according to the purpose of each tag, such as System or Communications.
You may define as many areas as you wish and you may leave the area blank for some tags (note that for Modem tags that are to be used with the Alarm Notification System, it is actually required that the area field be left blank).
To define a new area, type the name in the field. It will immediately be added. To use an existing area, use the drop-down list feature. Re-typing an existing area name is not recommended since a typo or misspelling will result in a second area being created.
There is no tool to remove an area name from VTScada since such a tool is unnecessary. An area definition will exist as long as any tag uses it and will stop existing when no tag uses it (following the next re-start).
Description
Tag names tend to be brief. The description field provides a way to give each tag a human-friendly note describing its purpose. While not mandatory, the description is highly recommended.
Tag descriptions are displayed in the tag browser, in the list of tags to be selected for a report and also on-screen when the operator holds the pointer over the tag’s widget. For installations that use the Alarm Notification System, the description will be spoken when identifying the tag that caused the alarm.
The description field will store up to 65,500 characters, but this will exceed the practical limits of what can be displayed on-screen.
This note is relevant only to those with a multilingual user interface:
When editing any textual parameter (description, area, engineering units...) always work in the phrase editor. Any changes made directly to the textual parameter will result in a new phrase being created rather than the existing phrase being changed.
In a unilingual application this makes no difference, but in a multilingual application it is regarded as poor practice.
Help Search Key
Used only by those who have created their own CHM-format context sensitive help files to accompany their application.
Server List
Select (or create) a named server list.
Modbus Compatible Device: Options tab
The Options tab of the Modbus Compatible Device tag properties folder can be used to set byte swapping for long integer, IEEE single or IEEE double bytes. If this driver is communicating over a modem, then the Options tab is also used to indicate that squelch noise should be suppressed, if present.
Comm Channel
Select the communication channel and protocol to use for this Modbus Compatible Device driver. This will be one of:
- Serial RTU Select to use the RTU mode of the Modbus serial communications standard.
- Serial ASCII Select to use the ASCII mode of the Modbus serial communications standard.
- SA-85 (MB+) Select to use the Modbus Plus communications protocol via a Modicon SA-85 card.
- Embedded TCP/IP Select to use the Embedded TCP/IP protocol.
- Open Modbus TCP Select to use the Modicon Open Modbus/TCP specification to receive Modbus protocol over Ethernet TCP/IP.
Squelch Noise Present
Applies when communicating over a modem. Select this box to enable the squelching of background noise. By default, the Squelch Noise Present check box is not selected.
Reverse Long Integer Byte
Select whether byte swapping should occur for long integer values. By default, the Reverse Long Integer Byte check box is not selected.
Reverse IEEE Single Byte
Select whether byte swapping should occur for IEEE single byte values. By default, the Reverse IEEE Single Byte check box is not selected.
Reverse IEEE Double Byte
Select whether byte swapping should occur for IEEE double byte values. By default, the Reverse IEEE Double Byte check box is not selected.
Force Multi Element Write OpCodes
Certain hardware requires data to be written using multi-element OpCodes (15 and 16) even though the actual data is single-element (OpCodes 5 & 6). By selecting this box, you can ensure that this driver instance is able to communicate with devices that require the multi-element codes.
Store Last Output Values
When selected, the driver will maintain a record of the last value written to each output address. This may be useful in at least two situations:
- For hardware that does not maintain its state during a power loss and must be restored to that state when re-started.
- When failed hardware is replaced by a new device and you would like to start that device with the values last written to the old one.
If the last output values are stored, they may be re-written by either of two methods:
- Automatically, when communication is restored to the device.
- Manually by way of a button press. See, Rewrite Outputs Widget for details.
Changing this value from selected to deselected will cause all stored values to be erased immediately.
If this driver is being used in conjunction with a Driver Multiplexer, then configure the Driver Multiplexer to store the last values, not the drivers connected to the Multiplexer. In this case, only the Multiplexer should be configured to re-write automatically.
Enable Auto Rewrite
If selected, the Store Last Output Values option will also be activated. This option causes the driver to rewrite the last value written to each output, in the event that communications are lost and then restored.
Use this option only if you are certain that you want the last values to be rewritten automatically after an interruption in driver communications.
Maximum Coalesce Gap
Use only if the Modbus compatible device does not support reads from addresses that are not explicitly declared in the device. VTScada will attempt to coalesce reads from a range of addresses, which may lead to an error with these devices.
If left blank, there is no effect on driver coalescing.
Set to zero to allow for devices that cannot read from addresses that are not explicitly declared.
Set to a number greater than zero to fine-tune read coalescing. The gap is measured in units of two-byte words. Warning: when using low maximum coalesce gap values, it is important to avoid unnecessary gaps in VTScada tag addresses.
if this value is set, driver response time may be slowed due to the increased number of read blocks.
See also: VTSMaxBlock
Modbus Compatible Device: Serial tab
The Serial tab for the Modbus Compatible Device Driver tag properties folder consists of attributes used to identify and establish a connection to the hardware.
Port
Enables you to select the Serial Port tag or TCP/IP tag you wish to be associated with this driver tag. A Serial Port tag opens a serial port to enable communications between VTScada and your PLC or RTU. A TCP/IP tag enables you to connect to a series of hosts, allowing you to transmit data across a network or over the Internet.
The Port field can be cleared using the X button that appears to its right.
IP Network Listener Group
Configure only if this driver is to accept in-bound TCP or UDP communications. Select an existing IP Network Listener tag using the drop-down list.
If the IP Network Listener is configured, this driver must use Open Modbus TCP, configured on the Options tab.
IP Allow
Optional. Misconfiguration of this field is a common source of problems.
Used in connection with an IP Network Listener tag. General IP address filtering should be set on the IP Network Listener, as this will be more efficient. The list of allowed IP addresses in the driver is intended to prevent misconfigured devices from interfering with other devices.
Both filters (that in the Network Listener and this one) can be configured at the same time. The filter in the IP Network Listener will be applied when the device first connects and the local filter will be applied after a specific driver instance has been identified.
Station Address Mode
Use to limit the range of allowed addresses. Select according to your hardware. (The Lufkin and TeleBUS options are sometimes used by Oil & Gas applications and seldom elsewhere.)
Standard Address ... 1 - 247 according to Modbus Protocol. Extended addressing ranges cannot be entered directly.
An expression can be used for this parameter in order to bypass the limit if your device uses a modified Modbus protocol. Proceed with caution.
Lufkin ELAM Address ... 1 - 2295
TeleBUS Extended Address ... 1 - 65534
If the driver is running as a virtual server, the addressing is limited to the standard range, 1 - 247.
PLC Address
The station address of the Modicon programmable logic controller. By default, the PLC Address field is set to 1.
An expression may be used to provide the address if needed. This may be required on a network where the address varies depending on the workstation where the tag is running.
Note that, to create a valid expression for an address that contains non-numeric characters, you must enclose the address in quotation marks. e.g. "31.0.0.0" See: Modbus Plus PLC Addressing.
Time-Out Limit
Set the receiver time-out limit in seconds or fractions of a second. This is the length of time that this driver should wait for a reply from the PLC or RTU.
Retries
The number of times to retry a message before declaring an error.
Use only if the driver is connected to a device that uses a serial port or a UDP/IP port that is configured to be polled. When connected directly to a device using TCP/IP, this value should normally be set to 0 since TCP/IP is a guaranteed message delivery protocol.
For unreliable communications, such as radio, set to 3 or 4.
Retry Delay
The Retry Delay field enables you to specify the amount of time (in seconds or fractions of a second) that the driver will wait between attempts to repeat a transmission of data if the previous attempt(s) have failed.
By default, the Retry Delay field is set to 0 (indicating that there should be no delay between retry attempts).
Hold
Select this to have I/O tags attached to the driver hold their last value in the event of a communication failure. If not selected, tags will have their value set to invalid on a communication failure.
RTS Key Off Delay
The RTS Key Off Delay field represents the amount of time (in seconds) that this Modbus Compatible Device will wait before dropping RTS at the end of a data transmission.
Squelch Time
Sets the amount of time (in seconds or in fractions of a second) to wait before clearing noise. Enabled only when Squelch Noise Present has been selected on the Options tab.
Modbus Compatible Device properties Modbus Plus tab
The Modbus Plus tab of the Modbus Compatible Device tag properties folder is used when an SA-85 I/O card for Modbus Plus communications has been configured.
SA-85 Adapter Number
The SA-85 Adapter Number section enables you to specify the number of the adapter if you have installed an SA-85 network adapter card for Modbus Plus communications networks. You can specify adapter 0, adapter 1, or none by selecting the associated radio button. The default setting for the SA-85 Adapter Number section is None.
SA-85 Polling Rate
Set the rate in seconds or fractions of a second at which you wish the SA-85 network adapter card to be polled. The default SA-85 Polling Rate setting is 0.025.
Retries
Select the number of attempts that will be made by this driver if there is no reply to a message. An error will be declared after this number has been reached.
Time Out (x500mS)
Specify the message response time limit that the driver will wait for a reply from the PLC. This time limit may be set from 1 to 20 increments. The default setting for the spin box is 2 (i.e. two 500 millisecond increments, or 1 second).
Maximum Paths Open
Set the maximum number of Modbus Plus sessions that can be opened simultaneously by the installed SA-85 network adapter. The Maximum Paths Open spin box may be set from 1 to 8. The default setting for the Maximum Paths Open spin box is 8.
Modbus Compatible Device: Virtual I/O tab
These properties are used to configure a virtual PLC in the memory of your PC. If using virtual addresses, and if your server is connected to the Internet, you may wish to enhance security by adding an IP Network Listener tag. See: IP Network Listener Tags
Holding Coils 0xxxx (0-999)
Enter the number of 00000-series holding coils to be assigned to the virtual PLC.
Input Coils 1xxxx (0-9999)
Enter the number of 10000-series input coils to be assigned to the virtual PLC.
Input Registers 3xxxx (0-9999)
Enter the number of 30000-series input registers to be assigned to the virtual PLC.
Holding Registers 4xxxx (0-9999)
Enter the number of 40000-series holding registers to be assigned to the virtual PLC.
The following widgets are available to display information about your application’s Modbus Compatible Device Driver tags: