Beruflich Dokumente
Kultur Dokumente
6802979C25-H
AB
Info-ZIP
Version:
Description:
Software Site:
http://www.info-zip.org/
Source Code:
The Source Packages for this software are available from the original Software Site, or may be acquired
from Motorola. To obtain the Software from Motorola, please contact Motorola using the methods
described in the preamble of this Legal Notices and End User License Agreement Document.
License:
This is version 2005-Feb-10 of the Info-ZIP copyright and license. The definitive version of this
document should be available at ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely.
This software is provided "as is," without warranty of any kind, express or implied. In no event shall Info-ZIP or its
contributors be held liable for any direct, indirect, incidental, special or consequential damages arising out of the use of or
inability to use this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. Redistributions of source code must retain the above copyright notice, definition, disclaimer, and this list of conditions.
2. Redistributions in binary form (compiled executables) must reproduce the above copyright notice, definition, disclaimer,
and this list of conditions in documentation and/or other materials provided with the distribution. The sole exception to this
condition is redistribution of a standard UnZipSFX binary (including SFXWiz) as part of a self-extracting archive; that is
permitted without inclusion of this license, as long as the normal SFX banner has not been removed from the binary or
disabled.
3. Altered versions--including, but not limited to, ports to new operating systems, existing ports with new graphical interfaces,
and dynamic, shared, or static library versions--must be plainly marked as such and must not be misrepresented as being
the original source. Such altered versions also must not be misrepresented as being Info-ZIP releases--including, but not
limited to, labeling of the altered versions with the names "Info-ZIP" (or any variation thereof, including, but not limited to,
different capitalizations), "Pocket UnZip," "WiZ" or "MacZip" without the explicit permission of Info-ZIP. Such altered versions
are further prohibited from misrepresentative use of the Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s).
4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip," "UnZipSFX," "WiZ," "Pocket UnZip," "Pocket Zip," and
"MacZip" for its own source and binary releases.
Credits:
N/A
Table of Contents
MODBUS .......................................................................................................................................................... 1
RTU as PLC................................................................................................................................................... 1
Local RTU as PLC Master............................................................................................................................. 2
General System .............................................................................................................................................. 3
MODBUS Drivers.......................................................................................................................................... 4
MODBUS Data Types.................................................................................................................................... 4
Floating Point Numbers ................................................................................................................................ 7
RTU Definitions for MODBUS Support ........................................................................................................ 9
Data Types ..................................................................................................................................................................9
PLC Table ...................................................................................................................................................................9
PLC TCP/IP Access Control Table ...........................................................................................................................12
Port Configuration and Protocol Downloading .........................................................................................................14
MODBUS
The MODBUS protocol support is applicable to the following situations:
a)
b)
Slave Configuration: Connecting an RTU as a slave to any SCADA master using the
MODBUS protocol. The SCADA central can control all RTUs, as well as all PLCs.
In addition, the RTU communication may be used as a wide area communication network
between a MODBUS-based central and its PLCs.
The RTU-to-MODBUS connection is described in this chapter according to the following
configurations:
1) RTU as PLC
2) Local RTU as PLC Master
3) General System Configuration
RTU as PLC
The RTU as PLC configuration allows the connection of a MODBUS-based central computer
to an MDLC Network, via serial line or TCP/IP media.
The port of this RTU is defined as (Connected to) Master Computer. The central computer can
access the database of this RTU that reflects the databases of all RTUs in the field.
In the RTU as PLC, definition of the PLC Table is required.
MODBUS
PLC Table
Ind
0
PLC
Address
Connected to
RTU (Name)
LOCAL
RTU AS PLC
RTU
PLC#=1
Serial or
TCP/IP
MODBUS PORT
TO MASTER
RTU
AS PLC
MDLC NETWORK
RTU
SCADA CENTRAL
(MASTER)
RTU
For a detailed description of the site configuration and application definitions, refer to RTU as
PLC (Connected to Master Computer).
Up to six ACE3600 RTU ports can be defined as third party protocol ports (including serial
and/or TCP/IP MODBUS ports.)
MODBUS over TCP supports the use of MODBUS messaging in an Intranet or Internet
environment using the TCP/IP protocol, where the RTU acts a MODBUS/TCP server (pure
slave). Note that the MODBUS TCP/IP slave works in a listening to master manner (i.e. it
opens a listening socket and waits for the MODBUS master incoming requests to connect to
the slave) and does not initiate communication with the master.
MODBUS
RTU
RTU
MDLC NETWORK
RTU
AS PLC
MASTER
MODBUS
Serial or TCP/IP
PLC1
PLC
MODBUS PORT
TO SLAVE
PLC#=1
PLC Table
RTU
Ind
PLC
Address
Connected to
RTU (Name)
LOCAL
PLC1
For a detailed description of the Site Configuration and Application definitions, refer to
Step-by-Step Definitions below.
General System
MODBUS
RTU 13
MODBUS PORT
TO SLAVE
PLC1
RTU
FOX1
MODBUS PORT
TO MASTER
RTU
LOCAL
MDLC NETWORK
SCADA CENTRAL
RTU
(MASTER)
RTU
MODBUS PORT
TO SLAVE
PLC2
FOX5
MODBUS PORT
TO SLAVE
PLC1
MODBUS
RTU 15
MODBUS
RTU 14
MODBUS
MODBUS Drivers
Six drivers are supplied for MODBUS protocol support. They are:
Driver file name
Description
MB.2M_PLC1
MB.2M_PLC2
MB.2M_PLC3
MB.2S_PLC1
MB.2S_PLC2
MB.2S_PLC3
Note: If the appropriate driver (.fls file) is not downloaded to the RTU, MODBUS protocol
support will not be available.
Command
MODBUS
Function
Code
RTU Equivalent
Logic Coils
Read
Discrete Output
Discrete Inputs
Read
Discrete Input
Holding Registers
Read
Calculated Internal
Value
Input Registers
Read
Value Input
Logic Coils
Write (single
coil)
Discrete Output
Holding Registers
Write (single
register)
Calculated Internal
Value
Logic Coils
Write
15
Discrete Output
Holding Registers
Write
16
Calculated Internal
Value
MODBUS
The RTU defined as a MODBUS slave supports the following data types/commands from the
MODBUS protocol:
Data Type
Command
Logic Coils
Read
Discrete Inputs
Read
Holding Registers
Read
Input Registers
Read
Logic Coil
Holding Register
Write (single
register)
None
Loopback test
Logic Coils
Write
15
Holding Registers
Write
16
Report Slave ID
17 dec.
By default, ACE3600 uses function code 15 (Multiple Logic Coil Write) and does not use
function code 5 (Single Coil Force command). This is true even when writing to a Single Coil.
By default, ACE3600 uses function code 16 (Write Multiple Registers) and does not use
function code 6 (Single Register Preset command). This is true even when writing to a Single
Register.
In order to enable the Single Coil Force or Single Register Preset command perform the
instruction below for each MODBUS port defined as a port connected to a Slave:
1. Run the ACE3600 STS.
2. In the site port configuration, click on Advanced Configuration.
3. Select Driver specific parameter #3. This parameter is actually a mask, or set of bits, each
of which can be set or unset, each with a different meaning. To enable the Single Coil
Force command (function code 5), set the mask to 0x0002 (or decimal value 2).
To enable the Single Register Preset command (function code 6), set the mask to 0x0004
(or decimal value 4).
If you want to enable BOTH commands, set the mask to 0x0006 (or decimal value 6).
Note: when trying to write to more than one Coil, function code 15 (Multiple Coils Write) is
always used, even if the mask 0x0002 is set on.
Note: when trying to write to more than one Register, function code 16 (Multiple register
Write) is always used, even if the mask 0x0004 is set on.
Function code 5 (Single Coil Force command) is used if writing exactly one bit and the
corresponding mask 0x0002 is set on in Driver specific parameter #3.
MODBUS
Function code 6 (Single Register Preset command) is used if writing exactly one register and
the corresponding mask 0x0004 is set on in Driver specific parameter #3.
A Report Slave ID command has been added to support the VXL SCADA central. This may be
useful if the SCADA Central has to identify a communication failure (cause and location).
For example, the two RTUs may be defined as MODBUS slaves in the PLC Table. If the
communication to the PLC fails, the SCADA Central may issue the Report Slave ID command
to each of the RTUs.
The RTUs response to this command for the MODBUS RTU protocol is:
ADDR
FUNC
BYTE
COUNT
XX
11
RESERVED FLAGS
BYTE1
BYTE2
CRC
BYTE3
XX
XX
where:
ADDR:
FUNC:
BYTE COUNT:
RESERVED FLAGS:
PLC address
11 hexa
3 bytes of RTU status data follow this field
24 bits for the Reserved Flags Table (one of RTU system tables).
This field consists of the 3 bytes described in the following tables:
BYTE1
Bit Position in
Byte1
Index in Reserved
Flags Table
Flag Name
I/O_Fl
Init
PwrUp
AC_Fal
BatFal
PushB1
PushB2
MODBUS
BYTE2
Bit Position in
Byte2
Index in Reserved
Flags Table
Flag Name
TskPrA
TskPrB
10
TskPrC
11
TskPrD
12
13
14
15
BYTE3
Bit Position in
Byte3
Index in Reserved
Flags Table
Flag Name
16
ErrLog
17
TimTag
18
DefC_Y
19
CntCom
20
21
22
23
IsEvnt
Note: Position 7 of a byte is the most significant bit, and position 0 the least significant bit.
CRC:
2 bytes of CRC.
MODBUS
MODBUS protocol does not define floating point data type (4 bytes). To allow floating point
data type transfer, each floating point element is represented by 2 integers (2 bytes each).
To enable correct floating point number transfer between the ACE3600 master and the
MODBUS slave, or between the MODBUS master and the ACE3600 slave, one should define
the format of how the floating point number is transmitted (for each MODBUS port):
1. Run the ACE3600 STS.
2. In the site port configuration, click on Advanced Configuration.
3. Select Driver specific parameter #3. This parameter is actually a mask, or set of bits, each
of which can be set or unset, each with a different meaning.
4. To designate that the low order integer register is sent first, followed by the high order
register, set the mask to 0x0001 (or decimal value 1). To designate that the high order
integer register is sent first, followed by the low order register, unset the mask bit 0x0001
(or decimal value 0). In most cases, the mask 0x0001 should be set on, though the format
depends on the vendor.
Recall that other bits in the parameter #3 mask enable/disable other functions. Therefore,
care should be taken when changing the value of the bits.
MODBUS
PLC_VI PLC Value Input. This data type is used to read integer elements from a third
party RTU. Each element in a PLC_VI column is a 2-byte signed integer (value). The
column length must be defined as the number of the registers that are to be read.
PLC_VO PLC Value Output. This data type is used to write into the Holding Registers in
a third party RTU.
PLC_DI PLC Discrete Input. This data type is used to read 1-bit elements from a third
party RTU, such as discrete inputs.
PLC_DO PLC Discrete Output. This data type is used to write 1-bit elements into a third
party RTU, such as logic coils.
PLC_RI PLC Real Input. .This data type is used to read real (floating point) elements
from a third party RTU. Each element in PLC_RI is a 4-byte real (floating point) number.
PLC_RO PLC Real Output. This data type is used to write real (floating point) elements
to a third party RTU. Each element in PLC_RO is a 4-byte real (floating point) number.
PLC Table
The PLC Table, one of the System Tables, is used to define the connectivity to the third party
PLC units in the system. This table must be defined for:
Any RTU, which serves as a PLC master for a PLC connected to one of its ports or
connected to one of the other RTUs in the network.
MODBUS
Connected to RTU (name) the name of the RTU to which the PLC is connected. Click the
arrow to open the list. If the RTU is locally connected to one of the ports of the unit where
the PLC Table is to be defined, choose LOCAL from the choice list.
via Port (name) the name of the port for connection. Click the arrow to open the list.
Choose the same name that was used when the port was defined.
Slave Addr The IP address of the TCP/IP slave/PLC (type IPAddrPrm). This column is
valid only when the 'Connected to RTU' field is set to Local and the via Port field is set
to PLC1/2/3 (not RTU as PLC.) Otherwise, N/A is displayed.
Comm Status (Slave) the status of the slave/PLC (0 = Inactive, 1 = Active) (type int)
Note: If Comm Status = 1 and the PLCStt variable returns an error, this indicates a problem
with the user application. The status is displayed during the table monitor. The status is
N/A when the communication is not MODBUS master over TCP/IP. For details on the
possible PLCStt returned errors, see the list from the PLC Status Defines table in Scan
from Rungs above.
If the PLC is connected directly via a UART port to the RTU master, then define the
Connected to RTU field as LOCAL and the via Port field as PLC 1, 2 or 3.
10
MODBUS
If the PLC is connected to a remote unit which acts as a router, then define the Connected to
RTU field as the RTU router Site Name. Assign the name that was used in the Site Table.
If the remote is an RTU which acts as PLC slave, then define the Connected to RTU field as the
RTUs remote Site Name and the via Port field as RTU AS PLC.
11
MODBUS
PLCportName the name of the port (PLC1, PLC2, PLC3) on the master for connection to
the slave at the authorized IP address. Click the arrow to open the list. Choose the same
name that was used when the port was defined.
Note: If the PLCportName is undefined, the corresponding IP address is ignored.
#TotalConnection the total number of IP connections of the slave with the master,
including active, disconnected and unstable connections. (read-only during monitor)
12
MODBUS
#ActiveConnection the number of active IP connections of the slave with the master
which are connected to the master and have not timed out. (read-only during monitor)
#UnstableConnection the number of IP connections of the slave with the master which
are unstable (erratic). (read-only during monitor)
Duplicate IP addresses may appear in the PLC TCP/IP Access Control Table. If a duplicate
row is deleted, the other rows remain.
Note: If the master port is defined as Ethernet Dynamic LAN, the IP address which is returned
by the DHCP server may generate unauthorized IP address error messages. In this case, this
IP address can be added to the PLC TCP/IP Access Control table via the Application
Programmer table monitor, ladder rungs or C application.
13
MODBUS
Port Configuration
The PI1, SI1, SI2, PI2 serial/plug-in CPU ports may be defined as a serial Third Party Protocol
PLC port. Ports SI1 and SI2 may also be defined as MODBUS ports over TCP/IP (PPP). Ports
PI1 and PI2 may also be defined as MODBUS ports over TCP/IP (Ethernet). Port ETH1 may
only be defined as an IP MODBUS port over TCP/IP (Ethernet).
Data Speed This field defines the communication data speed of the selected Connection
Type. The default is 9600 bps.
(Advanced Configuration->) Format This field defines the UART's character format for
the communication port. The default is 8 bit, no parity, 1 stop bit. Click the arrow to open a
list that includes all combinations of 7/8 bits, even/odd/no parity, and 1/2 stop bits.
(Advanced Configuration->) DTR/CTS Support This field defines the DTR/CTS Support.
Set this option to Yes ONLY if DTR/CTS support is provided by the computer
connected to the ACE3600 RTU.
Port Name Set to PLC1-3. The Port Name must be set to PLC1-3 if Protocols is set to
MODBUS slave/master.
14
MODBUS
Host Full Name (DHCP Client only) The full name of the port as provided by the DNS
Server. The DHCP Server will update the DNS Server when allocating or changing the IP
address of that host, keeping it up to date with the recent address of port. If a DHCP
Server/router does not support this option, a warning will be logged. For more information
on DHCP/DNS, see the ACE3600 STS Advanced Features manual.
Note: The MODBUS master should know in advance either the MODBUS slave IP address
or its Host Full Name, so that it can connect to a known IP address/Host Full Name of the
MODBUS slave. In the case of MODBUS over GPRS (PPP port), the GPRS modem
should have a fixed (predefined) IP address and the master should use this IP address to
connect to the slave.
(Advanced Configuration->)Check alive mode the Check alive mode can be set to Active
or Passive:
Active TCP is controlled by the TCP stack of the VxWorks operating system. The
MODBUS slave is polled by the masters connection using the TCP sockets Check alive
option. If the idle time on the connection exceeds 60 seconds, a Check alive probe is
triggered. After the first Check alive probe, a probe is sent every 75 seconds (up to four
times), unless a probe response is received. If no probe response is received after sending
out four Check alive probes, the TCP connection is dropped.
Passive (Default) TCP is controlled by the application. In this case, the Check alive
timeout parameter must be set. The application checks whether the server received any
15
MODBUS
communication until the Check alive timer expires. If the Check alive timeout parameter is
set to 0, the check alive mechanism will not be used.
(Advanced Configuration->)Check alive timeout the timeout in seconds from the last
communication received from a master. If this parameter is 0, a master will always be
considered as reachable, once a single reception has been received from it. Otherwise the
slave RTU disconnects from the master. Range 0-65535. Default 35. (Relevant only if
Check Alive mode is set to Passive.)
(Advanced Configuration->)TCP listen port The TCP port used by the Slave for
MODBUS communications. Default 502. This default value is standard in TCP.
Therefore, it is highly recommended to leave the default as is.
(Advanced Configuration->Remote TCP port The TCP port used by the Slave for
MODBUS communications. Default 502. This default value is standard in TCP.
Therefore, it is highly recommended to leave the default as is.
16
MODBUS
Step-by-Step Definitions
RTU as PLC (Connected to Master Computer) Serial MODBUS
Site Configuration
1. Define one of the ports as RS232, Async, Third party protocols, (Connected to) Master.
2. Define the Link Name: PLC 1, PLC 2, or PLC 3.
3. Select the appropriate Data Speed.
4. Click on the Advanced Configuration button, and select (if supported by the Master) the
DTR/CTS Support parameter to Yes.
5. In the Advanced Properties, set the Format parameter to the appropriate format. (The
default is 8 bit, no parity, 1 stop bit.)
6. Save the Advanced Configuration and the port configuration in the site.
Third Party Protocol Downloading
1. In the ACE3600 STS Downloader utility, make sure that the ACE3600 STS is connected to
the proper site ID/link ID.
2. Select the site configuration to be downloaded to the RTU.
3. Select the appropriate protocol file as described in Third Party Protocol Downloading
above.
4. Download the selected files to the RTU.
Application Programmer System Tables
1. In the Application Programmer Database tab, open the PLC Table under System Tables
and set the values as follows:
PLC address
as required
LOCAL
RTU AS PLC
17
MODBUS
4. Click on the Advanced Configuration button, and select (if supported by the Slave) the
DTR/CTS Support parameter to Yes.
5. In the Advanced Properties, set the Format parameter to the appropriate format. (The
default is 8 bit, no parity, 1 stop bit.)
Third Party Protocol Downloading
1. In the ACE3600 STS Downloader utility, make sure that the ACE3600 STS is connected to
the proper site ID/link ID.
2. Select the site configuration to be downloaded to the RTU.
3. Select the appropriate protocol file as described in Third Party Protocol Downloading
above.
4. Download the selected files to the RTU.
System Tables
1. In the Application Programmer Database tab, open the PLC Table under System Tables
and set the values as follows:
PLC address:
LOCAL
PLC1
Additional Configuration
2. Click on the Protocols button and select the Modbus Slave Protocol.
3. Define the Port Name: PLC 1, PLC 2, or PLC 3.
18
MODBUS
4. Click on the Advanced Configuration button, and set the standard MODBUS advanced
parameters (described in Appendix A: Site Configuration Parameters in the ACE3600 STS
User Guide) and the special MODBUS TCP/IP parameters described in Port Configuration
for MODBUS over TCP/IP above, as necessary.
Note: In general, no changes to the default values of the advanced parameters are required.
5. Save the Advanced Configuration and the port configuration in the site.
Third Party Protocol Downloading
1. In the ACE3600 STS Downloader utility, make sure that the ACE3600 STS is connected to
the proper site ID/link ID.
2. Select the site configuration to be downloaded to the RTU.
3. Select the appropriate protocol file as described in Third Party Protocol Downloading
above.
4. Download the selected files to the RTU.
Application Programmer System Tables
1. In the Application Programmer Database tab, open the PLC Table under System Tables
and set the values as follows:
PLC address
as required
LOCAL
RTU AS PLC
2. In the Application Programmer Database tab, open the PLC IP Access Control Table and
create an entry for each authorized master and the corresponding PLC port on the slave to
which master will connect.
3. Define the database tables and process.
Additional Configuration
19
MODBUS
PLC address:
LOCAL
PLC1
IP address:
to IP address of slave
20
MODBUS
Static I/O Link each column is bound to the slave database with the formal I/O Link
(as for I/O)
Dynamic I/O Link each column is bound to the slave database by the ladder at
runtime, by programming the PLC Dynamic IOLINK system table before the SCAN
operation.
The ACE3600 RTU selects the method according the value of PlcElmNum in the PLC
Dynamic IOLINK system table. During the SCAN of the PLC column type, the ACE3600
RTU examines the value of PlcElmNum. If it is equal to 0, static I/O is selected. If it is not
equal to zero, the I/O Link parameters are expected to be programmed in the PLC Dynamic
IOLINK system table.
If PlcElmNum == 0, use Static I/O Link.
If PlcElmNum <> 0, use Dynamic I/O Link.
MODBUS
If the first element of the column corresponds to input 10003, the PLC Coord1 must be set
to 2.
4) Coord1 Len should be set to 2. The length of Coord1 is 2 bytes.
Note: Do not change the last three lines for coordinates. They are reserved for protocols with
more than one coordinate.
PlcElmNum should be set to zero if Static I/O Link is used, otherwise it is generally set
to the number of elements (rows in column) in the corresponding PLC_DI, PLC_DO,
PLC_VI, PLC_VO, PLC_RI, PLC_RO data type column being accessed by the SCAN
operation. Note: PlcElmNum should be less than or equal to the number of elements (rows
in column) in the corresponding column accessed by SCAN.
Special constants have been defined in the PLC Dynamic IOLINK Constants table for setting
the PlcDataType field: These include:
PLCBit
PLCVal
PLCRel
fc1_Read_Logic_Coil
fc2_Read_Discrete_Input
fc3_Read_Holding_Register
fc4_Read_Input_Register
fc3_Read_PLCRel
fc5_fc15_Write_Logic_Coil
fc6_fc16_Write_Holding_Register
22
MODBUS
fc16_Write_PLCRel
PlcCoord1 Should be set the same as described for "Coord1" in the Static I/O Link
section above.
Other fields of the PLC Dynamic IOLINK table are irrelevant for MODBUS protocol and
should be ignored.
23
MODBUS
column
( SCAN )
=
PLCBsy
PLCStt is an integer status system variable. The purpose of this variable is to give an indication
of the communication with PLCs. The values for this variable are defined in the PLC Status
Defines table (one of the Constants Tables).
MODBUS
If the communication is not successfully terminated, the PLCStt variable is changed to one of
following values:
NO_Buf
PLCFal
PLCIol
PLCAdr
PLCTim
PLCRpl
Logic Coils
Discrete Inputs
Holding Registers
Input Registers
The ACE3600 versatile database enables mapping of various data types to any MODBUS
register/bit address (0-65355). However, some SCADA Centrals address the data types
according to a predefined register mapping scheme such as:
Logic coils (bit output) range:
00001-10000
10001-30000
30001-40000
40001-49999
The ACE3600 user database is accessible (for MODBUS read/write operation) from the
SCADA using the MODBUS protocol.
ACE3600 data is mapped into the MODBUS database by using the following default formula,
where Z (=0-31) is the table number, X (=0-7) is the column number, and Y (=0-249) is the
row number:
MODBUS register/bit address = offset + Z*2048 +X*256+Y.
The offset may vary according for different SCADA software. See Offset Note below.
25
MODBUS
By default, the table number (Z) may vary from 0 to 31. If a higher numbered user table must
be accessed, then do the following:
1) In the ACE3600 STS site configuration, modify the Advanced Physical Register map
parameter for the PLC port configuration to the table=64 column=8 row=128 value.
2) Use the following formula where the user table number (Z) may vary from 0-63,
X (=0-7) is the column number, and Y (=0-127) is the row number.
MODBUS register /bit address = offset + Z*1024 +X*128+Y.
Again, the offset may vary for different SCADA software. See Offset Note below.
Offset Note: There are some SCADA systems for which addressing does not depend on the
data type; there is no specific absolute range reference per data type. For such a SCADA, the
offset in the equation should be set to 0. For other SCADA software, the offset = 00001,
10001, 30001, and 40001 for logic coil, input status, input register, and holding register data
type respectively.
In addition, a PLC Translation file add-on to the STS enables access to all data available in
ACE3600 database user tables. For information on preparing such a file, see PLC Translation
File below.
MODBUS
1. The MODBUS to ACE3600 database mapping is limited by the range of tables that can be
accessed, because only the first 32 (0<=Z<=31) or 64 (0<=Z<=63) tables can be mapped.
See RTU as PLC (Slave) Mapping of SCADA Element to ACE3600 Database above.
2. The MODBUS register/bit number has a unique mapping to the ACE3600 (z, x, y) element
and therefore it cannot be mapped to four different elements on the ACE3600 (representing
different RTUs in different tables) with the same register/bit number on the SCADA, as
described above. If four elements on the SCADA are defined with the same register/bit
number, they will all be mapped to the same (z, x, y) element on the ACE3600.
The solution is to introduce an additional mapping on the top of the register mapping scheme
described above using a PLC Translation File.
The PLC Translation File uses the .ini format and includes three sections (one per PLC port)
and instructions. It is a text file and can be edited by any text file editor. The file can be built
from the example template, Modbus_Example.plc, which is located in the "config" directory
under the STS installation path (e.g. C:\STS1150\Config.) Once the file is configured and
downloaded to the ACE36000, the additional mapping will become active.
The example PLC Translation File looks as follows, and defines a mapping for the port defined
as PLC2:
[MODBUS_CONNECTED_TO_MASTER_COMPUTER_PORT_NAME_PLC1]
[MODBUS_CONNECTED_TO_MASTER_COMPUTER_PORT_NAME_PLC2]
STATION_TABLE(Z)_OFST_BY_ADDR_1 =0
STATION_TABLE(Z)_OFST_BY_ADDR_2 =32
STATION_TABLE(Z)_OFST_BY_ADDR_3 =64
STATION_TABLE(Z)_OFST_BY_ADDR_4 =96
TABLE(Z)_OFST_BY_FUNCTION_CODE_1 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_2 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_3 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_4 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_5 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_6 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_15=0
TABLE(Z)_OFST_BY_FUNCTION_CODE_16=0
[MODBUS_CONNECTED_TO_MASTER_COMPUTER_PORT_NAME_PLC3]
The MODBUS_CONNECTED_TO_MASTER_COMPUTER_PORT_NAME_PLC1] section
represents instructions which are relevant for access via PLC port PLC1. In this example, no
instructions are defined in this section.
The MODBUS_CONNECTED_TO_MASTER_COMPUTER_PORT_NAME_PLC2] section
represents instructions which are relevant for access via PLC port PLC2. Four offsets are
defined based on the PLC address, and eight offsets are defined based on MODBUS function
codes.
27
MODBUS
STATION_TABLE(Z)_OFST_BY_ADDR_1
STATION_TABLE(Z)_OFST_BY_ADDR_2
STATION_TABLE(Z)_OFST_BY_ADDR_3
STATION_TABLE(Z)_OFST_BY_ADDR_4
=0
=32
=64
=96
The four keywords above define additional offsets, each of which depends on the PLC address.
The offsets 0, 32, 64, 96 correspond to PLC addresses 1, 2, 3, 4.
Each time a MODBUS packet is received via the port named PLC2, the MODBUS driver first
calculates the (z, x, y) coordinates of the element being accessed (using the register mapping
scheme for the MODBUS register /bit address formula above.) Based on the destination PLC
address (1, 2, 3, 4), the coordinates of the element are then changed to (z+offset,x,y). The table
number is shifted forward by the offset (namely 0 when accessing PLC address 1, 32 when
accessing PLC address 2, 64 when accessing PLC address 3, and 96 when accessing PLC
address 4). In other words, the tables for PLC address 1 start from Z=0, the tables for PLC
address 2 start from Z=32, the tables for PLC address 3 start from Z=64, and the tables for PLC
address 4 start from Z=96.
This increases the range of tables that can be accessed.
Notes: 1. PLC addresses 1, 2, 3, 4 should all be configured in PLC Table as legal PLC
addresses, otherwise the ACE3600 will not respond to accesses to PLC addresses 1, 2, 3, 4. See
the PLC Table description.
2: Any of the optional STATION_TABLE (Z)_OFST_BY_ADDR_* keywords is
legal (0 < * < 255 and represents a legal MODBUS PLC address.)
PLC
PLC
addr
Addr
Table
Table
Offset
Offset
10 1
0 0
20 2
3232
30 3
6464
40 4
9696
Z=31
Z=1
Z=0
Z=63
Z=33
Z=32
Z=65
Z=95
Z=64
Z=127
Z=97
Z=96
TABLE(Z)_OFST_BY_FUNCTION_CODE_1 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_2 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_3 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_4 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_5 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_6 =0
TABLE(Z)_OFST_BY_FUNCTION_CODE_15=0
TABLE(Z)_OFST_BY_FUNCTION_CODE_16=0
28
MODBUS
The above keywords define an additional offset based on the MODBUS function code on the
PLC2 port. In the example file, all offsets are zero, so the final table number (Z) is not
impacted by the keywords. If, however, the TABLE(Z)_OFST_BY_FUNCTION_CODE_1
keyword was set to 5, any access done with MODBUS function code 1 via port PLC2 would
increase the table number (Z) or shift Z forward by five tables.
Notes: 1. Any of the optional TABLE(Z)_OFST_BY_FUNCTION_CODE_* keywords is
legal (*= one of MODBUS function codes 1, 2, 3, 4, 5, 6, 15, 16.)
2: If both types of keywords TABLE(Z)_OFST_BY_FUNCTION_CODE_* and
STATION_TABLE(Z)_OFST_BY_ADDR_* are defined the table number is advanced
(shifted) forward by the sum of the two offsets.
The [MODBUS_CONNECTED_TO_MASTER_COMPUTER_PORT_NAME_PLC3] section
represents instructions which are relevant for an access done via PLC port PLC3. In this
example, no instructions are defined in this section.
PLC Diagnostics
The PLC Translation File which is downloaded to the ACE3600 can be viewed using the STS
SW Diagnostics utility (DEVICE= PLC1L for port name PLC1, PLC2L for port name PLC2,
PLC3L for port name PLC3, LEVEL=0.) See the example below. For more on the SW
Diagnostics utility, see the ACE3600 STS User Guide. For a description of the diagnostics, see
the TOSCADA (PLC1L, PLC2L, PLC3L) section of the ACE3600 Software Diagnostic
Output and Error Messages Manual.
29
MODBUS
Local
DEVICE: PLC2L
PLC2
Master Computer
67b44a0H
11137
688a0f4H
20000
0
7000
30000
0
1000
4
1
0
MODBUS DRIVER CONNECTED TO MASTER COMPUTER
MODBUS SOFTWARE MODULE CONNECTED TO MASTER
LEVEL: 0
TABLE(Z)_OFST
32
64
96
30
MODBUS
Sent when
4 (Device FAIL)
1 (Illegal function)
6 (BUSY)
2 (Illegal Address)
31
PLC/5
RTU
PLC/5
RTU
MDLC NETWORK
Allen Bradley
Data Highway/
Data Highway Plus
PLC/5
RTU
AS PLC
MASTER
PLC/5
RTU
1770-KF2
Interface
Module
In this case, the connection of the RTU to one of the PLC-5 controllers (e.g. the PLC-5/15),
must be via the 1770-KF2 RS-232 Interface module.
Note: To simplify the explanations in this chapter, the PLC-5 controller is illustrated, as if it is
directly connected to the RTU. Keep in mind that any PLC-5 controller on Data Highway/Data
Highway Plus is connected to RTU via the 1770-KF2 Interface module.
The PLC5 protocol support is the solution for polling/modifying the database of existing
PLC(s). In this case, the RTU is defined as a master and the accessed PLC as a slave. The
RTU provides the ability to access the database of a PLC from the application ladder.
Three drivers are supplied for PLC-5 protocol support. They are:
32
AB.2S_PLC1
AB.2S_PLC2
AB.2S_PLC3
RTU
RTU
MDLC NETWORK
RTU
AS PLC
MASTER
Allen Bradley
PLC1
PLC
AllenBradley PORT
TO SLAVE
PLC#=1
PLC Table
RTU
Ind
PLC
Address
Connected to
RTU (Name)
LOCAL
PLC1
d) Set the station address of PLC5 (it must be in the range of 1 to 254).
Note: These parameters may be set either on-line or off-line.
After setting the channel port, you may connect it to the RTU master PLC port.
If you are using the 1770-KF2 Interface module or another interface module, set the following:
a) Communication=Half-duplex.
b) Set the Error Detect parameter to CRC.
c) Set the data speed, stop bits, and parity parameters similar to the RTU master parameters.
SW-1
SW-2
SW-3
SW-4
SW-5
SW-6
SW-7
OFF ON ON ON OFF ON ON OFF OFF ON ON OFF OFF OFF OFF ON ON OFF ON ON ON ON OFF
1
Function
SW-8
RS-232
SW-1
SW-5
SW-6
9600 bps
SW-7
DH+
34
RTU
PLC-5/40
TXD
RXD
GND
PORT 2
7
RTS
CTS
DSR
DCD
DTR
20
1770-KF2
TXD
RXD
CTS
GND
DCD
20
RTS
12V
DTR
RXD
TXD
RTS
GND
DTR
CTS
DSR
DCD
35
. . . .
1st word
accessed
PLC_DI, PLC_DO,
column
index
0
1
2
3
4
:
:
:
15
15
. . . .
2nd word
accessed
16
17
18
:
:
31
RTU
PLC RI, PLC RO, PLC VI, PLC VO
Data Type Column
0
element 0
1
element 1
.
.
.
.
.
.
element n
36
PLC-5 File
Timer Element
15
14
13
EN
TT
DN
00
not used
preset value
accumulated value
PLC-5 File
Counter Element
15
14
13
CU
CD
DN
12
11
OV
UN
00
0
preset value
accumulated value
RTU
PLC_VI, PLC_VO
Data Type Column
PLC-5 File
Counter Element
15
00
status
length
position
If you want to read n elements from a counter/control/timer file, you must define a column of
PLC_VI type with 3n word elements (last index=3n1).
If you want to write to n successive counters/controls/timers in a file, then you must define a
column of PLC_VO type with 3n word elements (last index=3n1).
Command
Function
01
00
37
The file types below can be accessed by the ACE3600 implementation for the above commands:
Integer file
Bit file
The above commands allow accessing most PLC-5 file types. The uniqueness of the above commands is
that it can access any file by referring it as a word (integer) file.
PLC_VI PLC Value Input. This data type is used to read word elements from a third
party RTU. Each element in a PLC_VI column is a 2-byte signed integer (value). The
column length must be defined as the number of the words that are to be read. The
elements that can be read from PLC5 are: counters, controls, timers, integers, etc. In the
case of counters, controls, and timers, three successive words are read per one element (in
PLC5 each counter, control, and timer, consists of three words).
PLC_VO PLC Value Output. This data type is used to write into any word element of
Allen Bradley PLC5 controller. The elements are: counters, controls, timers, integers, etc.
In the case of counters, controls, and timers, three successive words are written to an
element (in PLC5 each counter, control, and timer, consists of three words).
PLC_DI PLC Discrete Input. This data type is used to read 1-bit elements from a third
party RTU, such as bits. The number of bits in a column must be defined as a multiple of
16.
PLC_DO PLC Discrete Output. This data type is used to write 1-bit elements into a third
party RTU, such as bits. The number of bits in a column must be defined as a multiple of
16.
PLC_RI PLC Real Input. This data type is used to read real (floating point) elements
from a third party RTU. Each element in PLC_RI is a 4-byte real (floating point) number.
PLC_RO PLC Real Output. This data type is used to write real (floating point) elements
to a third party RTU. Each element in PLC_RO is a 4-byte real (floating point) number.
PLC Table
The PLC Table, one of the System Tables, is used to define the connectivity to the third party
PLC units in the system. This table must be defined for any RTU which serves as a PLC master
for a PLC connected to one of its ports or connected to one of the other RTUs in the network.
38
PLC Address the address of the PLC RTUs (1254). Address 0 is the default address for
the Master. Refer to PLC Address for Allen Bradley Protocol to change the RTUs default
PLC address.
Connected to RTU (name) the name of the RTU to which the PLC is connected. Click the
arrow to open the list. If the RTU is locally connected to one of the ports of the unit where
the PLC Table is to be defined, choose LOCAL from the choice list.
via Port (name) the name of the port for connection. Click the arrow to open the list.
Choose the same name that was used when the port was defined.
If the PLC is connected directly via a UART port to the Master, then define the Connected to
RTU field as LOCAL and the via Port field as PLC 1, 2 or 3.
If the PLC is connected to an RTU which acts as a router, then define the Connected to RTU
field as the RTU router Site Name. Assign the name that was used in the Site table.
Port Configuration
Any of the serial/plug-in (PI1, SI1, SI2, PI2) CPU ports may be defined as a Third Party
Protocol PLC port.
Port Advanced Configuration ->DTR/CTS Support this field defines the DTR/CTS
Support. Select this option only if DTR/CTS support is provided by the computer
connected to the ACE3600 RTU.
Connected to Slave.
Data Speed This field defines the communication data speed of the selected Connection
Type. The default is 9600 bps.
(Advanced Configuration->)Format This field defines the UART's character format for
the communication port. The default is 8 bit, no parity, 1 stop bit. Click the arrow to open a
list that includes all combinations of 7/8 bits, even/odd/no parity, and 1/2 stop bits.
40
Step-by-Step Definitions
Local RTU as PLC Master
Site Configuration
1. Define one of the ports as RS232, Async, Third party protocols, (Connected to) Slave.
2. Define the Link Name: PLC 1, PLC 2, or PLC 3.
3. Select the appropriate Data Speed.
4. Click on the Advanced Configuration button, and select (if supported by the Slave) the
DTR/CTS Support parameter to Yes.
5. In the Advanced Properties, set the Format parameter to the appropriate format. (The
default is 8 bit, no parity, 1 stop bit.)
6. Save the Advanced Configuration and the port configuration in the site.
Third Party Protocol Downloading
1. In the ACE3600 STS Downloader utility, make sure that the ACE3600 STS is connected to
the proper site ID/link ID.
2. Select the site configuration to be downloaded to the RTU.
3. Download the appropriate protocol file as described in above.
4. Download the selected files to the RTU.
Application Programmer System Tables
1. In the Application Programmer Database tab, open the PLC Table under System Tables
and set the values as follows:
PLC address:
LOCAL
PLC1
Static I/O Link each column is bound to the slave database with the formal I/O Link
(as for I/O)
Dynamic I/O Link each column is bound to the slave database by the ladder at
runtime, by programming the PLC Dynamic IOLINK system table before the SCAN
operation.
The ACE3600 RTU selects the method according the value of PlcElmNum in the PLC
Dynamic IOLINK system table. During the SCAN of the PLC column type, the ACE3600
RTU examines the value of PlcElmNum. If it is equal to 0, static I/O is selected. If it is not
equal to zero, the I/O Link parameters are expected to be programmed in the PLC Dynamic
IOLINK system table.
If PlcElmNum == 0, use Static I/O Link.
If PlcElmNum <> 0, use Dynamic I/O Link.
integer
control
counter
timer
c) PLCRel Use this data type when the destination file is a floating point file.
3) Coord1 the file number to access.
4) Coord1 Length should be set to 2. The length of Coord1 is 2 bytes.
42
5) PLC Coord2 the word element number (starting from word 0) in the PLC-5 file which
corresponds to the ACE3600 PLC data type column start.
For integer files, PLC Coord2 = integer element number in file.
For floating point files, PLC Coord2 = (floating point element number in file)*2.
For bit files, PLC Coord2 = (bit element number in file)/16.
For counter, timer and control files, PLC Coord2 = (element number in file)*3.
6) Coord2 Length should be set to 2. The length of Coord2 is 2 bytes.
7) Coord3 the address (station number) of the Allen Bradley module that is directly
connected to the RTU. If a 1770-KF2 or other Interface module is connected to the RTU,
then PLC Coord3 should be the address of the interface module. If no interface module is
used (the PLC-5 is directly connected to the RTU), then PLC Coord3 should be the address
of the PLC-5 controller.
8) Coord3 Length should be set to 1. The length of Coord3 is 1 byte.
Note: Do not change the last lines for coordinates. It is reserved for protocols with more than
one coordinate.
PlcElmNum should be set to zero if Static I/O Link is used, otherwise it is generally set
to the number of elements (rows in column) in the corresponding PLC_DI, PLC_DO,
PLC_VI, PLC_VO, PLC_RI, PLC_RO data type column being accessed by the SCAN
operation. Note: PlcElmNum should be less than or equal to the number of elements (rows
in column) in the corresponding column accessed by SCAN.
PLcDstAddr PLC Address the address of the destination Allen Bradley PLC5. The
address range is 1254. Address 0 is the master address. Refer to PLC Address for Allen
Bradley Protocol to change the default PLC address of the master.
43
PlcCoord2- word element number (starting from word 0) in the PLC-5 file which
corresponds to the ACE3600 PLC data type column.start
For integer files, PlcCoord2 = integer element number in file.
For floating point files, PlcCoord2 = (floating point element number in file)*2.
For bit files, PlcCoord2 = (bit element number in file)/16.
For counter, timer and control files, PlcCoord2 = (element number in file)*3.
PlcCoord3- the address (station number) of the Allen Bradley module that is directly
connected to the RTU. If a 1770-KF2 or other Interface module is connected to the RTU,
then PLC Coord3 should be the address of the interface module. If no interface module is
used (the PLC-5 is directly connected to the RTU), then PLC Coord3 should be the address
of the PLC-5 controller.
Other fields of the PLC Dynamic IOLINK table are irrelevant for the Allen Bradley PLC-5
protocol and should be ignored.
column
( SCAN )
=
PLCBsy
PLCStt is an integer status system variable. The purpose of this variable is to give an indication
on the communication with PLCs. The values for this variable are defined in the PLC Status
Defines table (one of the Constants Tables).
44
45
SLC.2S_PLC2
SLC.2S_PLC3
Coord2 element number (starting from 0) in the PLC500 file which corresponds to
the ACE3600 PLC data type column start.
For integer files, PLC Coord2 = integer element number in file.
For floating point files, PLC Coord2 = floating point element number in file.
For bit files, PLC Coord2 = bit element number in file.
46
PlcCoord2 - element number (starting from word 0) in the PLC500 file which
corresponds to the ACE3600 PLC data type column start
For integer files, PlcCoord2 = integer element number in file.
For floating point files, PlcCoord2 = floating point element number in file.
For bit files, PlcCoord2 = bit element number in file.
Command
Function
A2
AA
The file types below can be accessed by the ACE3600 implementation for the above commands:
Integer file
Bit file
Access to other SLC 5000 data types (counters, timers) is not supported by the ACE3600 RTU. If this
is required, the SLC 500 application engineer should copy the unsupported data type to an integer file
(which can be accessed by ACE).
47