Professional Documents
Culture Documents
278623 Rev. A
Refer to this publication for complete and accurate information that helps you better operate and service Metso Automation equipment. Your comments and suggestions are welcome. Metso Automation, Inc. 1180 Church Road Lansdale, PA 19446 Attention: Manager, Technical Publications
Copyright 2004 by Metso Automation MAX Controls Inc. Printed in the United States of America All rights reserved
Contents
CHAPTER 1 ...................................................................................................................... 1-1
Introduction .................................................................................................................................................................1-1 Overview ...................................................................................................................................................................1-1 Main Frame Module ..........................................................................................................................................1-1 Core Libraries ....................................................................................................................................................1-1 Helper Librarians...............................................................................................................................................1-2 Transport Libraries ............................................................................................................................................1-3 Startup of maxLINKS............................................................................................................................................1-3 Accessing the maxLINKS Window...................................................................................................................1-3
iv
msvComTransport DLL Service Selectors and Properties..................................................................................... B-1 Overview .................................................................................................................................................................. B-1
APPENDIX C ....................................................................................................................C-1
MsvDPUComTransport DLL Service Selectors and Properties ............................................................................C-1
APPENDIX D ....................................................................................................................D-1
msvModbusPlus Transport DLL Service Selectors and Properties.......................................................................D-1 Overview ..................................................................................................................................................................D-1
APPENDIX G ....................................................................................................................G-1
Allen-Bradley Helper DLL Service Selectors and Properties.................................................................................G-1 Overview ..................................................................................................................................................................G-1 PLC2/1774_PLC addressing. ...............................................................................................................................G-2 PLC_3 Addressing................................................................................................................................................G-2 PLC_5 Addressing................................................................................................................................................G-4
APPENDIX H ....................................................................................................................H-1
ModbusHelper32 DLL Service Selector and Properties .........................................................................................H-1 Overview ..................................................................................................................................................................H-1
vi
Chapter 1
Introduction
Overview
maxLINKs is the module of the maxSTATION software that interfaces the maxDNA system to external devices that are not produced by Metso Automation MAX Controls. This represents a wide and heterogeneous class of equipment ranging from machinery control subsystems often implemented with PLCs like sootblowers or burner management systems, to some specific devices like turbine controls or chemical analysis instrumentation needed in water treatment. From the hardware perspective, maxLINKS is a workstation running Windows NT/2000; this ensures that a large number of hardware/software solutions can be found on the market to satisfy the need to interface to a specific environment. It is possible that the maxLINKS workstation will be mounted inside a cabinet, near the DPUs, and in that case, a rugged industrial computer may be needed to host the program. maxLINKS is a multifaceted interface, which can be used to integrate many external devices into the maxDNA system interacting with the control and/or the supervision areas. To support this, maxLINKS is modular in design, built around a set of components that can be connected together to build different configurations. Basically, maxLINKS is comprised of the following modules: The main frame. The maxLINKS core libraries. The maxLINKS helper libraries. The maxLINKS transport libraries.
Core Libraries
The core libraries, which have their own specific tasks, are always loaded regardless of the maxLINKS configuration in use. The only currently implemented core library is Immediate Data acquisition. Core libraries can be added at a later date as needed. For example, if direct support of events and alarms is required in maxLINKS because
Metso Automation Inc. 278623
Helper Librarians
Even though maxLINKS can be configured for many different kinds of environments, maxLINKS stability is maintained by keeping to a minimum the number of embedded functions in the main maxLINKS module. Different environments have different configuration needs, different ways of addressing data and different performances and loads on the system hosting maxLINKS. The invariant part of maxLINKS is mainly an interface between the Software Backplane and one or more dynamic link libraries called helper libraries. Helper libraries take care of the specific needs of an environment and interface it to the maxLINKS module through the helper interface that remains stable (it is presumed) for each environment that a specific helper DLL interfaces.
1-2
Introduction
Transport Libraries
Helper libraries may or may not contain the code for the communication over a media. They can use other libraries to send and receive data (we will call them transport libraries beyond this point) which expose a transport interface used by the helper libraries to ask for message delivery. The transport libraries also implement the helper interface to allow access through the same mechanisms used for field variables, to information inside the libraries containing statuses and/or statistics about the communication media. From this point the word maxLINKS refers to the invariant part of the software, while the sum of maxLINKS and one or more helper and transport libraries is referred to as a configuration. The functions of maxLINKS are essentially targeted to the following areas: Configuration of services and members. Configuration of the underlying layers (helper and transport DLLs). Response to the Software Backplane for Read/Write/Subscribe on the configured points.
Startup of maxLINKS
To start maxLINKS manually locate the file maxLINKS.exe in c:\Mcs\Links\ and double click on it. To start maxLINKS automatically at MAXSTATION startup, add the following line to the bottom of the c:\custom\sbp\start.ini file. 0, c:\mcs\Links\maxLINKS.exe, maxLINKS
Once maxLINKS is started, it will automatically place the following icon on the Tray Area.
1-3
The window contains the following information: Component: This displays the name of one of the maxLINKS modules that has been loaded. This indicates the status of this particular maxLINKS module, such as loaded.
Status:
1-4
Chapter 2
Using the Mini Configurator
Getting Started
Creating Text File to Define Templates and Points
To define points used in maxLINKS, create a text file in Notepad. The formatted text file may be edited and downloaded to maxLINKS using Mini Configurator. Refer to this chapter for a description of the Mini Configurator and how to use it to edit and download a point configuration. Refer to the following chapters for a description of the format and commands that compose a configuration file. The following figure shows a finished configuration file incorporating commands for creating points.
Note: In order to allow MiniConf to execute without user intervention, it is necessary to specify the full pathname of the configuration file that is to be downloaded.
2-2
When you open the utility, by default it searches for configuration files in the c:\Mcs\Sbp directory, but you can specify a different directory and place your configuration files where you choose. The Configurator dialog lists the name of the configuration file in the Configuration File field. Click the Browse button to the right of the field to locate other configuration files. Click the Edit buttons to edit a configuration file in notepad. See the following figure: Click Download to download the configuration in the currently selected Configuration File for immediate use by maxLINKS. You may view the statistics as the configuration is being downloaded. Click the Stop button to cease the downloading of the currently selected Configuration File. Click the Resume button to once again start the download of the currently selected Configuration File that was previously paused or stopped. Click the Pause button to stop the download of the currently selected Configuration File currently in progress. It will remain paused, or stopped, until you restart it using the Resume button.
The main portion of the MiniConf window lists the services (configured points) along with the following current statistics. Status: The SBP status associated with each command line. The Software backplane, used to configure these points, registers them as services and members. This consists as the first portion of the entered command from the Configuration file. The type of data which was passed as a parameter on this particular command. This is of type: PCHAR, FLOAT, or LONG. The data portion of the command which was passed, such as which type of storage to use, which compression to use, the min or max time, or the delta.
Configuration Errors: (located near the upper right corner). This indicates the total number of software backplane (sbp) errors that were encountered during the download of the Configuration.
2-4
Chapter 3
Creating a Configuration File
Overview
The Configuration file is the means by which you will configure points for use in maxLINKS. The file is a text file of the format shown below. This file is used as input into the Mini Configurator, which will download this information to maxLINKS. Refer to this chapter for a discussion of the format and commands necessary for maxLINKS configuration.
General Format
Each line in the configuration file represents a write instruction in the general form: <service name> <type> <value>
<type> VAR_BYTE, VAR_SHORT, VAR_LONG, VAR_FLOAT, VAR_DOUBLE, VAR_UBYTE, VAR_USHORT, VAR_TIME, VAR_PCHAR <value>
Other Keywords:
# A #char as the first character in a line marks that line as a comment (# this is a comment line). The word PAUSE instead of a service name stops the configuration download at that point; the configuration can be resumed using the RESUME button. The word DELAY, instead of a service name, followed by a decimal number, stops the configuration download at that point for the specified amount of seconds (DELAY 15 halts the configuration download for 15 seconds). The word REWIND, instead of a service name, restarts the configuration download from the beginning.
PAUSE
DELAY
REWIND
Here is an example:
Metso Automation Inc. 278623
3-2
Base Configuration
Base configurations sets up some basic user types and is required. The user types will be assigned to services created later.
_MSV_IMMDATA.ADD_USER_TYPE _MSV_IMMDATA.COMPORT.TYPE _MSV_IMMDATA.COMPORT.SIZE _MSV_IMMDATA.COMPORT.COMMIT _MSV_IMMDATA.COMPORT.ADD_MEMBER _MSV_IMMDATA.COMPORT.STS.OFFSET _MSV_IMMDATA.COMPORT.STS.COMMIT _MSV_IMMDATA.COMPORT.ADD_MEMBER _MSV_IMMDATA.COMPORT.TX.OFFSET _MSV_IMMDATA.COMPORT.TX.COMMIT _MSV_IMMDATA.COMPORT.ADD_MEMBER _MSV_IMMDATA.COMPORT.RX.OFFSET _MSV_IMMDATA.COMPORT.RX.COMMIT _MSV_IMMDATA.COMPORT.ADD_MEMBER _MSV_IMMDATA.COMPORT.BAD.OFFSET _MSV_IMMDATA.COMPORT.BAD.COMMIT _MSV_IMMDATA.COMPORT.ADD_MEMBER _MSV_IMMDATA.COMPORT.SPY_ID.OFFSET _MSV_IMMDATA.COMPORT.SPY_ID.COMMIT PCHAR PCHAR ULONG PCHAR PCHAR ULONG ULONG PCHAR ULONG ULONG PCHAR ULONG ULONG PCHAR ULONG ULONG PCHAR ULONG ULONG COMPORT BYTE 6 COMPORT STS 0 0 TX 1 0 RX 2 0 BAD 3 0 SPY_ID 4 0
_MSV_IMMDATA.COMPORT.ADD_MEMBER PCHAR SPY_BUFFER_SIZE _MSV_IMMDATA.COMPORT.SPY_BUFFER_SIZE.OFFSET ULONG 5 _MSV_IMMDATA.COMPORT.SPY_BUFFER_SIZE.COMMIT ULONG 0 _MSV_IMMDATA.ADD_USER_TYPE _MSV_IMMDATA.REG16.SIZE _MSV_IMMDATA.REG16.TYPE _MSV_IMMDATA.REG16.COMMIT _MSV_IMMDATA.REG16.ADD_MEMBER _MSV_IMMDATA.REG16.OUT.OFFSET _MSV_IMMDATA.REG16.OUT.COMMIT _MSV_IMMDATA.ADD_USER_TYPE _MSV_IMMDATA.SIGN16.SIZE _MSV_IMMDATA.SIGN16.TYPE _MSV_IMMDATA.SIGN16.COMMIT _MSV_IMMDATA.SIGN16.ADD_MEMBER _MSV_IMMDATA.SIGN16.OUT.OFFSET _MSV_IMMDATA.SIGN16.OUT.COMMIT PCHAR ULONG PCHAR PCHAR PCHAR ULONG ULONG PCHAR ULONG PCHAR PCHAR PCHAR ULONG ULONG REG16 1 USHORT_Q REG16 OUT 0 0 SIGN16 1 FLOAT_Q SIGN16 OUT 0 0
3-3
Station Configuration
The station configuration is mandatory if there are redundant devices. To configure stations write to the following members of _MSV_IMMDATA: NET_A NET_B PORT MAXnet Network A MAXnet Network B IP Port for Primary<>Secondary communication (Default 8000). Station number of this box. Station number of the other box.
LOCAL_STATION REMOTE_STATION
Link Configuration
To configure the link, create a service representing the link to use as a destination for additional configurations.
_MSV_IMMDATA.ADD_SERVICE PCHAR ComStatus
If the PLC is on a serial line, associate the service with the appropriate transport:
_MSV_IMMDATA.ComStatus.HELPER PCHAR MsvComTransport
3-4
_MSV_IMMDATA.ComStatus.PARITY.SET_PROPERTY _MSV_IMMDATA.ComStatus.STOP_BITS.SET_PROPERTY
From this point the hardware and a service (ComStatus) are configured reflecting the status of the communication line. The kind of information available on ComStatus and the available properties depends on the nature of the transport library used. Refer to the Appendices for the particular information for each library.
Device Configuration
Devices are an important concept in maxLINKS configuration since there is a one to one correspondence between device designators and software backplane connections. A device represents a physical apparatus offering one or more service and members. Communications failure will make the quality of the relevant software backplane connection go bad, resulting in the software backplane looking for another route to reach the data (if any). A device is not a communication line; more than one device can be accessed through a single communication line, and a failure of one device does not affect other devices that may be using the same communication line. Alarms on communication lines are handled through services offered by the transport libraries while alarms on the devices are handled through the services offered by the helper libraries. The following line initializes the device for the previous example:
_MSV_IMMDATA.ADD_DEVICE PCHAR PLC
3-5
(commits the device) The device recognizes and supports four redundancy modes: SINGLE PRIMARY Device has NO redundancy. Device is the primary data source for data.
SECONDARY Device is the secondary data source for data. DUAL Device is one of the redundant sources for data.
The main difference between DUAL and PRIMARY/SECONDARY is that device scanning is synchronized for PRIMARY/SECONDARY while it is done in parallel in a DUAL configuration.
(commits the service) There are two forms of the commit command: Writing a name (REGISTER_100) causes it to be used as the UNIQUE identifier for the service. Writing ULONG 0 causes the service to be available through the full name (/PLC/REGISTER_100), but only if the FULLNAME flag was previously raised. NOTE: In the previous example the name REGISTER_100 can be used again as a service in another device but NOT again in a commit command since these identifiers are checked to be unique.
_MSV_IMMDATA.PLC.ADD_SERVICE PCHAR REGISTER_102
3-6
(commit the service) If the full name is enabled, after the commitment the services will be registered in Registration and Routing (RRS) as: /PLC/REGISTER_100 /PLC/REGISTER_102 /PLC/REGISTER_105 /PLC/COIL_200
3-7
(Enable full name registration) The default is full name registration disabled. In the commit command instead of ULONG 0 a string can be written, and in that case this will be used as a unique identifier for the service.
_MSV_IMMDATA.PLC.ADD_SERVICE PCHAR COIL_230
1:01:230
(commits the service) If full name registration is enabled this service will be registered as/PLC/COIL_230 and as A4SG039.
Global or Local
If registrations are intended to be global (that is, known to all maxSTATIONs) then the EXPORT member of _MSV_IMMDATA must be set to 1.
_MSV_IMMDATA.EXPORT ULONG 0
(the services declared after this command are local to this maxSTATION; this is the default)
_MSV_IMMDATA.EXPORT ULONG 1
(the services declared after this command are exported to all other maxSTATIONs)
3-8
Then two members are mapped to the service at the desired offset.
_MSV_IMMDATA.PLC.VALVE.ADD_MEMBER _MSV_IMMDATA.PLC.VALVE.OPENED.OFFSET _MSV_IMMDATA.PLC.VALVE.OPENED.COMMIT _MSV_IMMDATA.PLC.VALVE.ADD_MEMBER _MSV_IMMDATA.PLC.VALVE.CLOSED.OFFSET _MSV_IMMDATA.PLC.VALVE.CLOSED.COMMIT PCHAR ULONG ULONG PCHAR ULONG ULONG OPENED 0 0 CLOSED 1 0
Members are never registered. If full name registration is enabled, members can be accessed as:
/PLC/VALVE.OPENED /PLC/VALVE.CLOSED A4SG465. OPENED A4SG465. OPENED (full name form)
-or-
(unique id form)
Otherwise just the last form is available. Members can also specify a completely new and different set of attributes such as:
_MSV_IMMDATA.PLC.VALVE.ADD_MEMBER _MSV_IMMDATA.PLC.VALVE. DESCRIPT.TYPE _MSV_IMMDATA.PLC.VALVE. DESCRIPT.SIZE _MSV_IMMDATA.PLC.VALVE. DESCRIPT.HELPER _MSV_IMMDATA.PLC.VALVE. DESCRIPT.ADDRESS _MSV_IMMDATA.PLC.VALVE. DESCRIPT.SELECTOR R,POINTS,A4SG465,TAG,DESCRIPTION _MSV_IMMDATA.PLC.VALVE. DESCRIPT.COMMIT PCHAR PCHAR ULONG PCHAR PCHAR PCHAR DESCRIPT PCHAR 0 ODBChelper ConfDataBase
ULONG 0
3-9
User Types
When services represent the same thing, and they have a few members, the configuration can be annoying. In that case a user type can be configured and then used in any place where a type is required. In the previous example of the valve a MYVALVE data type can be declared as follows: First, a container service is created with a size of two elements:
_MSV_IMMDATA.ADD_USERTYPE _MSV_IMMDATA. MY_VALVE_TYPE.TYPE _MSV_IMMDATA. MY_VALVE_TYPE.SIZE _MSV_IMMDATA. MY_VALVE_TYPE.COMMIT PCHAR PCHAR ULONG ULONG MY_VALVE_TYPE BYTE 2 0
Then two members are mapped on the type at the desired offset: _MSV_IMMDATA. MY_VALVE_TYPE.ADD_MEMBER _MSV_IMMDATA. MY_VALVE_TYPE.OPENED.OFFSET PCHAR ULONG OPENED 0 0 CLOSED 1 0
3-10
Before the deletion of a path component, a device or a service and all of its dependents must already be deleted. Otherwise, DELETE returns an error value. These members are also predefined in the objects created by the configuration with the following exceptions: ADD_HID - Is predefined only in path components and devices. ADD_DEVICE ADD_SERVICE ADD_MEMBER - Is predefined only in path components. - Is predefined only in path components and devices. - Is predefined only in members and services.
The configuration takes place in subsequent steps adding one path component, device, service or member at a time.
3-11
Attribute name
HELPER TRANSPORT ADDRESS ALT_ADDRESS SELECTOR
Write type
Null terminated string Null terminated string Null terminated string Unsigned long integer Null terminated string Unsigned long integer null terminated string
Description
The name of the helper library that must be used with that service/member. The name of the transport library that must be used with that service/member. The address that must be used with that service/member. An alternate address that can be used with that service/member. An implementation dependent string for selecting the appropriate data in the host environment. The value in microseconds for the required update time. 0xFFFFFFFE is a special value that means "Low Scan. The requested type for the data. The helper library tries to convert if possible the original type into the requested type. Only for members. Represents the element number assigned to the member in the parent memory. The service size in elements. Scaling zero for the point Scaling range for the point Instrument zero Instrument range Default delta if applicable.
SCAN_TIME
TYPE
OFFSET
Unsigned long integer Every numerical type Every numerical type Every numerical type Every numerical type Float
Attribute name
FAR_WRITE
Write type
ULONG
Description
Writing 1 to this member causes the response to the software backplane on writes to be delayed until an acknowledge is received from the remote device. Otherwise, the default behavior is that the response to the software backplane on writes is issued after the message is sent to the remote device. Writing 0 to this member causes background scan for the service/member to be enabled; This is the default scan policy. Writing 1 to this member causes the requested SCAN_TIME to always be honored in polling a variable. The min_time members in the software backplane subscribe requests will be ignored. Writing 2 to this member causes no background scan for the service/member. Scanning will be started after a subscription, and the first software backplane update is
SCHEDULING
ULONG
3-12
INIT_VALUE
FULLNAME
delayed until the remote device replies. Writing 3 to this member activates a special scan mode for exception and filtered writes, new messages will be sent to the remote device on certain conditions. A mnemonic can also be written to the SCHEDULING member as shown in Scheduling Policies chapter. An initial value for the service.
EXPORT
ULONG
SET_PROPERTY
COMMIT
Writing 1 enables the registering of the service full name. Writing 0 disables the registering of the service full name. This is the default. Writing 1 enables the export of the registered services. Writing 0 disables the export of the registered services. This is the default. Writing to this member causes the requested property in the helper library to be assigned. Writing 0 to this member causes the programmed service/member configuration to be committed to the helper library and causes the registration of the service in the RRS. Optionally a string can be passed; in that case, this is registered as the unique service name.
Attribute name
REDUNDANCY_MODE
Write type
PCHAR
Description
One of the following modes: - SINGLE - PRIMARY - SECONDARY - DUAL (Refer to the appropriate appendix for details). The MAXnet A IP address of the maxLINKS station. The MAXnet B IP address of the maxLINKS station. The IP port for Primary/Secondary communications (Default 8000). The station number of this box. The station number of the redundant box. Writing 1 to this member causes the primary box to try to regain control of the device. Writing 1 to this member causes the primary box to yield control of the device to the
3-13
REFERENCE
PCHAR
Scheduling Policies
Background Refresh - Default
Writing 0 to the SCHEDULING member sets the scheduling policy for that service/member to Background Refresh; this is the default. Writing the string BACKGROUND to the SCHEDULING member also sets the mode to Background Refresh. All the services/members in this state are scanned at a rate specified with the SCAN_TIME attribute. If 0xFFFFFFFF is written to SCAN_TIME then those services are scanned when the communication link (whatever it is) is idle. Background refresh offers a compromise between communication load and the speed of the first reply; but as the load of the foreground requests is high as the value sent in the first update is older, this can cause strange effects if this time becomes too high. Moreover, there is no guarantee that all the foreground messages can be scheduled in time. The following describes the behavior of the software backplane primitives in Background Refresh mode.
READ The data returned are the actual data in the internal buffer. The response message is forwarded upon the reception of the read request. WRITE The data are written to the internal buffer. The helper library is requested to schedule an urgent message a soon as possible. The response message is forwarded immediately or at the reception of the acknowledge from the remote device in accordance with the FAR_WRITE attribute. SUBSCRIBE The data returned in the first update message are the actual data in the internal buffer. If there is someone asking for a rate higher or equal to the one requested in the subscription, no further requests are made to the helper library; otherwise it will be requested to schedule a message at a rate equal to min_time.
Fixed Scheduling
3-14
READ The data returned are the actual data in the internal buffer. The response message is forwarded upon the reception of the read request.
WRITE The data are written to the internal buffer. The response message is forwarded immediately or at the reception of the acknowledge from the remote device in accordance with the FAR_WRITE attribute.
SUBSCRIBE The data are scanned every SCAN_TIME microseconds and it is sent to the client in accordance with min_time and max_time in the subscription request.
No Background Refresh
Writing 2 to the SCHEDULING member sets the scheduling policy for that service/member to No Background refresh. Writing the string NO_BACKGROUND to the SCHEDULING member also sets the mode to No Background Refresh. None of the services/members in this state are scanned until a request is made for that point. Any value written to SCAN_TIME is ignored. No background refresh scheduling has an average light communication load but the reply suffers a delay due to the initial communication setup that could be very high for devices connected with slow communication channels. Moreover, there is no guarantee that all the messages can be scheduled in time, as the number of requests increase.
3-15
Write Only Writing 3 to the SCHEDULING member sets the scheduling policy for that service/member to Write Only. Writing the string WRITE_ONLY to the SCHEDULING member also sets the mode to Write Only. None of the services/members in this state are updated on the remote PLC until a specific write request is issued for that point. This mode also works in conjunction with the DELTA member of the point. If the DELTA member is 0 then a new message is sent when the new value is different from the current value. If a value is assigned to DELTA then a message is sent when the difference between the new value and the current value is equal or exceeds DELTA. Also two other sub modes can be activated writing WRITE_ONLY.RISING or WRITE_ONLY.FALLING to the SCHEDULING member. In these modes a message is sent to the external device only when the transition is rising edge or falling edge. Any value written to SCAN_TIME is ignored. The following describes the behavior of the software backplane primitives in Write Only.
3-16
READ The last written value is reported to the sbp. No communications are initiated with the external device. The response message is forwarded immediately.
WRITE The data are written to the internal buffer. Accordingly with the chosen algorithm the helper library is eventually requested to schedule an urgent message a soon as possible. The response message is forwarded immediately or at the reception of the acknowledge from the remote device in accordance with the FAR_WRITE attribute.
3-17
Chapter 4
Configuration of the Underlying Layers (Helper and Transport DLLs)
Overview
Often the helper and the transport require some configuration data to be specified. Examples include the baud rate and word format information for a serial port. This is the purpose of the SET_PROPERTY member (Alias: SET). Each service can have properties and they can be assigned by writing to
Chapter 5
Alarm Services Configuration
Important Note
The maxLINKS alarm services were created before the existence of the virtual DPU. The alarm service DLL is still included in the release and can be used. However, it is highly recommended to use a virtual DPU to provide alarms. Virtual DPUs can run with backup and provide more alarm functionality. See document 278589 (Function Blocks Programmer's Reference and User's Guide) for analog and digital tagger descriptions.
OverView
maxLINKS Alarm Services are simple services that add alarm capability to the points. This is more useful in DBM-based systems, in order to avoid using DPU (non-virtual) resources for simple alarms. Configuration of alarms is done by writing to the members of the _MSV_ALARM_DATA service.
Alarm Example
Assume that in maxLINKS there is a digital point SB_XA_1_1053 and an analog point SB_TA_1_1053; here is an example of a configuration for alarms coming from these two points.
_MSV_ALARM_DATA.ADD_ALARM _MSV_ALARM_DATA.SB_XA_1_1053.BASE_MSG PCHAR PCHAR SB_XA_1_1053 BMS1
(flags
_MSV_ALARM_DATA.SB_XA_1_1053.SEVERITY
(alarm severity)
_MSV_ALARM_DATA.SB_XA_1_1053.TYPE_ALARM PCHAR PA
(alarm type)
_MSV_ALARM_DATA.SB_XA_1_1053.COMMIT ULONG 0
base
(the L limit)
_MSV_ALARM_DATA. SB_TA_1_1053.LIMIT_HH FLOAT 10.0
(the LL limit)
_MSV_ALARM_DATA. SB_TA_1_1053.DEAD_BAND FLOAT 2.0
(alarm severity)
_MSV_ALARM_DATA. SB_TA_1_1053.TYPE_ALARM PCHAR PA
(alarm type)
5-2
(flags
_MSV_ALARM_DATA. SB_TA_1_1053.COMMIT
Alarm Members
This is the complete list of the alarm members:
5-3
Attribute name
SCAN_TIME DELTA LIMIT_HH LIMIT_H LIMIT_L LIMIT_LL DEAD_BAND EDGE BASE_MSG RISE_MSG FALL_MSG SEVERITY ALM_FLAGS UNIT TYPE_ALARM ULONG
Write type
Every numerical type Every numerical type Every numerical type Every numerical type Every numerical type Every numerical type UBYTE PCHAR PCHAR PCHAR SHORT ULONG PCHAR PCHAR
Description
The sampling time of the point. Default: 1 second. Software Backplane delta. HH limit. H limit. L limit. LL limit. Alarm deadband == 1 Alarm on rising edge. == 0 Alarm on falling edge. Base message. Message on rising edge Message on falling edge Alarm severity 2=alarm 1=event 0=both Engineering unit Alarm type among: PA SY OA EA An SBP domain if required. == 1 Use fast subscribe. == 0 Use normal subscribe.
SET_DOMAIN FAST_SUBSCRIBE
PCHAR ULONG
The FAST_SUBSCRIBE flag controls the way data is sampled. The alarm library (MsvAlarmData.dll), just like any maxLINKS core library, can take advantage of an internal interface (Fast Path API) to access the immediate data values. This is faster than going to SBP when exchange of data is internal to the maxLINKS process (such as in this case). The use of the fast subscribe can be excluded by writing 0 to the FAST_SUBSCRIBE member in the case that SBP routing is required.
5-4
Chapter 6
Configuring Redundant maxLINKS
Overview
maxLINKS can be configured to be redundant. If the primary maxLINKS station fails than the secondary starts to collect data from the link and to supply these data to the clients.
Configurations
maxLINKS supports four different device configurations: MASTER SLAVE DUAL SINGLE
Each configured device in maxLINKS exposes eight predefined members to monitor the device status, and writeable members for manual operation.
Readable Members
The readable members are: STATUS This member displays the device status as a string. The possible values it can assume depend on the kind of device (MASTER / SLAVE). For a MASTER device: MASTER_DEVICE_CONFIGURATED MASTER_DEVICE_IDLE MASTER_DEVICE_STOP MASTER_DEVICE_DOUBTFUL MASTER_DEVICE_CHANGING MASTER_DEVICE_SCANNING =2 =3 =4 =5 =6 =7
6-2
Writeable Members
The writeable members are: START Writing a 1 to this member starts a previously stopped device. It only works if the device is in STOPPED state. For a MASTER device START has the same behavior as TAKEOVER. STOP Writing 1 to this member stops a device. It can restarted only writing to the START member. If a device is in STOPPED state it ignores all requests. TAKEOVER Writing 1 to this member of the MASTER device causes the SLAVE to stop the scanning and the MASTER to takeover from it. YIELD Writing 1 to this member of the MASTER device causes the MASTER to stop itself and put the SLAVE in the SCANNING state.
Configuration Examples
Activate Redundancy
To use the redundancy capability, the maxLINKS machine must know the network addresses of the other machine. Suppose two machines have the names MAXLINKA and MAXLINKB. MAXLINKA has two network cards with the following network configuration: NET A: IP 172.16.160.1 NETMASK 255.255.0.0 NET B: IP 172.17.160.1NETMASK 255.255.0.0 MAXLINKB has two network cards with the following network configuration: NET A: IP 172.16.160.5 NETMASK 255.255.0.0 NET B: IP 172.17.160.5NETMASK 255.255.0.0 Both maxLINKS instances must belong to the same network; thus, the configuration will be:
6-3
and MAXLINKB will have the following station configuration; note that the difference is that the station numbers are swapped.
_MSV_IMMDATA.LOCAL_STATION _MSV_IMMDATA.REMOTE_STATION PCHAR PCHAR 5 1
Each maxLINKS opens a UDP socket on a port 8000 (by default); this value can be changed with:
_MSV_IMMDATA.PORT ULONG 5400
Of course if you change the port number, you must configure the same port number on both maxLINKS. The redundancy parameters LOCAL_STATION, REMOTE_STATION, NET_A, NET_B, PORT are relative to the whole configuration and must be specified only one time in all of the configuration procedure of every maxLINKS instance as the very first entry.
Example:
_MSV_IMMDATA.ADD_DEVICE _MSV_IMMDATA.mhi-b.REDUNDANCY_MODE _MSV_IMMDATA.mhi-b.COMMIT PCHAR PCHAR PCHAR mhi-b MASTER mhi-b
To configure a DEVICE as SLAVE the redundancy must be active. Then the following line must be added to the device configuration file before committing the device:
_MSV_IMMDATA.<DEVICENAME>.REDUNDANCY_MODE PCHAR SLAVE
Example:
_MSV_IMMDATA.ADD_DEVICE PCHAR mhi-b
6-4
Example:
_MSV_IMMDATA.ADD_DEVICE _MSV_IMMDATA.mhi-b.REDUNDANCY_MODE _MSV_IMMDATA.mhi-b.COMMIT PCHAR PCHAR PCHAR mhi-b DUAL mhi-b
Redundancy operation
MASTER / SLAVE context
In a MASTER / SLAVE context only one of the devices works at a time. If both are present, the MASTER has the priority, and only if the master has a problem will the master let the slave start data collection. The slave will also start autonomously after a timeout on communication with the master. The device in the SCANNING state will accept subscriptions from the clients, and updates the other device with the current value coming from the link. The exchange of roles is controlled by the quality of data, the status of the other device, or the external commands YIELD and TAKEOVER. In each state of the device, the quality value of the connection, displayed by the Software Backplane Registration and Routing Service, assumes a specific meaning; in fact, quality value indicates the state of the device. The following section explains the relationship between state and quality value.
MASTER operation
Metso Automation Inc. 278623 6-5
When the master device is in the MASTER_DEVICE_SCANNING state, the services which depend on it become active, and it can accept subscriptions; the quality of connection reflects the value of the helper quality. The device remains in this state until one of the conditions listed below is true: The quality of the data is low. The MASTER lets the slave start data collection, and then puts itself into the MASTER_DEVICE_CHANGING state. The YIELD member of the MASTER device is written. The MASTER lets the slave start data collection, and then puts itself in the MASTER_DEVICE_CHANGING state.
When the device is in the MASTER_DEVICE_IDLE state, it is in a state of inactivity; it waits for some event to change its state and sets the connection quality to 55. After a status message timeout the MASTER goes in the MASTER_DEVICE_SCANNING state. If the slave is in SLAVE_DEVICE_IDLE status the master goes in the MASTER_DEVICE_SCANNING state.
When the device is in the MASTER_DEVICE_DOUBTFUL state, the master has encountered some problems scanning the link and it has let the slave start data collection; this happens because the quality of data is low, or it has been told to release the link with a YIELD command. In this state the quality of connection is set to 44. To restart the master one of the conditions listed below must be true: After a status message timeout the master MASTER_DEVICE_SCANNING state. A 1 is written to the TAKEOVER member of the device. goes in the
6-6
When the device is in the MASTER_DEVICE_STOP state, it means that it is not working and it is leaving the slave alone. The slave behavior will be the same as that of a single device. The quality is set to 35, and it will change state only if a 1 is written to START or TAKEOVER; then the slave will put itself in the MASTER_DEVICE_IDLE state. The stop state is used for link maintenance purposes. In this state the master WILL NOT automatically take control of the link.
SLAVE operation
When a commit on a slave device is executed, it goes to the SLAVE_DEVICE_CONFIGURATED state and sets the quality of connection to 50. It will change state only if one of the following conditions is true: A status message timeout occurs; the device goes in the SLAVE_DEVICE_SCANNING state. The master is already started in the MASTER_DEVICE_CHANGING state; the slave waits until the MASTER changes state or a status message timeout occurs. The MASTER, already started in the MASTER_DEVICE_CONFIGURATED state, MASTER_DEVICE_IDLE state, or MASTER_DEVICE_DOUBTFUL state; the slave goes in the SLAVE_DEVICE_IDLE state. The MASTER is already started in the MASTER_DEVICE_DOUBTFUL state; the slave goes in the SLAVE_DEVICE_SCANNING state.
When the slave device is in the SLAVE_DEVICE_SCANNING state, all the link services that depend on it become active, it accepts subscriptions from clients, and the quality of connection will be the value of the helper quality. The device remains in this state until the status of the master device is MASTER_DEVICE_SCANNING or MASTER_DEVICE_IDLE. Then the slave puts itself in SLAVE_DEVICE_CHANGING state. When the slave device is in the SLAVE_DEVICE_IDLE state it is in a state of inactivity. It waits for some event to change its state and sets the connection quality to 55. If a status message timeout occurs, it goes in the SLAVE_DEVICE_SCANNING state. If the master is in MASTER_DEVICE_DOUBTFUL state, the slave puts itself in the SLAVE_DEVICE_SCANNING state.
When the slave device is in the SLAVE_DEVICE_CHANGING state it is working to disable services and to reject all subscriptions. This state is intended to be a
6-7
DUAL context
In a dual context both devices work simultaneously. This mode of operation can be used when the link has two separate paths and they can be operated simultaneously. The devices configured as DUAL have a member named SUBSCRIPTION_LOAD that quantifies the maximum number of consecutive subscriptions that a device can receive. When a device reaches this limit, it lowers its connection quality, and gives the other device the task to answer the subscription requests and so on. If a device has a problem or goes down, its subscriptions are redirected to the other automatically. In every device state, the connection quality value, displayed by RRS, assumes a specific meaning; the quality value reflects the state of the device. The following section explains the relationship between states and quality values.
DUAL operation
When a commit on a dual device is executed, it puts itself into DUAL_CONFIGURATED state and after a while it goes in the DUAL_SCANNING state. The quality of connection in DUAL_CONFIGURATED is set to 50. When a DUAL device is in the DUAL_SCANNING state it sets its quality to 94 and changes state only if one of the following conditions is true: The subscription count goes over the maximum subscription load. The device puts itself in the DUAL_SCANNING2 state. The helper quality goes low. The device put itself into DUAL_DOUBTFUL state.
When a DUAL device is in the DUAL_SCANNING2 state, it sets its quality to 90 and changes state only if one of the following conditions is true: The companion device is not present, it has some problem, or it has reached its quota of subscriptions. The device puts itself in the DUAL_SCANNING state. The companion device is scanning, and the link quality goes down; the device puts itself in the DUAL_DOUBTFUL state.
6-8
When a DUAL device is into DUAL_DOUBTFUL state it sets its quality to 44 and changes state only if one of two conditions is true: either a status message timeout occurs, or helper quality is good (the device puts itself into DUAL_SCANNING state). When the device is in the DUAL_DEVICE_STOP state it is not working, and is leaving the other alone. The behavior of the other will be the same as that of a single device. The quality is set to 35 and it will change state only if a 1 is written to START or TAKEOVER; then the device will put itself in the DUAL_SCANNING state. The stop state is used for link maintenance purposes. In this state the device WILL NOT take the control of the link.
SINGLE context
This is the default behavior of the device; it scans continuously until someone stops it.
SINGLE operation
When a commit on a single device is executed, it puts itself in the SINGLE_CONFIGURATED state and after a while it goes to the SINGLE_DEVICE_SCANNING state. The quality of connection in SINGLE_DEVICE_CONFIGURATED is set to 50. When a single device is in the SINGLE_DEVICE_SCANNING state, its quality reflects the helper quality. It changes state only if a 1 is written to the STOP member. The device puts itself in the SINGLE_DEVICE_CHANGING state. When the device is in the SINGLE_DEVICE_CHANGING state, it is disabling services and rejecting all subscriptions. It is a temporary state. It goes to the SINGLE_DEVICE_STOP state when all the subscriptions are rejected. The quality of connection is set to 83. When a SINGLE device is in the SINGLE_DEVICE_STOP state its quality is set to 35, and it changes state only if a 1 is written to the START member; then the device puts itself into the SINGLE_DEVICE_SCANNING state. The stop state is used for link maintenance purposes. In this state the device DOES NOT HAVE control of the link.
6-9
Chapter 7
Link status and MsvSpy
Overview
The transport library exposes, for every port, six members that are in the order: Link status Transmitted messages Received messages Bad messages SpyID SpyBufferSize
The following example shows how to configure a maxLINKS type for a ComPort. # COMPORT data type
_MSV_IMMDATA.ADD_USER_TYPE _MSV_IMMDATA.COMPORT.TYPE _MSV_IMMDATA.COMPORT.SIZE _MSV_IMMDATA.COMPORT.COMMIT PCHAR PCHAR ULONG PCHAR COMPORT BYTE 6 COMPORT
_MSV_IMMDATA.COMPORT.ADD_MEMBER PCHAR STS _MSV_IMMDATA.COMPORT.STS.OFFSET ULONG _MSV_IMMDATA.COMPORT.STS.COMMIT ULONG _MSV_IMMDATA.COMPORT.ADD_MEMBER PCHAR TX _MSV_IMMDATA.COMPORT.TX.OFFSET ULONG _MSV_IMMDATA.COMPORT.TX.COMMIT ULONG _MSV_IMMDATA.COMPORT.ADD_MEMBER PCHAR RX _MSV_IMMDATA.COMPORT.RX.OFFSET ULONG _MSV_IMMDATA.COMPORT.RX.COMMIT ULONG _MSV_IMMDATA.COMPORT.ADD_MEMBER PCHAR BAD _MSV_IMMDATA.COMPORT.BAD.OFFSET ULONG _MSV_IMMDATA.COMPORT.BAD.COMMIT ULONG _MSV_IMMDATA.COMPORT.ADD_MEMBER PCHAR _MSV_IMMDATA.COMPORT.SPY_ID.OFFSET ULONG _MSV_IMMDATA.COMPORT.SPY_ID.COMMIT ULONG
0 0
1 0
2 0
3 0 SPY_ID 4 0
7-2
To connect the spy tool with the transport and with the port you want to observe, enter the appropriate service and selector in the dialog. Choose a size for the exchange buffer; spy allows buffer sizes from 32Kbytes to 1Kbyte. The buffer size depends on the protocol in use. It should be enough to capture a few cycles. Click the Configure transport button. If the connection with the transport is successful all the controls in the dialog will be enabled as shown in the following figure.
7-3
Click the Start button to cause the spy to begin collecting data. When the buffer is full, data appear in the list control. For each message it shows the direction (incoming / outgoing), a time stamp with millisecond precision, and the byte stream. The following figure shows an example of the captured data:
7-4
Use the find tool to search in the current buffer for an occurrence of specific data. The find lets you specify a mask to be able to exclude from the match some parts of the protocol. Click the Export data button to save the current buffer in a binary file for later inspection.
7-5
Appendix A
ModbusHelper DLL Service Selector and Properties
Overview
For a better understanding of the following notes it is suggested a preliminary reading of the Schneider Automation publication number PI-MBUS-300 Rev.J ( Modicon Modbus Protocol Reference Guide ). Good understanding of the whole document is necessary to be able to understand message data captured with MsvSpy.
The selector format for the ModbusHelper is the following: SS:TT:XXXX[:<qualifier>] Where: SS is the slave address. TT is the Modbus type. XXXX is the offset of the item. Values for TT are: 01 02 03 04 05 06 07 08 20 21 22 Coils Inputs Holding registers Input registers Force single coil Preset single register Read Exception status Diagnostics Read general reference Write general reference Mask write 4X registers
<qualifier> is used to specify special data treatment for words. N,M means extract N bits starting at bit M (For instance a small bit field value of 3 bits starting at bit 7 of the register number 100 can be selected as: 01:03:100:3:7)
The layout of the messages changes dynamically. It is driven by the current set of points accessed from the various clients. The library examines all the current running requests and joins them when possible to reduce to a minimum the required number of MODBUS messages. For TT=08 - XXXX specifies a diagnostic subfunction rather than an offset.
Only Return Query Data (0000) is implemented for the purpose of checking the connection. Each service in the Modbus helper DLL has the following properties available:
Property Meaning
READ_COIL_STS_MAX
READ_INPUT_STS_MAX
READ_HOLD_REG_MAX
READ_INPUT_REG_MAX
FORCE_MULT_COILS_MAX
FORCE_MULT_REG_MAX
CRC_CHECK SKIP_ADDRESS
ASCII_MODE
The maximum number of coils that can be requested in a read coil message. (Default 2000) The maximum number of inputs that can be requested in a read input message. (Default 2000) The maximum number of registers that can be requested in a read holding registers message. (Default 125) The maximum number of registers that can be requested in a read input registers message. (Default 125) The maximum number of coils that can be sent in a force multiple coils message. (Default 800) The maximum number of inputs that can be sent in a force multiple inputs message. (Default 100) 0 Disables CRC or LRC check (Modbus+ mode) 1 Enables CRC or LRC check (Default ) 0 Message contains the slave address field (Default ) 1 Message does not contain a slave address (Modbus+ mode ) 0 RTU mode (Default)
A-2
TCP_HEADER
Be sure that xxxxx_MAX properties are consistent with the PLC for correct operation. Modbus plus requires: CRC_CHECK = 0 SKIP_ADDRESS =1
A-3
Appendix B
msvComTransport DLL Service Selectors and Properties
Overview
This library offers transport services on the PC COM ports for dumb and smart multiport boards. It has been tested with the internal COM1 and COM2 ports, a dumb eight port Digiboard DigiCHANNEL PC/8 and a smart Comtrol RocketPort PCI/16. The selector format for the MsvComTransport is: COMn with 1 < n < 20 Each service in the MsvComTransport DLL has the following properties available: Property BAUD BITS Meaning The baud rate for the port (No default). The word length for the port: 5-6-7-8 (No default) N.B.- RocketPort supports only 7-8 bits. The parity mode for the port: NONE-ODD-EVEN-MARKSPACE (No default) N.B.- RocketPort supports only NONE-ODD-EVEN. The number of stop bits for the port: 1-1.5-2 (No default) N.B. RocketPort supports only 1-2 bits.
PARITY
STOP_BITS
Appendix C
MsvDPUComTransport DLL Service Selectors and Properties
This transport library allows maxLINKS to use a serial port physically located on a DPU to talk with external devices. The selected DPU must have a named serial buffer atom instantiated on it. The selector format for the MsvComTransport is simply the tag name of the relevant serial buffer atom. This library also supports MsvSpy. Each service in the MsvComTransport DLL has the following properties available: Property BAUD BITS PARITY STOP_BITS FLOW_CONTRO L Meaning The baud rate for the port The default is the configured baud rate on the serial buffer atom. The word length for the port : 5-6-7-8 The default is the configured word length on the serial buffer atom.. The parity mode for the port : NONE-ODD-EVEN-MARK-SPACE The default is the configured parity on the serial buffer atom. The number of stop bits for the port : 1-1.5-2 The default is the number of configured stop bits on the serial buffer atom. The desired flow control : NONE XON/XOFF CTS/RTS The default is the configured flow control on the serial buffer atom.
This is an example of a port configuration for maxLINKS: Assume that somewhere on maxNET there is a DPU with a serial buffer atom with FOO_PLC as the tagname.
_MSV_IMMDATA.ADD_USER_TYPE _MSV_IMMDATA.DPU_PORT.TYPE _MSV_IMMDATA.DPU_PORT.SIZE _MSV_IMMDATA.DPU_PORT.COMMIT _MSV_IMMDATA.DPU_PORT.ADD_MEMBER PCHAR PCHAR ULONG PCHAR PCHAR DPU_PORT BYTE 6 COMPORT STS
C-2
Appendix D
msvModbusPlus Transport DLL Service Selectors and Properties
Overview
This library offers transport services on the Modbus network through a Modicon adapter card SA85. It supports services about the status of the communication system. For this service, the helper library is MsvMbPlusTransport and the selector has the following format: MBPLUSADAPTER:0 The address is the Modbus+ routing path to select the requested station and slave path. The address is coded with up to five bytes, but not all bytes must be present. The bytes not used are coded as 0. If the address value is configured as a long type, only four bytes may be set. The full address is configured using a character string. For example, to address a station on the same network on routing path 05 and slave path 01 the address value in is hexadecimal: 0x05010000 For more detailed information about the Modbus Plus routing path reference the Modicon documentation.
Appendix E
BOSHelper DLL Service Selectors and Properties
Overview
The Bos Helper library supplies to maxLINKS two types of variables: Status Command These are the two categories of data defined in the SootBlowers communication protocol. The status variables are divided into: Analog Points Alarms Digital Inputs Status of Blowers Status of Sequences Commands are variable to change status of blowers, or to start or to stop a sequence. A sequence is a group of timed actions on one or more soot blowers. To use a variable produced by the Bos system: 1. During configuration, create a device with BosHelper as helper and MsvComTransport as transport. 2. Define a service with the desired type and the relevant selector. The following describes a few rules used to identify the data item in the Bos Helper Library:
OPIN | SYSIN | SYSALM The following describes the meaning of the keywords.
Keyword
BLOW SEQ AIN OPIN SYSIN SYSALM Blower Sequence Analog Input Operating Input System Input System Alarm
Meaning
Keyword
E-2
First value
Max Value
1 1 1 1 1 1
Meaning Operating blower status Motor stall alarm Motor overload alarm
Conversion Char, short, long, float, double Char, short, long, float, double Char, short, long, float, double Char, short, long, float, double Conversion Char, short, long, float, double Char, short, long, float, double Char, short, long, float, double Long, float, double Char, short, long, float, double Char, short, long, float, double Char, short, long, float, double
Meaning Elapsed time alarm Fail to start alarm Direction of travel Tag code
Manual start command Retract Bool command Blower off Bool service command
E-3
Blower Blower
Bool Bool
Blower
Bool
Blower
Bool
Blower Blower
Bool Bool
Char, short, long, float, double Char, short, long, float, double
Char, short, long, float, double Char, short, long, float, double SBP_TIME
E-4
Priority start sequence Sequence abort Sequence hold Sequence restart Sequence manual/continuous Sequence held by operator Sequence held by alarm Sequence held by priority
char, short, long, float, double char, short, long, float, double char, short, long, float, double char, short, long, float, double char, short, long, float, double char, short, long, float, double char, short, long, float, double char, short, long, float, double
BOSHelper Properties
For the BosHelper dll, no properties are defined.
E-5
Appendix F
MsvODBCHelper DLL Service Selectors and Properties
Selector General Format
The selector format for the MsvODBCHelper is a string in the following format: Selector::= [<Direction> ',' ] <Table> ',' <Key> ', ' <Column> ', ' <FieldValue> ', ' [ <Time> ',' ]
Selector Direction
<Direction>::= 'W' | R' | 'w' | 'r' | 'R*' | 'r*' | '*' The meaning of the parameters is explained below:
Parameter
W or w R or r * or R* or r*
Meaning
Write Operation Read Operation All Table Loading
Selector Table
<Table>::= <Identifier> Identifier connected. An ASCII string that identifies a table of the database to be
It is composed of two fields: Date stored in seconds Milliseconds The following string is an example of an ODBC selector: *,PDB,SA01_08_JI_P211,TAG,VALUE The library loads all the tables (*) named PDB and it searches, in the PDB column TAG for the point named SA01_08_JI_P211. When it finds the correct row, it retrieves the value from the column named VALUE.
Service Address
The Address is a string in the form: address::= <DataSource> ',' [<Login> ',' <Password> ','] where: <DataSource>::= <Identifier> DataSource An ASCII string that identifies the ODBC data source
<Login>::= <Identifier> Login An ASCII string added when the database needs an access controlled by login <Password>::= <Identifier> When the database is accessed by a login, a password ASCII string must be specified too.
Service properties
Each service in the MsvODBCHelper DLL has the following available properties: Property BULK_SIZE Meaning When the library execute the database load, it does not read all the data at one time, but in many data read
F-2
ODBCHelperIEC has all the capabilities of the ODBCHelper but it also has some special code to interface with the event table written by the ABB MicroSCADA. SBP subscriptions with min_time = 0 are directly connected to the event table.
F-3
Appendix G
Allen-Bradley Helper DLL Service Selectors and Properties
Overview
The Allen Bradley Helper interfaces the maxLINKS with different PLC families from Allen Bradey. For a better understanding of the following notes it is suggested a preliminary reading of the Allen Bradley publication number 1770-6.5.16 (DF1 Protocol and Command Set Reference Manual), at least chapters 7 (Communication Commands) and chapter 13 (PLC addressing). Good understanding of the whole document is necessary to be able to understand message data captured with MsvSpy. The format of the selector is the following : <selector> ::= <dst> ';' <src> ';' <code> ';' <address> [ ';' <specifier> ] <level> <file offset> <file number> <dst> <src> <command> <function> <file type> <bit field size> <starting bit> ::= <unsigned integer> ::= <unsigned integer> ::= <unsigned integer> ::= <unsigned integer> ::= <unsigned integer> ::= <unsigned integer> ::= <unsigned integer> ::= B |N | F | I | O | T | C | S ::= <unsigned integer> ::= <unsigned integer>
<ascii address> ::= <file type> <file number> [ : < file offset> ] [ / <bit> ] <address> ::= <offset> @ [ ( <level> { ','<level> } ) | ( $ <ascii address> ) ] <file> ::= <file type> <file number> <code> ::= <command> . <function> <type specifier>::= F <bit field specifier > ::= <bit field size> ',' <starting bit> <bit_field_specifier> ::= <unsigned integer> , <unsigned integer> <specifier> ::= <type specifier> | <bit_field_specifier> If a bit field is specified on a read operation the bit field is aligned to bit 0 of the result before the scaling is applied ( if any ). If a bit field is specified on a write
Allen Bradley PLC processors support both logical and physical addressing, the Allen Bradley helper supports only logical addressing. It will be too difficult for the application to understand the precise memory locations where data resides. Logical type of addressing is the addressing that normally a PLC processor uses in its ladder diagram program to access its own data table memory.
PLC2/1774_PLC addressing.
PLC-2 and 1774-PLC processors access their data tables by using an octal word address. For PLC-2/1774-PLC command messages, you must put the equivalent of this address in the <offset> field of the selector. To encode a logical PLC-2/1774-PLC address: 1. Convert the octal word address into a decimal number. 2. Double this converted word address to get the corresponding byte address. 3. Place the result in the <offset> field. This is an example of a selector for PLC2 binding an sbp variable to the word number 120, assuming that the PLC is at the address 9 and the address assigned to the KF2 module is 3:
9;3;1;120
Note that with PLC2 and 1774 models only unprotected read and protected write functions can be used.
PLC_3 Addressing
PLC-3 processors use a form of logical addressing known as extended addressing. With extended addressing, you specify the address for each level (or sub-division) of PLC-3 memory, down to the smallest subdivision you want to access. You can use this method to specify up to 6 levels of extended addressing, which is enough to address any particular word in PLC-3 memory, for more information on PLC-3 extended addressing, refer to your PLC-3 Family Programming and Operations Manual.
G-2
Example: PLC_3 logical binary addressing format E3:1:8:260:0:0 Data table area Context Section File Structure Word ( level 1 ) ( level 2 ) ( level 3 ) ( level 4 ) ( level 5 ) ( level 6 ) E3 1 8 260 0 0
This is an example of a selector for PLC3 binding an sbp variable the word in the previous example assuming that the PLC is at the address 9 and the address assigned to the KF2 module is 3:
9;3;15,1;0@0,0,1,8,260,0,0
Note that the selector requires always a 7 levels address. Even if this form of addressing is supported from the library, it is advisable to use ASCII symbolic addressing. Symbolic addressing uses ASCII symbols to represent a logical address. Symbolic addressing starts with a $ followed by the file type, a file number, an item number and an optional bit number. The following table lists the allowed file types :
B
N S F I O T C
Binary file Integer file Status file Float file Input data Output data Timers Counters
Before using a symbolic address in a message, you must first define the symbol at the PLC-3 processor that is to receive the message.
Examples : To access the word number 23 in the binary file number 13 the corresponding ascii logical address will be :
$B13:23
The bit number 12 of the same word can be accessed using :
Metso Automation Inc. 278623
G-3
$B13:23/12
The binary file can be viewed also like a uniform bit array. Bit number 134 will be accessed with :
$B13/134
Other examples :
$N7:23 Integer number 23 in file 7 $F8:44 Float number 44 in file 8 $T4:11 Timer number 11 in file 4 $C5:3 Counter number 3 in file 5 $S2:1 Status word number 1
For more information, refer to your PLC-3 user manual. This module 1775_KA 1775_S5, _SR5 Accepts ASCII symbols ASCII symbols logical ASCII All revision levels of 1775_S5, _SR5 accept PLC_5 type reads and type writes. 1775_S5, _SR5 series A, revision E or later can also use logical ASCII with a PLC_3 word range read or word range write.
PLC_5 Addressing.
PLC-5 processors, like PLC-3 processors, use a form of logical addressing. With logical addressing, you specify the address for each level (or sub-division) of PLC-5 memory, down to the smallest subdivision you want to access.
PLC-5
up to 4 levels of extended addressing, which is enough to address any word in PLC_5 memory.
G-4
PLC_5/250
up to 7 levels of extended addressing, which is enough to address any word in PLC_5/250 memory.
Example (PLC-5) : $N10:134 level 1 level 2 level 3 level 4 0 10 134 0 (data table) (file number) (element offset) (subelement)
This is an example of a selector for PLC5 binding an sbp variable to the word in the previous example assuming that the PLC is at the address 9 and the address assigned to the KF2 module is 3:
9;3;15,1;0@0,0,0,0,10,134,0
Note that the selector requires always a 7 level address even if only the first 4 levels are used.
Logical ASCII Addressing PLC5 and SLC processors support the same logical ascii addressing specified before. NOTE : For compatibility reasons with early versions using B and N file type, an offset can be specified as follows: 9;3;15,1;121@$N10:134 9;3;15,1;67@$B9:14
Implemented message codes : The following table shows the implemented message code/functions. Older functions code are implemented in a compatibility mode in newer PLCs and this can cause some confusion because seems that the same data can be accessed using different message types, but this assumption it is true only for some files types/numbers. The table suggest which message codes that should be used to interface the various PLC families.
G-5
Message
CMD
FNC
Echo File Read File Write Protected typed file read Protected typed file write Protected typed logical read with 3 address fields Protected typed logical write with 3 address fields Protected write Typed read Typed write Unprotected read Unprotected write Word range read Word range write
6 15 15 15 15 15 15 0 15 15 1 8 15 15
PLC 2 X
PLC 3 X X X
PLC 5 X
SLC
X X
X X X X X
104 103 X X 1 0 X X
X X
X X
Moreover file typed read and write requires the overhead of opening/closing files and it is less efficient than other message codes, should be really used only with MicroLogix family.
G-6
Properties. Each service in the Allen Bradley helper DLL has the following available properties: Property TRANSACTION_TIMEOUT MESSAGE_TIMEOUT Meaning The maximum number of milliseconds to wait for a reply from the PLC. The maximum number of milliseconds to wait between characters in a PLC answer. (Default 20) The maximum number of milliseconds to wait between a PLC answer and the following request. (Default 0) The maximum allowed distance to join the service to a previous request. (Default 125) The maximum number of retries on error before lowering the quality of the connection. (Default 3) The Allen Bradley PLC Model. It must be a string among the following : "MICROLOGIX" "SLC500" "SLC5/03" "SLC5/04" "SLC5/05" "PLC-2" "PLC-3" "PLC-5" "PLC-5/250" There are some differences between the models and the library should know the model to take care of them. (Default PLC-5) The maximum number of elements that can be sent/received in a single message. (Default depends from PLC type) Superseded by MAX_ELEMENTS, legacy configurations only. 1 Forces writes being joined even if they are not contiguous. ( wipes holes in the PLC memory map ). (Default 0)
INTERMESSAGE_DLY
OVER_WORDS
COM_RETRIES
MODEL
MAX_ELEMENTS
MAX_SIZE FORCE_JOIN_WRITES
G-7
Appendix H
ModbusHelper32 DLL Service Selector and Properties
Overview
The ModbusHelper32 is a library that implements a variation of the Modbus protocol that uses 32 bits registers. This protocol is used by some brands of instruments. The selector format for the ModbusHelper32 is the following: SS:TT:XXXX:<qualifier> Where: SS TT is the slave address. is the Modbus type
Values for TT are: 03 04 06 08 Holding registers Input registers Preset single register Diagnostics
<qualifier> is used to specify special data treatment for words; when using this library the qualifier specification is mandatory. F L means that the register must be interpreted as a float value. means that the register must be interpreted as a long value.
The layout of the messages changes dynamically. It is driven by the current set of points accessed from the various clients. The library examines all the current running requests and joins them when possible to reduce to a minimum the required number of MODBUS messages. For TT=08 - XXXX specifies a diagnostic subfunction rather than an offset.
Only Return Query Data (0000) is implemented for the purpose of checking the connection.
Be sure that xxxxx_MAX properties are consistent with the PLC for correct operation.
H-2
Appendix I
MsvTCPNetTransport DLL Service Selectors and Properties
This library offers transport services over the TCP/IP network ports.
The selector format for the MsvComTransport is the following : <ip address>,<port>[,CLIENT] where : <ip address> <port> ::= xx.xx.xx.xx ::= number
Appendix J
ABCIPHelper DLL Service Selectors and Properties
Overview
The ABCIPHelper ( Allen Bradley Control and Information Protocol ) Helper library allows maxLINKS to interface with Allen-Bradley PLC ControlLogix5xxx families. The library implements explicit" messaging with AB products (primarily PLC5E, SLC5/05, and Logix5550 controllers). The former is a point to point, request/response (client/server) protocol typically used for unscheduled "information" messaging. The term "explicit" refers to an address which explicitly details the path to a specific target object using an Path or Internal Object Identifier (EPATH or IOI). An "implicit" address is a Connection Identifier (CID) for a specific object between a client and server (or producer and consumer). A connected, explicit message actually contains both, a CID to the target device's Message Router object, and an EPATH (IOI) to the specific target object within the device. An unconnected, explicit message contains only an EPATH (IOI). The following references are available electronically for free at the RA websites: "www.ab.com" and "www.theautomationbookstore.com"), except for Ref#7 and 10 which are available from the EtherNet/IP website (www.ethernet-ip.org) hosted by CI (ControlNet International) and ODVA and Ref.8 and 9, which are available from the CI website (www.controlnet.org). Ref#1. "DF1 Protocol and Command Set Reference Manual", Pub. 17706.5.16, Oct. 1996. Ref#2. "Logix5000 General Instructions Reference Manual", (Pub. 1756RM003C-EN-P - November 2000) Ref#3. "Logix5000 Controllers Common Procedures Programming Manual", publication 1756-PM001B-EN-P). Ref#4. "Logix5000 Data Access Reference Manual", Publication 1756RM005A-EN-E Ref#5. "ControlLogix System User Manual", publication 1756-UM001BEN-P November 2000).. Ref#6. "Integrated Architecture Logix Platforms", catalog number 1756-CDDEC00 (part no. 957173-04) Ref#7 "ControlNet Specification", from ControlNet International
selector ::= <tag> ':' <datatype> ':' <direction> [ ':' <bit_field_specifier> ] tag ::= string [ '@'<index> ] datatype ::= 'BOOL' | 'BIT_ARRAY' | 'SINT' | 'INT' | 'DINT' | 'REAL' | 'TIMER' | 'COUNTER' direction ::= 'R' | 'W' bit_field_specifier ::= <number> ',' <number>
Service Properties
Each service in the ABCIPHelper DLL has the following available properties:
Property
CIP_PORT CIP_LINK TRANSACTION_TIMEOUT
Meaning Usually 1 ( PLC Backplane ) Represents the PLC slot ( Usually 0 ) All the transactions must complete within this time (specified in microseconds).
J-2
Configuration Sample :
TCP port configuration :
[]_LOGIX.ADD_SERVICE []_LOGIX.EIP_PORT.TYPE []_LOGIX.EIP_PORT.HELPER []_LOGIX.EIP_PORT.SELECTOR []_LOGIX.EIP_PORT.COMMIT PCHAR PCHAR PCHAR PCHAR PCHAR EIP_PORT TCPPORT Usually declared in base.txt MsvTCPNetTransport Is the only allowed transport for CIP 128.0.0.1,44818,CLIENT TCP port 44818 must be specified EIP_PORT
In case the PLC has an additional network interface or there is a backup an alternate port can be specified : []_LOGIX.ADD_SERVICE PCHAR EIP_PORT_ALT []_LOGIX.EIP_PORT_ALT.TYPE PCHAR TCPPORT []_LOGIX.EIP_PORT_ALT.HELPER PCHAR MsvTCPNetTransport []_LOGIX.EIP_PORT_ALT.SELECTOR PCHAR 10.20.20.11,44818,CLIENT []_LOGIX.EIP_PORT_ALT.COMMIT PCHAR EIP_PORT_ALT:
.. Device configuration :
[]_LOGIX.ADD_DEVICE []_LOGIX.LOGIX5555.HELPER []_LOGIX.LOGIX5555.TRANSPORT []_LOGIX.LOGIX5555.ADDRESS []_LOGIX.LOGIX5555.ALT_ADDRESS []_LOGIX.LOGIX5555.REDUNDANCY_MODE []_LOGIX.LOGIX5555.SCHEDULING []_LOGIX.LOGIX5555.SCAN_TIME []_LOGIX.LOGIX5555.COMMIT PCHAR PCHAR PCHAR PCHAR PCHAR PCHAR ULONG ULONG PCHAR LOGIX5555 ABCIPHelper MsvTCPNetTransport 128.0.0.1,44818,CLIENT 10.20.20.11,44818,CLIENT PRIMARY 1 1000000 LOGIX5555 PCHAR PCHAR 500 1
[]_LOGIX.LOGIX5555.TRANSACTION_TIMEOUT.SET_PROPERTY # PLC backplane is always port 1 []_LOGIX.LOGIX5555.CIP_PORT.SET_PROPERTY # LINK is the slot where the CPU is plugged. # Usually slot 0, right after the power supply. []_LOGIX.LOGIX5555.CIP_LINK.SET_PROPERTY Point configuration : []_LOGIX.LOGIX5555.ADD_SERVICE []_LOGIX.LOGIX5555. <maxLINKS tag>.TYPE []_LOGIX.LOGIX5555. <maxLINKS tag>.SELECTOR []_LOGIX.LOGIX5555. <maxLINKS tag>.COMMIT PCHAR PCHAR PCHAR PCHAR
PCHAR
<maxLINKS tag> LOGIC Usually declared in base.txt <plc tag>:BOOL:R <maxLINKS tag>
J-3