Modbus Slave PLC Device Tag

Help Contents

Introduction

The Modbus Slave PLC Device Tag PLC Device Tag Icon represents a virtual Modbus PLC Device that can be polled by external drivers.

Configuration Properties

The Modbus Slave PLC Device Tag supports the configuration properties of the Common Core Tag, plus these properties:

Property Type Version Description
Channel Reference 3.10 The Modbus Slave Communication Channel to the device.
Address USINT 3.10 The Modbus unit address of the device.
WordOrder USINT 3.10 For multi-word tags, the order of words. 0 = High word first, 1 = Low word first.

Dynamic Properties

The Modbus Slave PLC Device Tag supports the dynamic properties of the Common Core Tag, plus these additional properties:

Property Type Description
State UINT The current state of the Virtual PLC.
StateDescription WSTRING A string that describes the current state of the Virtual PLC.
EventCount UDINT The number of Modbus commands successfully processed, excluding poll commands and fetch event counter commands. This value is also returned in the second word of the response to Modbus command 11 (Read comm event counter).
MessageCount UDINT The number of Modbus messages received by the Virtual PLC. This value is also returned by Modbus Command 08 (Diagnostics) using sub-function 14 (Slave Message Count).
ExceptionCount UDINT The number of Modbus exceptions returned by he Virtual PLC. This value is also returned by Modbus Command 08 (Diagnostics) using sub-function 13 (Bus Exception Count).

Tag Commands

The Modbus Slave PLC Tag does not support any tag commands.

Data Map

The Data Map is a text file to define the relationship between registers in the Virtual PLC and tag references in the SCADA database.

For example you can map Holding Register 40001 to an I/O Analog Data Point Tag associated with a PLC. How the virtual PLC responds to external requests is shown in this table:

External Request Virtual PLC Response
Read holding register 40001 The value of the I/O Analog Data Point Tag is returned.
Write holding register 40001 The write command is forwarded to the PLC via the I/O Analog Data Point Tag.

Data Map Examples

  1. To map output coil 00005 to a Digital Data Point Tag called Digital-Tag-1:
    BOOL "0005" %"Digital-Tag-1";
  2. To map bit 1 in holding register 40001 to a Digital Data Point Tag called Digital-Tag-2:
    BOOL "40001.1" %"Digital-Tag-2";
  3. To map holding register 40002 to an Analog Data Point Tag called Analog-Tag-1 where: Use:
    WORD "40002" %"Analog-Tag-1" Scale 655.35;
  4. To map holding registers 40003 & 40004 to an Analog Data Point Tag called Analog-Tag-2 writing a float value directly across 2 registers:
    REAL "40003" %"Analog-Tag-2";
  5. To map holding register 40005 to a Word Data Point Tag called Word-Tag-1:
    WORD "40005" %"Word-Tag-1";
  6. To map holding registers 40006 & 40007 to a Double Word Data Point Tag called DWord-Tag-2:
    DWORD "40005" %"DWord-Tag-1";

Editing the Data Map

To edit the data map, do one of the following:

In either case the Data Map Editor will open.

Data Map Syntax

The syntax of the data map is:

data-map ::=
  data-binding *

data-binding ::=
  data-type data-address tag-reference ['Offset' offset-value] ['Scale' scale-value];

data-type ::=
  BOOL | SINT | USINT | BYTE | INT | UINT | WORD | DINT | UDINT | DWORD |
LINT | ULINT | LWORD | REAL | LREAL | TIME | TIME_OF_DAY | TOD | DATE | DATE_AND_TIME | DT;

data-address ::=
  '"' address-value '"'

tag-reference ::=
  '%' '"' address-value '"'

offset-value ::=
  integer | real | time

scale-value ::=
  integer | real

Modbus Register Ranges

The Virtual PLC in the Modbus Slave PLC Tag supports these register ranges:

Register TypeSizeAddress Range
Coils409600001 to 04096
Discrete Inputs25610001 to 10256
Input Registers830001 to 30008
Holding Registers25640001 to 40256

Relationships to Other Tag Types

The Modbus PLC Tag builds on the features of these tag types:

Further Information

Modbus Data Address Format

For a description of how Modbus data addressing works in Fernhill SCADA.

Common Core Tag

For properties common to all tag types.

Modbus Slave Serial Communication Channel

For more information on serial communications to the Modbus Virtual PLC Device.

Modbus Slave TCP/IP Communication Channel

For more information on TCP/IP communications to the Modbus Virtual PLC Device.

Glossary

For the meaning of terms used in Fernhill SCADA.