Device Interfaces Using EDITechnology
Device Interfaces Using EDITechnology
Version 7.5
Copyright 2004 Tecnomatix group of companies. All rights reserved. NOTICE: The information contained in this document (and other media provided herewith) constitutes confidential information of Tecnomatix group of companies (Tecnomatix) and is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Such information is not to be disclosed, used or copied by, or transferred to, any individual, corporation, company or other entity, in any form, by any means or for any purpose, without the express written permission of Tecnomatix. The information contained in this document and related media constitutes documentation relating to a software product and is being provided solely for use with such software product. The software product was provided pursuant to a separate license or other agreement and such information is subject to the restrictions and other terms and conditions of such license or other agreement. The information contained in this document and related media is subject to change without notice and does not represent a commitment and does not constitute any warranty on the part of Tecnomatix. Except for warranties, if any, set forth in the separate license or other agreement relating to the applicable software product, Tecnomatix makes no warranty, express or implied, with respect to such information or such software product. Tecnomatix, Tecnomatix Logo, FactoryLink, Knowledge Puts You In Control, Open Software Bus, and Xfactory are trademarks or registered trademarks of Tecnomatix in the United States and/or other countries. All other brand or product names are trademarks or registered trademarks of their respective holders.
Contents
Chapter 1 Device Interface Overview ........................................................................... 1
Supported Drivers ................................................................................................................. 1 Guidelines for Driver Technology Selection ........................................................................ 4
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Common Errors ....................................................................................................... Testing Your Application .......................................................................................... Verifying Proper Communications ................................................................................... Program Arguments .......................................................................................................... 142 143 144 146
Allen-Bradley Switch Setup ............................................................................................. 1770-KF2 Series B ................................................................................................... 1771-KA2 ................................................................................................................. 1771-KE ................................................................................................................... 1771-KG .................................................................................................................. 1785-KA ................................................................................................................... Run-Time Application Messages ..................................................................................... Single-Digit Codes ................................................................................................... Double-Digit Codes .................................................................................................
Debugging Tools .............................................................................................................. Status/Debug Levels ................................................................................................. RAW VALUE ............................................................................................................ STAT_TAG ................................................................................................................ Summary of Basic Concepts ............................................................................................ GPI Functions ................................................................................................................... Principles of Operation ........................................................................................... Defining the Outgoing Message .............................................................................. Formatting the Incoming Response ......................................................................... Associating an Outgoing Message with an Incoming Response ............................. Specifying Methods to Detect an End-of-Response ................................................. Non-Printable or Do Not Care Characters ......................................................... Initiating a Transmission ......................................................................................... Putting the Protocol Module in Unsolicited Mode .................................................. Reporting Message Status ........................................................................................ Converting a Fields Value ....................................................................................... Using Process Functions .................................................................................................. Associating a Digital Tag to a Bit ............................................................................ Determining the Sources of Field Values ................................................................. Modifying a Previously Defined Field ..................................................................... GPI Configuration ............................................................................................................ Configuration Example ............................................................................................ Command/Response Information Table Entries ...................................................... Defining the Outgoing Message to the GPI ............................................................. Defining Response Termination and Status Tags ..................................................... Defining the Incoming Response to the GPI ............................................................ Using Process Functions .................................................................................................. Process Functions Table .......................................................................................... Using Conversion Functions ............................................................................................ Sample Protocols .............................................................................................................. Response Protocols .................................................................................................. Command Protocols ................................................................................................ Network Response Protocols ................................................................................... Network Command Protocols .................................................................................. Run-Time Application Messages ..................................................................................... GPI Error Codes ...................................................................................................... 240 240 240 241 241 243 243 243 246 247 249 250 251 251 252 253 254 254 255 256 257 257 258 267 269 270 271 271 274 276 276 278 279 281 284 284
Configuring the Read/Write Control Table ...................................................................... Accessing ................................................................................................................. Field Descriptions ................................................................................................... Configuring the Read/Write Information Table ............................................................... Accessing ................................................................................................................. Field Descriptions ................................................................................................... Configuring the OPTOMUX Initialization Information Table ......................................... Accessing ................................................................................................................. Field Descriptions ................................................................................................... Technical Notes ................................................................................................................ Cable Diagrams ....................................................................................................... Read/Write Information Init Data Field Notes ........................................................ Initialization Sequence ............................................................................................. Write Operations ...................................................................................................... Read Operations ..................................................................................................... Error Messages ................................................................................................................. Opto 22 OPTOMUX Error Message Format .......................................................... EDI Error Codes ...................................................................................................... Opto 22 OPTOMUX Error Codes ........................................................................... 359 359 359 365 365 365 367 367 367 368 368 370 372 373 375 377 377 378 379
Configuring the Read/Write Control Table ...................................................................... Configuring the Read/Write Information Table ............................................................... Logical Station Commands .............................................................................................. Activate/Deactivate Station Command .................................................................... Set Remote Parameters Command .......................................................................... Set Logical Station Variables Command ................................................................. Cable Diagrams ................................................................................................................ Thick Net Bus ........................................................................................................... Thin Net Bus ............................................................................................................ Siemens H1 Data Types .................................................................................................... Siemens H1 Adapter Display Utility (H1MPDISP) ......................................................... Run-Time Application Messages ..................................................................................... Run-Time Logical Station Command Error Codes ..................................................
413 420 429 429 430 435 440 440 441 441 445 446 448
Configuring Telemecanique Networks ..................................................................... Configuring the Slaves and the TW7 Data Fields ................................................... Network Examples ................................................................................................... FactoryLink and TSX/PMX PLC Data Objects ....................................................... Unsolicited Data Configuration Example ............................................................... Error Messages ................................................................................................................. 493 494 497 500 509 512
Chapter 1
FactoryLink provides a number of device drivers that allow you to communicate with remote devices that monitor and control processes. These devices include Programmable Logic Controllers (PLCs), Remote Terminal Units (RTUs), or custom devices. Virtually all industries, from the production of goods at a factory to the movement of liquid or gas down a pipeline, use these devices. By sending messages between FactoryLink and these devices, you can automate tasks associated with processes, such as when valves are opened/closed, when machines are turned on/off, or when data like temperature or pressure is collected. Each device uses a specific communication protocol.
S UPPORTED D RIVERS
FactoryLink supplies a set of protocol-specific drivers for communicating with these devices. Each protocol driver translates messages sent from FactoryLink into a format understood by the device and translates messages sent from the device to a format understood by FactoryLink. FactoryLink provides several technologies that work with these drivers. These technologies aid in providing a consistent, easy-to-use interface into the FactoryLink Real-time Database. These technologies include External Device Interface (EDI), Rapid Application Protocol Driver (RAPD), OLE for Process Control (OPC), and others. The FactoryLink documentation set is centered around these technologies, so you will find the documentation for your driver in the manual with its associated driver technology. The following table lists the drivers that are available in FactoryLink.
PLC
Protocol
Requires
Allen-Bradley Device PLC-2, PLC-3, PLC-5, Ethernet, Data Interface PLC-5/250, Highway Plus, PLC-5/xxE, PLC-5/xx RS232 ControlNet, SLC-500 (series 03, 04, 05), Soft 5 or 500 PLC, PLC 5 or 500 Emulation, and ControlLogix Allen-Bradley KTDTL PLC-2, PLC-3, PLC-5, Data Highway PLC-5/250, Plus, Data PLC-5/xxE, PLC-5/xx Highway-485 ControlNet, SLC-500 (series 03, 04) PLC-2, PLC-3, PLC-5, Ethernet, Data PLC-5/250, Highway Plus PLC-5/xxE, SLC-500 (series 05 ethernet) and (series 03, 04, and 05 by remote bridging) SEMI Host Communication Standard (SECS) devices GE Devices Non-specific
RAPD
RSLinx v2.42: optional Allen-Bradley PKTX card, optional Allen Bradley PKTC card, optional Allen Bradley Soft PLC, optional Allen Bradley PLC Emulation Software
KTDTL
Allen-Bradley NetDTL
NetDTL
RSLinx v2.42
FLGEM Semiconductor Interface General Electric Fanuc General Purpose Interface Mitsubishi MECOM Serial Mitsubishi MECOM Serial and Ethernet
RS232, Ethernet GW
RS232 RS232
2000, XP, 2003 2000, XP, 2003 2000 2000, XP AJ71C24 Computer Link Module (optional) AJ71C24 Computer Link Module or AJ71E71 Ethernet Interface Module (optional) SA85 or PC85 card with low-level protocol specific driver SA85 or PC85 card with low-level protocol specific driver
Modbus Plus
Modicon 984, Quantum, and Momentum Modicon 984, Quantum, and Momentum
ModBus Plus
EDI
2000, XP
ModBus Plus
RAPD
2000, XP
PLC Modicon 184, 384, 484, 584, 884, 984, M84, Quantum, and Momentum Modicon 984 (using Modicon TCP/IP MBP+ Bridge), Quantum, and Momentum C120, C200H, C500, C1000, C2000 Opto 22 Optomux devices
Protocol RS232
Requires
Ethernet
RAPD
EDI EDI EDI/ Custom EDI/ Custom EDI/ Custom EDI/ Custom
2000, XP, 2003 2000, XP, 2003 2000 Telemecanique Low-level drivers with special Ethway card
RS232 Ethernet
2000, XP 2000, XP Bit Bus card Wnt-bik003Treiber with v.12 Low-level driver Telemecanique UNITE-XWAY Low-level drivers with special Fipway card, or PC mounted PLC/PCX57
Telemecanique XWAY communication protocols (XIPWAY, ISAWAY FIPWAY, UNI-TELWAY) Telemecanique Direct Requests
2000, XP
Schneider TE DRQ
Custom
2000, XP
Telemecanique UNITE-XWAY Low-level drivers with special Fipway card, or PC mounted PLC/PCX57 Telemecanique UNITE-XWAY Low-level drivers with special Fipway card, or PC mounted PLC/PCX57
Schneider TE Load
Custom
2000, XP
SEMI Host Communication Standard (SECS) devices SEMI Host Communication Standard (SECS) devices
Ethernet
GW
RS232
GW
Driver Siemens CP525 Siemens H1 Siemens Sinec H1 Siemens S7 Driver Siemens 3964R Square D Serial/Ethernet Symax S5, S7 S5 S5, S7 S7 S5, S7
PLC
Technology Windows OS EDI EDI RAPD ECI RAPD 2000, XP, 2003 2000 2000, XP, 2003 2000, XP 2000, XP, 2003 2000, XP, 2003 2000
Requires
DLC Protocol only ISO TP2000 Protocol Siemens Softnet; not supported on 2003 yet
Square D SY/MAX
SQRD RS232 SQRD Ethernet REQ DLC Protocol Stack TIWAY Serial Unilink (optional)
RS232 supports TI RS232, TIWAY 525, 530C, 530T, 535, Serial Unilink 540, 545, 565, 560, RTU, 5TI; TIWAY supports TI 520C, 525, 530C, 530T, PM550, PM550C
EDI
G UIDELINES
FOR
This section provides guidelines for determining whether to use an EDI or RAPD driver in your FactoryLink application. Factors include the hardware being used or whether you have an existing or new application. Depending on the protocol selected to communicate with the hardware device, such as serial or Ethernet, your selection may depend on the driver availability for the specific protocol/hardware. Use the following guidelines to determine whether to use EDI or RAPD technology: If you are using EDI in an existing application and it works, we suggest that you continue with the EDI technology. EDI is relatively easier to configure than RAPD. EDI is more vulnerable to problems from overtriggering than RAPD. However, when proper triggering techniques are used, EDI performs as well as RAPD. With all RAPD drivers, you have the option of using the ECI task rather than the IOX task. The ECI task has many powerful features, one of which is the ability to
read and write to the same tag. In EDI, you must create two tags for reading/writing to the same PLC address. If you will implement redundant FactoryLink servers, we recommend using RAPD technology. This allows you to use the ECI task with your RAPD protocol driver and implement mailbox marshalling through the VRN task to synchronize the servers. To implement redundancy with EDI, you must synchronize the servers through VRN on a tag-by-tag basis. For new applications, the OPC client may be the best choice. The standard OPC client works for most applications, but if you are implementing redundant servers, you may wish to use ODX, an OPC client that is actually a RAPD protocol driver. Hardware-specific considerations include: For most Allen-Bradley hardware devices, you may use either the RAPD or EDI driver. However, if you want to use Control Net, SLC, or one of the other newer Allen-Bradley technologies, you must use RAPD. Note that if you use RAPD, you can communicate with serial, Control Net, and so on using the same tables. However, you must create different tables with EDI for each. If you have an existing application that works using Allen-Bradley hardware, continue using the same technology. If you are using Modicon hardware, use: Serial EDI driver Modbus Plus EDI driver Ethernet RAPD driver
Chapter 2
C OMMUNICATIONS M ETHODOLOGY
FactoryLink can retrieve (or read) data from a remote device and send (or write) data to a device. Below and on the next page are two sequential lists and illustrations of events explaining FactoryLinks process for retrieving and sending device data.
Open Closed 0 1
1 0 1 0 1 0
EDI sends a message requesting data from a remote device. A protocol module translates the message to a format the device understands. The protocol module sends the translated message to the device. The device processes the message. The device returns a message to the protocol module containing the requested data. The protocol module translates the response to a format FactoryLink understands. The protocol module sends the devices translated response message to EDI. EDI stores the received data as tags in FactoryLinks real-time database.
MTR SOL
1 0 1 0 1 0
EDI sends a message containing data that can be interpreted as instructions, such as to open or close a valve or to start a motor. A protocol module translates this message into a format the device understands. The protocol module sends the translated message to the device. The device performs the instruction contained in the message.
C OMMUNICATING
WITH
M ULTIPLE D EVICES
FactoryLink communicates with multiple devices of the same or different communication protocols concurrently. Through one communications port, FactoryLink communicates with multiple devices that share the same communications protocol
One Port, One Protocol, Multiple Devices.
Using an additional port, FactoryLink can communicate with devices that share another communications protocol
Multiple Ports, Multiple Protocols.
Each communications port supports one type of protocol. This means only one protocol module can be used per port. The number of supported devices per port depends on your hardware configuration. See Device Topologies on page 16 for descriptions of various types of hardware configuration.
C OMMUNICATING
WITH
EDI is the interface to FactoryLink and the protocol module is the interface to the device, as shown by the following topology.
A FactoryLink application requires only one EDI task running to communicate with multiple devices. However, EDI can provide a common interface to the real-time database for one or more instances of the same protocol module or one or more unique modules that support devices of varying manufacturers and types. Use more than one protocol module when you need to communicate with different types of devices through separate ports, as shown in the graphics Communicating with Different Protocols and Communication Through Multiple Unique Protocol Modules .
The following graphic illustrates EDI communicating through one port with a protocol module for a group of devices that controls and monitors a particular process, and at the same time communicating through a different port with another protocol module that controls and monitors a different process.
Communicating with Different Protocols
Port Port
FactoryLink Computer
EDI and one protocol module can communicate with devices that share the same protocol. The next graphic illustrates FactoryLink communicating with three devices from one port.
Note
These examples are for network or multi-drop communications. EDI and multiple instances of one protocol module can communicate with devices that share the same communication protocol. The graphic Communication Through Multiple Instances of One Protocol Module illustrates FactoryLink communicating with devices via three different ports. When you use instances of a protocol module, the distribution of system resources allows better throughput, thus speeding up communications. This type of configuration is typical in point-to-point communications, discussed in Device Topologies on page 16.
EDI and multiple unique protocol modules can communicate with devices that support the different communication protocols. The graphic Communication Through Multiple Unique Protocol Modules illustrates FactoryLink communicating with the devices via three different ports.
Note
Regardless of the number of protocol modules in use and whether they are alike or different, FactoryLink can only communicate with as many devices as your hardware configuration will support.
D EVICE TOPOLOGIES
The diagrams in this section illustrate some possible ways FactoryLink communicates with devices. For information about communications with devices using specific protocol modules, see the Supported Ports table. Serial Port For a serial system unit communications (COM) port connection, FactoryLink can communicate with devices in two ways: directly (one point to one point) or through a network interface module. An interface module can be an RS232-to-RS422 external converter or a device that bridges an RS232 communications link to a proprietary network.
Point-To-Point Connection
RS232
Ethernet Board Port FactoryLink can communicate with devices across an Ethernet network through an Ethernet adapter board.
FactoryLink Computer Ethernet Board Port
Combination Topologies can be combined. The way in which you successfully combine topologies depends on a combination of limitations in hardware, system resources, and FactoryLink. The graphic below illustrates simultaneous communications with four devices: three are linked via a network through an RS232-to-RS422 converter and one device is connected directly to a COM port.
RS232
RS422
The following table lists the ECS device interface protocol module base set and the ports supported by each.
Supported Ports
Allen-Bradley General Electric Fanuc General Purpose Interface Modicon Modbus Modicon Modbus Plus OMRON Host Link Protocol Siemens CP525 Siemens Sinec H1 Square D Texas Instruments TIWAY/Point-to-Point
C OMPONENTS
OF A
C OMMUNICATION P ATH
The communication path to each device is identified to FactoryLink by its components. For a COM port connection, the two components are the device and the COM port to which it is connected, as shown below.
Two Components of a COM Port Connection
Port
Device
For an Ethernet board port connection, the two components are the device and the board port to which it is connected.
Two Components of an Ethernet Port Connection
FactoryLink Computer Ethernet Board Port
Device Port
Each component and its attributes must be uniquely identified. Every device that communicates with FactoryLink must be assigned a unique logical number. Likewise, every COM or board port on the computer through which a device communicates must be assigned a unique logical number. For purposes of this discussion, devices are referred to interchangeably as stations. When you begin configuring the communication path, the number you assign to each device is called a logical station number. The number you assign to each port is called a logical port number. Some examples of possible numbering schemas are illustrated in the next two diagrams.
Point-To-Point Connection
Logical Port 0
FactoryLink COM Computer Port COM Port
Ethernet Connection
Logical Station 1 Logical Station 2
Logical Station 3
Logical Port 1
Logical Port 2
Logical Station 4
These arbitrary logical numbers can match physical or configurable numbers, but this correspondence is not required. Thus, a logical station number assigned to represent a device can differ from the configured address for the device. For example, a device with a network address of 10 can be logical station 1. In the same way, a number assigned to represent a port need not correspond to the actual physical port number. COM2, for example, can be logical port 1.
The number you assign to a device (the logical station number) is tied to the number you assign to represent the port through which communications with the device occurs (the logical port number). No logical station number assigned to a device can match the station number of another device for a given protocol type. The logical port number you assign to represent a port can match a logical station number assigned to a device (you can have logical port 1 and logical station 1), but device numbers for a given protocol type must be unique (you cannot assign logical station number 1 to two different devices).
Logical Port Numbers Tied to Logical Device Numbers
First Device, Logical Port 1 is Logical Station 1 Logical Port 1
FactoryLinkCOM Computer Port COM Port
Second Device, Logical Port 1 is Logical Station 2 Third Device, Logical Port 1 is Logical Station 3 First Device, Logical Port 2 is Logical Station 4
Logical Port 2
R ETRIEVING
AND
TRANSFERRING D ATA
EDI uses read and write operations to retrieve and transfer data between FactoryLink and devices for which a communication path is established. You configure requests for read and write operations in one device protocol-specific configuration table designed for defining both types of operations. Each protocol module in the FactoryLink device interface base set supports triggered read operations and write operations. Selected protocol modules support unsolicited read operations. See the Supported Read and Write Operations table for protocol-specific read and write information. Triggered Read Operations In a triggered read operation, data is retrieved from a device and transferred to the real-time database. First, FactoryLink requests data from specific locations (registers or addresses) in a device. Next, the data is read, then stored in FactoryLink as tags.
FactoryLink requests data from a device. The device returns the requested data to FactoryLink.
EDI triggered read operations occur based on either timed intervals or events. In both types of operations, a change in the value of a trigger tag prompts FactoryLink to read data in specific locations in a device. Timed-Interval Read a read request based on a timed interval instructs FactoryLink to collect data at defined intervals, such as several times a minute or at a given time each day. Event-Driven Read a read request based on an event instructs FactoryLink to collect data only when a defined event occurs, such as when an operator selects a new graphic window or when an alarm condition occurs. Unsolicited Read Operations FactoryLink does not initiate the reading of data in an unsolicited read operation. Instead, it accepts certain types of data from specified locations in a device, then stores the data in the real-time database. FactoryLink recognizes the device data because its starting address and length match an identical address and expected data length configured in FactoryLink.
The device sends data to FactoryLink. FactoryLink ensures the incoming data matches configuration parameters. FactoryLink stores the data in the realtime database.
Write Operations In a write operation, data is retrieved from the real-time database and transferred to a device. FactoryLink reads the values of tags, then writes them to specific locations in a device.
These types of EDI write operations can occur: block and exception. Block Write in a block write request, a change in the value of a trigger tag prompts FactoryLink to write one or more tag values to specific device locations. Exception Write in an exception write request, a change in the value of a tag prompts FactoryLink to write that value to a specific device location. The difference between these operations is the way each is triggered. Both operations write data from FactoryLink to the device when a trigger is activated. For a block write, the trigger is a tag defined specifically for prompting a write operation. For an exception write, the trigger is the change in status of the tag to be written. The following table lists the read and write operations available for each protocol-specific module in the base set.
Protocol Module
Write Operations
Allen-Bradley General Electric Fanuc General Purpose Interface Modicon Modbus Modicon Modbus Plus OMRON Host Link Protocol Siemens CP525 Siemens Sinec H1 Square D Texas Instruments TIWAY/Point-to-Point
FOR
EDI
Tag names for tags in EDI are essentially the same as in any other FactoryLink task. The one difference is EDI does not recognize brackets in tag names as FactoryLink array specifiers. Brackets can be used, however. An array is a FactoryLink tag name assigned to a group of tags.
TRIGGERING C ONSIDERATIONS
The way in which read and write operations are triggered can determine the success or failure of an application. The success of the application can depend on triggering rates due to the way these operations are processed. Read and write operations use a limited area of the computers system memory shared by a protocol module and the EDI module. If your configuration includes more than one protocol module, a separate area of shared memory is associated with each module. The diagram below, and subsequent diagrams in this section, depict shared memory as a mailbox. Mail can go into and be retrieved from a mailbox. In the same way, outgoing messages from EDI and incoming responses from a device are filtered through shared memory.
Shared Memory with Each Protocol Module
The concept of shared memory is significant for these reasons: Because a shared memory area is associated with each protocol module or instance of a protocol module, you can run multiple protocol modules simultaneously with a certain amount of independence. Communicating with Multiple Devices on page 10 provides details about how this works. Because the capacity of a shared memory area is limited (like a mailbox), when the memory fills up, nothing more can be added to it. A shared memory area fills up when the protocol module does not process data as fast as EDI requests it, or when the protocol module sends requested data to EDI faster than EDI can process it. This discussion focuses on how the filling up of shared memory affects triggering rates in your server application. When you understand how shared memory works, you can apply this knowledge and use work-around triggering schemes (these are described later on) that result in an efficiently operating application. How Shared Memory Works The diagram below shows how EDI and a protocol module use shared memory when sending commands to and receiving responses from a device. Steps 1 through 5 are defined further on the following pages.
EDI puts command into shared memory Protocol module gets command, sends to device, and command is cleared from memory Device returns acknowledgment and data Protocol module puts data into shared memory EDI gets data, writes it to FactoryLink, and response is cleared from memory
EDI puts a data transfer command into shared memory. This command could contain a request to read data in the device and write it to FactoryLink or to write data stored in FactoryLink to the device. As EDI puts data into shared memory, it begins to fill up.
EDI Puts Command into Shared Memory
The protocol module, which constantly monitors shared memory for communications from EDI, gets the command from shared memory and sends it to the device. The command and any associated data, once the protocol module retrieves it, is cleared from shared memory.
If the operation is successful, the device returns the following: The requested data to the protocol module (if the command is for a read operation). An acknowledgment that the command was received and processed (if the command is for a write operation). If the operation is not successful, the device returns an error message. If the device does not respond, the protocol module will indicate a time-out error.
Device Returns Requested Data or Acknowledgment
The protocol module matches the incoming data to the command and puts the requested data, acknowledgment, or error message into shared memory.
When EDI finds a response to the data transfer command in shared memory, EDI retrieves the data, writes it to the real-time database, and then clears the devices response from memory.
EDI Gets Data, Writes It to FactoryLink, Clears Data and Command
How to Avoid Filling Up Shared Memory When numerous commands for read or write operations are being sent to a device within the same time frame (as can happen when an application is configured to trigger data too frequently), shared memory fills up. Likewise, when a device sends blocks of data requested by EDI back to FactoryLink in intervals too close together, shared memory fills up.
If shared memory fills up with messages to or from a device, no room is left in shared memory for other messages that might need to use the shared memory area.
To avoid filling up shared memory (overtriggering), define read and write operations using two specific methods. One involves daisy chaining the operations by assigning identical tag names for two types of digital tags (a trigger and a state tag) in the protocol-specific configuration table for the operation. The other method is similar, but identical tags are defined across tables to create a self-triggering effect. See Efficient Triggering on page 168 for more information.
C ONFIGURATION C ONSIDERATIONS
This section provides guidelines and examples to help you determine which types of read and write operations work best for specific situations and how to configure these operations to optimize FactoryLinks performance. Triggered Read Operations A triggered read operation is the best choice for reading data that changes frequently and at regular intervals. Use the following types of triggered read operations under the described circumstances. Interval If an application does not require all data to be collected at the same time, you can increase FactoryLinks efficiency by configuring several read tables, each reading at a different interval and only as often as necessary. For example, configure a table with timed reads that occur every five seconds for tags with values that change frequently, and every thirty seconds for tags with values that change less frequently. Event If events occur infrequently, you can reduce the number of requests sent between FactoryLink and the device and increase overall efficiency by configuring several read tables, each triggered by a different event. For example, If a graphic screen contains a large number of variables that are only useful on that screen (that is, they are not alarm points and are not being trended), you could configure a separate read table containing only these variables. FactoryLink will only read the tags on that screen when the operator triggers this read table by selecting the graphic screen for viewing. Using this technique can reduce traffic between FactoryLink and the device when an application has a large number of graphic screens. As another example of an event-driven read operation, you could configure FactoryLink to trigger a particular read table only if an alarm condition occurs. The tag that detects the alarm condition can trigger EDI to collect additional information from the device about the status of related processes.
Unsolicited Read Operations An unsolicited read operation, if supported by the protocol module, is the best choice for reading values that change infrequently and at unspecified intervals. For example, you might design an application to notify FactoryLink whenever an unexpected event occurs, such as an electrical unit power surge of a specified magnitude. When defining unsolicited read operations, consider the frequency in which unsolicited read operations are expected to execute. Unsolicited reads occurring too frequently and at irregular intervals can cause excessive traffic leading to a jam on the communication link. See the table Supported Read and Write Operations to determine whether unsolicited read operations are supported by the protocol module you are using. Write Operations Use the following types of write operations under the described circumstances. Block If an application writes values of tags that change frequently to the device, use a block write operation because FactoryLink sends the minimum number of write commands necessary to write the specified data. A block write is most efficient when your application writes a group of tags at one time to the device (for example, when the application requires a new recipe). Exception If an application writes values of tags that change infrequently to the device or if the application only needs to change one value at a time (for example, a new user-entered setpoint), use an exception write operation. For each exception write, EDI sends one packet of data per tag. See the discussion of data organization in Optimization Guidelines on page 36 for more information about data packets.
Triggering Guidelines Keeping in mind the discussion of read and write configuration considerations beginning on page 33, consider the following triggering guidelines: Only Trigger When Data is Needed how often you choose to trigger data to be read or written depends on several factors, including how often the data changes and whether the changes occur regularly, the timing of the events in the application, and the types of reads and write operations the device supports. Only Trigger When on Specific Screens trigger data needed more often at faster rates while slowing down other requests. Daisy Chain Tables link or daisy chain tables together in several loops by defining tags in such a way that the completion of one task triggers the beginning of another. The discussion of cascaded tables in Chapter 8, Efficient Triggering provides additional details. Combine Unsolicited Read Operations if each item in a list of data is being read from a device as an unsolicited read operation, consider merging the data into a block read request. You can then trigger the block read operation with an unsolicited forced write of a digital tag to the device. If each item on the list is configured as an unsolicited read, a separate data packet is sent for each item. If each list item is combined and put into a block read, however, fewer data packets are required and the transmission time is quicker.
Note
See Supported Read and Write Operations table to determine whether the protocol module you are using supports unsolicited read operations.
Optimization Guidelines Consider the following guidelines for configuring read and write operations to make the most efficient use of EDIs capabilities.
Tip
Application Design Tips and Techniques on page 127 provides more information about some of these guidelines plus other information. Program the Device for Efficiency careful planning in the programming of the devices in your configuration can enhance the performance of your application and optimize transmission speed. Refer to the device manufacturers documentation for device programming guidelines. Logically Group Table Entries FactoryLink creates messages to send to a device based on entries in a read or write table. Table entries are grouped according to the following criteria: logical station number, FactoryLink data type, device data type, and address. The messages FactoryLink creates are based on the results of the grouped table entries. For maximum efficiency, attempt to group read and write table entries the same way in which FactoryLink internally groups them. Another benefit of organizing table entries as FactoryLink does is it makes debugging your application easier. If an error occurs in table processing, you can readily identify the source of the error. Keep Addresses Contiguous whenever possible, keep addresses contiguous to reduce the number of messages FactoryLink must generate to process a table. For a discussion and examples of how FactoryLink groups data being read from or written to contiguous addresses into messages, see Grouping of Data on page 128. Recognize Processing Differences in Read and Write Operations FactoryLink processes data being read differently than it processes data being written. In a read table, when you specify selected addresses of like data type to be read that are close in proximity and configure tag names for like tags in which to store the data read from these addresses, FactoryLink actually reads the entire range of addresses even those you do not specifically define. Only the data FactoryLink is configured to store is saved. In a write table, when you specify tag names for tags to be written to selected addresses, only the specified data is written. For a discussion and examples of the differences in read and write table processing, see Processing Differences in Read and Write Operations on page 130.
Define Multiple Operations in a Single Table because the EDI task can process multiple messages destined for a single device simultaneously, you can define several read or write operations (within reason and based on the architecture of the application) in a single table for maximum throughput. Each additional table you define results in more messages the task must generate. The more messages generated, the longer the read or write operation takes to complete. Keep Disabled Messages Together put entries that might need to be disabled periodically in their own table, separate from entries that will not be disabled. Prioritize Read and Write Operations the priority of read and write operations can affect the speed and performance of an application. EDI places each read and write table you define into a user-specified priority queue. You can assign a high priority to the most critical data to be read or written. EDI gives preference to high priority read and write tables if it receives more than one table at a time. For more information about how you can use priority queues to improve an applications performance, see Specifying Priority on page 133.
C ABLE C ONNECTION
The signals in the cable supplied with the device might differ from those required by FactoryLink. Although the device might communicate with your computer without a problem using the supplied cable, once FactoryLink communications are attempted communications can fail. This failure is, in most instances (unless a leased-line modem is being used), because handshaking signals need to be tied back. This can be effectively done using a modem eliminator, also called a null modem cable, which contains handshaking tie-backs. See Configuring Communication Paths on page 57 for more information about cable connections as well as serial communications reference material.
Chapter 3
Chapter 4
Signal
Description
RTS
Request to send. When the data terminal equipment (DTE) has something to transmit, it sends an RTS to the data communications equipment (DCE). For FactoryLink communications with devices other than modems, RTS and CTS must be tied together. Clear to send. CTS is a response to an RTS. After the DTE sends the RTS to the DCE, the DCE returns a CTS to the DTE, indicating the DTE device can begin transmitting. Before FactoryLink can receive data from a device, the device must first transmit a CTS signal to FactoryLink. Carrier detect (CD) is also referred to as DCD or received line signal detect (RLSD). When the DCE receives a signal from a remote modem, it sends a CD signal to notify the DTE. This CD signal indicating the DCE has received a signal from a remote modem is required by FactoryLink. Before data can be received or transmitted, the DCE must first set the CD signal high in the DTE. Data set ready. When the DCE is powered on, it sends this signal to the DTE to indicate it is ready to transmit. Data terminal ready. When the DTE is powered on, it sends this signal to the DCE. If the port is open, this signal remains set high.
CTS
CD
DSR DTR
DB-25
Description
Signal Name
2 3 4 5 6 7 8 20
Transmit Data Receive Data Request to Send Clear to Send Dataset Ready Signal Ground Carrier Detect Data Terminal Ready
1 14
2 15
3 16
4 17
5 18
6 19
7 20
8 21
9 22
10 23
11 24
12 25
13
DB-9
Description
Signal Name
3 2 7 8 6 5 1 4
Transmit Data Receive Data Request to Send Clear to Send Dataset Ready Signal Ground Carrier Detect Data Terminal Ready
C ABLE D ESCRIPTION
AND
D IAGRAMS
The FactoryLink connectors TxD signal must be connected to the device connectors RxD signal and vice versa. The current (before version 6.6.0) configuration requires that the RTS signal be tied back to the CTS signal for FactoryLink and the device connectors. DSR, CD, and DTR must also be tied back to both connectors. The following diagram illustrates a current (before 6.6.0) RS-232 cable connection. Because handshaking signals are tied back, this cable does not rely on the device for proper signal manipulation.
RS-232 Cable to Device
FactoryLink Port
Shield
Using COMWiz the port can be configured to not need handshaking signals, allowing the use of a standard null modem cable or a minimum 3-wire cable, shown in the following graphics, if the external device supports it.
FactoryLink Port
Shield
FactoryLink Port
Shield
The diagram below illustrates an RS-422 cable connection between the FactoryLink computers serial port and a device. The RS-422 is an electrical rather than a mechanical interface standard and specifies no pin assignments.
FactoryLink Port
Shield
The next diagram illustrates an RS-485 two-wire cable connection between FactoryLink computers serial port and a device. The RS-485 is an electrical rather than a mechanical interface standard and specifies no pin assignments.
RS-485 Two Wire Cable to Device
FactoryLink Port
Shield
Device + -
COM
W ORKSHEET
FOR
C ABLE C ONNECTIONS
Use the following worksheet when establishing cable connections for the devices. Complete a worksheet for each device in the configuration.
FactoryLink Port_____ Pin ___ ___ ___ ___ ___ ___ ___ Signal Device Port_____ Signal Pin ___ ___ ___ ___ ___ ___ ___
Note
Some examples of worksheet entries are provided for your reference. Pin numbers can vary, however, and the ones shown in these examples will not necessarily match the numbers in your FactoryLink and device hardware configuration. To complete the worksheet, perform the following steps: 1 Note the number of pins on the cable connectors for the FactoryLink station port and the device port. Record this information in the blanks next to FactoryLink Port and Device Port at the top of the worksheet. For example, write 25-pin next to FactoryLink Port and 9-pin next to Device Port.
2 Record the pin numbers corresponding to the cable on the FactoryLink side of the configuration in the blanks next to the appropriate signals on the worksheet. For example, write 2 in the first row of the first Pin column to indicate the FactoryLink TXD is 2. 3 Enter the pin numbers corresponding to the cable on the device side of the configuration in the blanks next to the appropriate signals. For example, write 2 in first row of the second Pin column to indicate the device RxD is 2. 4 Create the cable from the resulting configuration.
U SING C OM W IZ
TO
C ONFIGURE P ORTS
ComWiz is a utility that allows you to configure your serial communications to allow a variety of handshaking and interface options for serial communications with your external device. It can be accessed by selecting the Com Port Setup in Configuration Explorer. If you are converting an application that was created in a version of FactoryLink prior to 6.6, or if you want to use the standard FactoryLink cable, you do not need to use COMWiz. The default settings for COMWiz are for use with this cable. Any changes that you make while using COMWiz are stored in your server application (FLAPP) and are saved with this application. When your saved application file is restored, the serial options that you selected are restored with it. If at anytime during the configuration you want to change the settings back to default, click the Standard button on the COMPort Extended Setup and the settings for the standard cable will be restored.
Note
COMWiz was designed to allow you the freedom to configure the type of handshaking that allows you to use various cable connections and RS-422/485 ports. You must keep in mind the communication requirements for the external devices with which FactoryLink will be communicating. Because not all external devices support all types of communication options available, research and test all applications before committing to a specific setup. The COMPort Extended Setup dialog box, shown in the two graphics below, allows you to configure each serial port on your FactoryLink station. Most of the options are described at the end of this section. Expand Device Interfaces to select recommended configurations for specific PLC types. Not all of the PLCs supported by FactoryLink are this dialog box. More PLC types will be added in future releases. This dialog box is found at Device Interfaces > COM Port Setup.
Handshaking Choices
Application Directory
Selecting a Driver
You can select a driver, and the setup tool automatically selects the recommended port configuration for that driver.
The following table lists each COMWiz parameter, its value(s), and describes how the parameter works.
Parameter Values Description
cts_out
On Off
Specifies whether the clear-to-send (CTS) signal is monitored for output flow control. If this member is TRUE and CTS is disabled, the output is suspended until CTS is resent.
Parameter
Values
Description
dsr_out
On Off
Specifies whether the data-set-ready (DSR) signal is monitored for output flow control. If this member is TRUE and DSR is disabled, output is suspended until DSR is resent. Specifies whether the communications driver is sensitive to the state of the DSR signal. If the member is TRUE, the driver ignores any bytes received, unless the DSR modem input line is high. Disables the DTR line when the device is opened and leaves it disabled. Enables the DTR line when the device is opened and leaves it on. Enables DTR handshaking. Disables the RTS line when the device is opened and leaves it disabled. Enables the RTS line when the device is opened and leaves it enabled. Enables RTS handshaking. The driver raises the RTS line when the type-ahead (input) buffer is less than one-half full and lowers the RTS line when the buffer is more than three-quarters full. Specifies that the RTS line will be high if bytes are available for transmission. After all buffered bytes are sent, the RTS line will be low. Specifies whether to use xon/xoff flow control on output. Specifies whether to use xon/xoff flow control on output.
dsr_in
On Off
dtr_control
rts_control
Toggle
x_out x_in
On Off On Off
Parameter
Values
Description
Numeric value (decimal) of character to send for XON. Typical is 17 (decimal). Numeric value (decimal) of character to send for XOFF. Typical is 19 (decimal). Specifies the minimum number of bytes allowed in the input buffer before the XON character is sent. Specifies the maximum number of bytes allowed in the input buffer before the XOFF character is sent. The maximum number of bytes allowed is calculated by subtracting this value from the size, in bytes, of the input buffer. Typical settings are x_off when the buffer is 75% full and x_on when the buffer is 25% empty.
Chapter 5
5 | CONFIGURING COMMUNICATION PATHS Identifying Protocol Types and Defining Logical Ports
AND
You configure FactoryLink to recognize the protocol module and each logical port through which communications will occur by completing the External Device Definition table, found at Device Interfaces > External Device Definition. For FactoryLink to recognize the protocol module, you specify a protocol-specific identifier. For FactoryLink to recognize each physical port that is part of the system configuration, you create a logical definition for each port. To identify the protocol and define the logical ports, perform the following steps: If your FactoryLink application will communicate with devices via several different ports, complete the Logical Station Worksheet.
Note
This worksheet can be used with any protocol module in the FactoryLink 7.5 base set. It can be especially helpful, however, in documenting numbering schemes for hardware configurations that not only include multiple ports but that also use one or more network interface modules to route communications to devices across a proprietary network. Allen-Bradley and Square D are examples of protocol modules that provide this type of support. A sample worksheet is provided in which the Allen-Bradley protocol module is used as an example. Create the logical port definitions for each physical port. See Creating the Logical Port Definitions on page 58 for details. Creating the Logical Port Definitions The following steps describe the procedure for creating a logical port definition for each port that is part of the system configuration. 1 Ensure the current domain selection is Shared in the Configuration Explorer 2 Choose External Device Definition. The External Device Definition table is displayed. Using the field descriptions provided below, complete a row in the table for each port to which a device in the configuration is connected. Sample entries are provided in Sample External Device Definition Table Entries on page 60.
CONFIGURING COMMUNICATION PATHS | 5 Identifying Protocol Types and Defining Logical Ports
Logical Port
Enter a unique number to logically represent each port to which a device is connected.
Valid Entry: 0 - 999
Physical Port
For each logical port number, enter a number referencing the physical port to which the device is connected.
Valid Entry: 0 - 32
Serial Ports for each logical port, enter the number matching the physical port to which the device is connected. Be sure to enter an appropriate number for your hardware configuration. If the system unit does not contain an expansion card, not all valid port number entries can be used.
Device Name
For each logical port, enter the protocol-specific acronym that identifies the protocol module communicating through the port. Entry Definition AB Allen-Bradley GENE General Electric ASYN General Purpose Interface MODP Modbus Plus MBUS Modicon Modbus OMRN OMRON Host Link SIEM Siemens CP525 H1MP Siemens H1 SQRD Square D TI Texas Instruments TIWAY
Function
For each logical port, identify the type of communications. For the protocol modules in the FactoryLink 7.5 base set, specify SYSCOM for serial communications or ETHERNET for Ethernet communications, if supported for the protocol module.
Valid Entry: Ctrl+K
Comment
5 | CONFIGURING COMMUNICATION PATHS Identifying Protocol Types and Defining Logical Ports
When each logical port is defined, click the Save icon to validate the information. Create logical station definitions for each logical port. These define the paths to be used for communications between each device and FactoryLink. For details, see Creating Logical Station Definitions on page 61. Sample External Device Definition Table Entries A completed table for two COM ports might resemble the sample table below.
Logical Port 0
FactoryLink COM Computer Port COM Port
Logical Port 1 This sample table configures two instances of the Allen-Bradley protocol module communicating via two system unit COM ports in a Windows operating environment. Logical port 0 identifies COM1 and Logical port 1 identifies COM2.
To show the correspondence between the External Device Definition table and the Logical Station table and how the entries you make in these tables create the logical station definitions, the Modicon Modbus Plus protocol module is used as an example. The following steps describe how to create logical station definitions for each logical port that communicates with a device. 1 Ensure the current domain selection is Shared in the Configuration Explorer. 2 Choose the option for the protocol module you are configuring. 3 Display the Logical Station Control table by clicking on its title bar in the display of all tables. 4 On the Logical Station Control table, you define pertinent information about each communication path to a device so FactoryLink can establish communications with all the devices. This information varies from one protocol module to another. In general, however, a definition for a communication path can include (but is not limited to) the following information: The logical port number, to create the association with the External Device Definition table
For the port represented by the logical port number, communication protocols (such as baud rate and parity) that match protocols defined in the device The amount of time the protocol module communicating through the port will wait to receive a device response to a read or write request before timing out A particular communication mode, internal data path specified on a proprietary network card, or other needed protocol-specific parameter for the port Message tags to which values can be written to indicate communications errors associated with the port 5 See your completed logical station worksheet to help you identify logical ports and associate them with logical stations. The table below lists references to instructions for creating the logical station definitions for each protocol-specific module in the base set. To create the definitions for the protocol module your devices will communicate with, go to the specified page in the appropriate reference.
Note
Before going to the section describing the Logical Station table entries for the protocol module you are configuring, you may want to first review the procedure for creating logical station definitions for Modbus Plus in Modicon Modbus Plus Logical Station Table on page 64. The information in the sections describing the table entries for the other protocol modules is presented in a reference format and will not necessarily show the associations and results of the entries as the information in this section does.
Protocol Module
Go To
Allen-Bradley General ElectricFanuc General Purpose Interface Modicon Modbus Modicon Modbus Plus
Configuring the Logical Station Control Table on page 158 Configuring the Logical Station Control Table on page 199 Configuring the Logical Station Control Table on page 219 Configuring the Logical Station Control Table on page 313 Configuring the Logical Station Control Table on page 292
OMRON Host Link Protocol Configuring the Logical Station Control Table on page 331 Siemens CP525 Siemens Sinec H1 Square D Texas Instruments TIWAY/Point-to-Point Configuring the Logical Station Control Table on page 381 Configuring the Logical Station Control Table on page 405 Configuring the Logical Station Control Table on page 452 Before completing the Logical Station table, you must complete the Unilink Setup table. For details, see Configuring the Unilink Setup Table on page 523. Once the Unilink Setup table is completed, see Configuring the Logical Station Control Table on page 526.
6 When the Logical Station Control table is complete, click the Save icon to validate the data. The Tag Definition dialog box displays for each specified tag name that is not defined elsewhere in FactoryLink.
7 For each tag name, choose the type of data to be stored in the tag for Type and accept the default of Shared for domain. See the tags field description for the valid data types. 8 Select the row for the logical port you are configuring. Then display the Logical Station Information table. The logical port number displays in the Logical Port field. On the Logical Station Information table, you define logical station numbers which identify the address and device type for each device in the configuration and long analog tags to which error codes for particular devices (logical stations) will be written. For some protocol modules, the Logical Station Information table requires other entries, such as limits or additional device-specific addressing information. 9 Complete a row in the table for each device to communicate through this logical port. 10 Click the Save icon to validate the data. The Tag Definition dialog box displays for each specified tag name that is not defined elsewhere in FactoryLink. 11 For each tag name, choose the type of data to be stored in the tag for Type and accept the default of Shared for domain. See the tags field description for the valid data types. 12 To configure another logical port, return to the Logical Station Control table and repeat the appropriate steps. 13 When you are ready to define the read and write operations expected to occur between this logical port and the associated Modbus Plus devices configured as logical stations, see Reading Data from a Device on page 73 or Writing Data to a Device on page 97. Modicon Modbus Plus Logical Station Table The following steps describe the procedure for completing the Modicon Modbus Plus Logical Station table. 1 Using the following field descriptions, complete a row in the Logical Station Control table for each logical port defined in the External Device Definition table you want to
include in the communication path. Sample entries are provided in Sample Logical Station Table Entries on page 69.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port field, to represent a particular communication path to a Modbus Plus device.
Valid Entry: previously defined logical port number
The External Device Definition table logical port definition identifies the port to EDI as a designated Modbus Plus port. The Logical Station Control table logical port definition links with the EDI port definition to further define communication parameters.
Adapter Number
Enter either 0 or 1 to logically represent the SA85 host adapter. The default is 0. In a Windows environment, the Adapter Number entry must match the /n parameter of the line for the SA85 device assignment (MBHOST.SYS for Windows) in the CONFIG.SYS file.
Valid Entry: 0, 1
Optionally, enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
Enter a number from 1 to 8 to represent the number of communications channels to be used for command/response transactions between the SA85 card and the Modbus Plus device this
logical port represents. Be sure the number of master paths you define does not conflict with paths defined for other software (such as the device programming software) using the card. Data master paths provide avenues for getting data back and forth between FactoryLink and Modicon devices. Each additional path you define increases the throughput of messages to and from a device. When multiple channels are open to a single device, the transactions required for a read or write operation can occur simultaneously over several paths rather than one at a time as they would over only one path.
Valid Entry: numeric value from 1 - 8 (default = 3)
Define each data slave (DS) path to this logical port over which unsolicited data can be transmitted from a device to FactoryLink. For instance, to define six data slave paths, specify YES in six DSn fields. Be sure the number of slave paths you define does not conflict with paths defined for other software using the card. For more information about data slave paths, refer to the Modicon Modbus Plus Network Programming Guide.
Valid Entry: yes, no (default = no)
2 When the Logical Station Control table is complete, click the Save icon to validate the data. The Tag Definition dialog box displays for each specified tag name that is not defined elsewhere in FactoryLink. 3 For each tag name, choose MESSAGE for Type and accept the default of Shared for domain. 4 Select the row for the logical port you are configuring. 5 Display the Logical Station Information table. 6 On the Logical Station Information table, you define the following information: Long analog tags to which error codes for particular devices (logical stations) will be written For each logical port, logical station numbers that identify the device address, network router address, and the device type for each device in the configuration
The number of consecutive times FactoryLink will send a read or write command to a logical station after an unsuccessful transmission attempt, the amount of time FactoryLink will wait before retrying a transmission attempt, and tag names for tags reporting the success or failure of these attempts 7 Using the following field descriptions, complete a row in the table for each device to communicate through this logical port.
LSTA Status Analog Tag
Optionally, enter a tag name for an analog tag to receive communication error codes associated with this device (logical station).
Valid Entry: tag name Valid Data Type: analog
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. This number must be unique among all Modicon devices across all ports. You will later enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry: unique numeric value from 0 - 999 (default = 0)
PLC Type
Define the type of Modbus Plus device to which communications are to be directed: 984 or 984BITWRITE for devices that support the mask write function (A120, A130, A141, A145, 685E, 785E, AT4, and VM4).
Valid Entry: Ctrl+K (default = 984)
Enter the physical address of the Modbus Plus device. This address must match the configured address of the equipment.
Valid Entry: numeric value from 0 - 64 (default = 0)
Define the Modbus Plus network address of each router or bridge to a logical station. Up to four routers can be defined for each physical station.
Valid Entry: numeric value from 0 - 64 (default = 0)
Enter a number between 1 and 300 that defines the length of time, in hundredths of a second, the protocol module will wait to receive a device response to a read or write command before timing out. The timeout occurs after each retry of the transmission attempt (as specified in the Number of Retries field). If you specify 300 for Response Timeout 0.01 sec and 3 for Number of Retries, for example, a three-second timeout occurs after each retry. If the device does not respond after the third retry, transmission attempts cease for that command. If all three retries are exhausted, the total duration of the transmission attempt is nine seconds.
Valid Entry: numeric value from 1 - 300 (default = 1)
Number of Retries
Define the maximum number of consecutive times a read or write command will be sent to a logical station after an unsuccessful first transmission attempt.
Valid Entry: numeric value from 0 - 10 (default = 3)
Optionally, define a tag name for a digital tag to receive the status of communication attempts for this logical station. If the value of this tag is 0 (OFF), the communication attempt to this logical station was successful. If the value of this tag is 1 (ON), the communication attempt to this logical station failed. You can also specify this tag name in the Alarm Supervisor for an alarm tag to indicate a communications failure.
Valid Entry: tag name Valid Data Type: digital
Optionally, define a tag name for a message tag to receive text describing the status of communication attempts for this logical station. This tag works in conjunction with the LSTA Failure Digital Tag field to display a meaningful error message for the operator on the Alarm Supervisor screen.
Valid Entry: tag name Valid Data Type: message
Comment
The Tag Definition dialog box displays for each specified tag name that is not defined elsewhere in FactoryLink. 9 For each tag name, choose the type of data to be stored in the tag for Type and accept the default of Shared for domain. See the tags field description for the valid data types. 10 To configure another logical port, return to the Logical Station Control table and repeat the appropriate steps. 11 When you are ready to define the read and write operations expected to occur between this logical port and the associated Modbus Plus devices configured as logical stations, see Reading Data from a Device on page 73 or Writing Data to a Device on page 97. Sample Logical Station Table Entries When all Logical Station Control table information is specified, the table resembles the following example:
In this example, logical port 0 of the SA85 card configured as 0 in the CONFIG.SYS file has six allocated data master paths over which command/response transactions for
read and write operations can travel. Four data slave paths are available for transmission of unsolicited data from any device communicating with FactoryLink through this logical port (in this instance, logical station 0 defined on the Logical Station Information table). Additionally, the EDI task will store communications error messages associated with this logical port in a message tag, MODP_LPORT0_MSG. When all Logical Station Information table information is specified, the table resembles the following example:
Figure 5-1 Sample Logical Station Information Table
In this example, the analog tag MODP_STATION0_STATUS is configured to hold port errors for logical station 0, which communicates with a Modicon 984 device at address 10.30.31. After an initial unsuccessful attempt to transmit an instruction for a read or write operation, FactoryLink makes up to three more one-second attempts (three total seconds) then ceases trying to send the data to the device. All attempts to transmit instructions to the device are documented in a pair of tags, MODP_LS0_FAIL_DIG and MODP_LS0_FAIL_MSG, that work together to provide a meaningful operator message for display purposes.
TABLE E NTRIES
FOR
S AMPLE WORKSHEET
The External Device Definition and Logical Station table entries corresponding to the sample configuration recorded on the logical station worksheet are shown in the following figure.
First, you assign a logical port number to each physical port in the External Device Definition table.
Then, you further define these logical ports in the Logical Station Control table.
Chapter 6
After setting up the communication paths in the External Device Definition and Logical Station configuration tables, the next step is to define information about the data to be read from and written to the devices. This chapter describes how to define a request to read locations in a device and store the information read in FactoryLink tags. See Writing Data to a Device on page 97 for procedures describing how to define a request to write the values of FactoryLink tags to locations in a device. To define a read request, you configure the Read/Write table which consists of two tables: Read/Write Control and Read/Write Information. Like the Logical Station tables, the Read/Write tables are part of the cascading protocol-specific tables displayed when you choose the option for the protocol module you are configuring in the Device Interfaces folder.
Note
The Modicon Modbus Plus protocol module is used as an example throughout this chapter to describe basic read operation concepts. For protocol-specific information, see the appropriate reference chapter. When filling out a read request, you specify in which tags the device data read during the operation will be stored. For each tag, you specify: The tag name assigned to the FactoryLink tags storing the data The logical station from which the data will be read The register address in that logical station containing the data to be read Depending on the protocol module used, you can configure two types of read requests, triggered and unsolicited, or a combination of these.
...the task reads each defined address... ...then stores the value read in the tag specified to receive the value.
...the EDI task is prepared to recognize the data structure of the value at each defined address according to its data type. When FactoryLink receives a value that matches the criteria, it stores the value in the specified tag.
6 | READING DATA FROM A DEVICE Defining the Table Type and Triggers
D EFINING
THE
TABLE TYPE
AND
TRIGGERS
To begin configuring a read table, you fill out the Read/Write Control table. You assign a name for the table, identify the table type, and define one or more trigger tags if the table is for a triggered read operation. The following steps describe how to fill out the Read/Write Control table. 1 Ensure the current domain selected is Shared in the Configuration Explorer. 2 Open the Read/Write Control table. 3 For each read request you want transmitted over a device communication path, add a table entry. The information you provide depends on the type of request you are defining. See the appropriate section for the type of read request you are defining: Triggered Read Request below Unsolicited Read Request on page 79 Combination Read Request on page 80 Triggered Read Request To fill out a control table for a triggered read request, perform the following steps. 1 Using the following field descriptions, add a table entry for each triggered read request you want to define. Leave all other fields blank. Sample entries are provided in Sample Triggered Read Request on page 92.
Table Name
Give this read request a name. Define one request (table) per line and do not include spaces in the name. You can define as many requests as available memory allows. Try to make the table name reflective of the operation it represents. When the Block Read Trigger tag defined for this table is forced to 1, or on, the tag prompts FactoryLink to process this read table and any other read table with a Table Name entry associated with the same trigger.
Valid Entry: alphanumeric string of up to 16 characters
Unsolicited Read
For EDI to interpret this operation as a triggered block read, accept the default of NO.
READING DATA FROM A DEVICE | 6 Defining the Table Type and Triggers
Valid Entry: no
Enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first.
Valid Entry: 1 - 4 (default=1)
Enter a tag name for a digital tag to initiate a block read of the register addresses specified in the associated Read/Write Information table. When this tags value is forced to 1 (ON), FactoryLink reads the addresses. A Block Read Trigger is required to prompt FactoryLink to process this table for a triggered read operation. The tag you use for the Block Read Trigger can also be defined in another FactoryLink task. For example, you could define a digital tag in the Event or Interval Timer, Math and Logic, or Client Builder, and assign the same tag name to a Block Read Trigger tag. When the tags value changes to 1 (as the result of a math operation or a defined event taking place, for example), it prompts an EDI task read operation. For efficient performance in larger applications, you can define a Block Read Trigger tag as a Block Read State tag, causing a daisy-chain effect within one table or across several tables. When you give identical names to a Block Read State and a Block Read Trigger tag, the completion of one read operation triggers the start of another. For a description and examples of how to create a daisy-chain read operation, see Chapter 8, Application Design Tips and Techniques.
Valid Entry: tag name Valid Data Type: digital
6 | READING DATA FROM A DEVICE Defining the Table Type and Triggers
Optionally, enter a tag name for a digital tag to disable a block read of the tags specified in this table. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set. This tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To re-enable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Valid Entry: tag name Valid Data Type: digital
Note: If you are defining a Block Read Complete or Block Read State tag to be used for more than one logical port, create a separate table for each port.
Block Read Complete
Optionally, enter a tag name for a digital tag the EDI task forces to 1 (ON), when it starts up, and each time it receives and processes a read request from a device protocol module. After the tags defined in the associated Read/Write Information table are updated in the FactoryLink database, EDI forces the tag to 1 again.
Valid Entry: tag name Valid Data Type: digital
Optionally, enter a tag name for a digital tag the EDI task forces to 1 (ON), when it starts up, and each time it receives and processes a read request from a device protocol module. During EDI's transmission of the request, it sets the tag to 0 (OFF). After the tags defined in the associated Read/Write Information table are updated in the FactoryLink database, EDI forces the tag back to 1.
Valid Entry: tag name Valid Data Type: digital
2 When you have finished filling out the information on this table, click the Save icon. The Tag Definition dialog box displays for each specified tag name that is not defined elsewhere in FactoryLink. 3 For each tag name, choose DIGITAL for Type and accept the default of Shared for domain.
READING DATA FROM A DEVICE | 6 Defining the Table Type and Triggers
4 Define the data to be read and the target addresses in the Read/Write Information table. See Specifying What to Read and Where to Store It on page 81. Unsolicited Read Request To fill out a control table for an unsolicited read request, perform the following steps. 1 Using the following field descriptions, add a table entry for each unsolicited read request you want to define. Leave all other fields blank. Sample entries are provided in Sample Unsolicited Read Request on page 94.
Table Name
Assign a name to this read request. Define one request (table) per line and do not include spaces in the name. You can define as many requests as available memory allows. Try to make the table name reflective of the operation it represents.
Valid Entry: alphanumeric string of up to 16 characters
Unsolicited Read
Enter YES. EDI will interpret this operation as an unsolicited read and emulate the devices addressing structure based on entries you make in the Read/Write Information table. The data is written to the tag specified in the Read/Write Information table. The change-status indicator is set only if the tags value has changed since the most recent write to the tag. If the current value of the tag is equal to the value being written, the change-status indicator is unaffected. If, however, the value being written to the tag is a new value, it will overwrite the existing value and the tags change-status indicator will be set to 1 (ON).
Valid Entry: yes
Accept the default of NO, which indicates this is not an exception write.
Valid Entry: no
Accept the default of 1. This field is ignored for unsolicited read operations.
Valid Entry: 1
2 When you have finished filling out the information on this table, click the Save icon. 3 Define the data to be read and the target addresses in the Read/Write Information table. See Specifying What to Read and Where to Store It on page 81 for details.
6 | READING DATA FROM A DEVICE Defining the Table Type and Triggers
Combination Read Request In some cases, you may want to configure a read operation to execute in two ways: by a trigger and by unsolicited processing. For example, you could configure a combination triggered block read and unsolicited read table if you want to read a register and write its value to a tag upon start up and thereafter, only update that tag when the register value changes. To configure a combination read request, perform the following steps. 1 Fill out a control table with the information described in Triggered Read Request on page 76, but enter YES in the Unsolicited Read field instead of NO. 2 When you have finished filling out the information on this table, click the Save icon. 3 Define the data to be read and the target addresses in the Read/Write Information table. See Specifying What to Read and Where to Store It on page 81 for details.
READING DATA FROM A DEVICE | 6 Specifying What to Read and Where to Store It
S PECIFYING W HAT
TO
R EAD
AND
W HERE
TO
S TORE I T
Once the Read/Write Control table is complete, fill out the Read/Write Information table. Here, you indicate what data is transferred from the device to FactoryLink during the operation, and where the data is stored in the FactoryLink database. Each address that will be read from a memory location in a device is represented by a separate tag name for a tag in the FactoryLink database. For a read request, you add an entry in the Read/Write Information table for each tag to which data will be written when the operation is executed. The following steps describe how to fill out the Read/Write Information table. 1 On the Read/Write Control table, select the row for the read request you are defining. Click Next to display the Read/Write Information table. The information you provide in this table depends on the type of register to be accessed and the type of data to be read. See the data type reference table below to determine where to go for instructions on filling out this table for your particular application. Each section listed in the table provides sample table entries for a specific type of read request. Additional sample entries are provided in Sample Read Requests on page 92. 2 When you have finished defining all the register addresses to be read and all the FactoryLink database tags to which the data is to be written, click the Save icon to validate the data. The Tag Definition dialog box displays for each specified tag name that is not defined elsewhere in FactoryLink. 3 For each tag name, choose the type of data to be stored in the tag for Type and accept the default of Shared for domain. See the tags field description for the valid data types. 4 To configure another read request, return to the Read/Write Control table and complete the appropriate steps. 5 When all read requests are complete, go to the Read/Write Control table and define the write requests required for your application. See Writing Data to a Device on page 97 for details.
6 | READING DATA FROM A DEVICE Specifying What to Read and Where to Store It
Register Type
Holding
Read Holding or Input Register, Store in Analog Tag on page 83 Read Holding or Input Register, Store in Digital Tag on page 85 Read Holding Register, Store in Floating-Point or Long Analog Tag on page 86 Read Holding Register, Store in Floating-Point or Long Analog Tag on page 86 Read Holding Register, Store in Message Tag on page 87 Read Holding or Input Register, Store in Analog Tag on page 83 Read Holding or Input Register, Store in Digital Tag on page 85 Read Coil or Input Status Register, Store in Digital Tag on page 88 Read Coil or Input Status Register, Store in Digital Tag on page 88 Read Memory Register, Store in Analog Tag on page 89 Read Statistics Word, Store in Analog Tag on page 90 Read Statistics Word, Store in Analog Tag on page 90
Input
Analog Digital
Note: For the maximum number of contiguous registers that can be included in a single block read message for each supported register type, see the Maximum Contiguous Registers in a Single Message. table.
READING DATA FROM A DEVICE | 6 Specifying What to Read and Where to Store It
A read table should not contain more than the maximum number of contiguous registers allowed for a single message accessing a type of register. The maximum number allowed varies from one register type to the next. If more than the maximum number of contiguous register addresses are defined, multiple messages are generated for the operation. For example, if a block read table for a holding register in a 984 device contains entries that access contiguous addresses from 100 to 127, two messages are generated. The first message reads the first 125 addresses (addresses 100 to 124). The second message reads addresses 125 through 127. The following table lists the maximum number of contiguous registers included in a single block read message for each supported register type.
Maximum Contiguous Registers in a Single Message.
Type of Register
Read Holding or Input Register, Store in Analog Tag To fill out an information table for a request to read a holding register or an input register and store the data in an analog tag, perform the following steps. Using the following field descriptions, add a table entry for each tag in which data read from the device will be stored when the operation executes.
Tag Name
Specify a tag name for an analog tag in which FactoryLink will store the data read from the device.
6 | READING DATA FROM A DEVICE Specifying What to Read and Where to Store It
The Logical Station number defined on the Read/Write Information table must match...
...the Logical Station number defined on the Logical Station information table for this devices Logical Port number.
Logical Station
Enter the number representing the device from which the data is to be read. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory where the value to be stored in this tag is located. Do not include the register address prefix (4 for holding and 3 for input) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for holding register address 400001, just enter 1; for input register address 345902, enter 45902.
Valid Entry: 1 - 65535
Specify the type of register to be read as HREG for holding register or IREG for input register.
Valid Entry: HREG, IREG
READING DATA FROM A DEVICE | 6 Specifying What to Read and Where to Store It
Read Holding or Input Register, Store in Digital Tag To fill out an information table for a request to read a holding register or an input register and store the data in a digital tag, perform the following. Using the following field descriptions, add a table entry for each tag in which data read from the device will be stored when the operation executes.
Tag Name
Specify a tag name for a digital tag in which FactoryLink will store the data read from the device.
Valid Entry: tag name Valid Data Type: digital
Logical Station
Enter the number representing the device from which the data is to be read. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory where the value to be stored in this tag is located. Do not include the register address prefix (4 for holding and 3 for input) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for holding register address 400001, just enter 1; for input register address 345902, enter 45902.
Valid Entry: 1 - 65535
Specify the bit offset within a register word that contains the value to be read. Bit 1 is the most significant bit (MSB) and bit 16 is the least significant bit (LSB).
MSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 LSB 16
Valid Entry: 1 - 16
Data Type
Specify the type of register to be read as HREG for holding register or IREG for input register.
Valid Entry: HREG, IREG
6 | READING DATA FROM A DEVICE Specifying What to Read and Where to Store It
Read Holding Register, Store in Floating-Point or Long Analog Tag To fill out an information table for a request to read a holding register and store the data in a floating-point or long analog tag, perform the following. Using the following field descriptions, add a table entry for each tag in which data read from the device will be stored when the operation executes.
Tag Name
Specify a tag name for a floating-point or long analog tag in which FactoryLink will store the data read from the device.
Valid Entry: tag name Valid Data Type: float, longana
Logical Station
Enter the number representing the device from which the data is to be read. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory where the value to be stored in this tag is located. Floating-point or long analog tag types are addressed in pairs. The first register in the pair contains the high order word; the second register contains the low order word. Enter the address for only the starting register in a register pair. The companion register is implied. Try to maintain consistency when using register addresses for floating-point and long analog tag types. Adopt either an odd or even starting register sequence and maintain that sequence. For example, 1, 3, 5, 7, 9,... or 2, 4, 6, 8, 10,.... Do not include the register address prefix (4) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for holding register address 400001, just enter 1.
Valid Entry: 1 - 65535
READING DATA FROM A DEVICE | 6 Specifying What to Read and Where to Store It
Read Holding Register, Store in Message Tag To fill out an information table for a request to read a holding register and store the data in a message tag, perform the following. Using the following field descriptions, add a table entry for each tag in which data read from the device will be stored when the operation executes.
Tag Name
Specify a tag name for a message tag in which FactoryLink will store the data read from the device.
Valid Entry: tag name Valid Data Type: message
Logical Station
Enter the number representing the device from which the data is to be read. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory where the value to be stored in this tag is located. Enter the first address in the group of registers containing the message characters. The number of registers to be read is defined in the Bit Offset/MSG Length field of this table. Do not include the register address prefix (4) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for holding register address 400001, just enter 1.
Valid Entry: 1 - 65535
Specify the number of bytes in the devices memory containing the message. These bytes, starting from the location specified in the previous field, Reg. Address, are read and the values are stored in the Tag Name message tag as raw binary data. FactoryLink does not perform verification on these bytes to ensure the data is printable ASCII.
Valid Entry: 1 - 80
Data Type
6 | READING DATA FROM A DEVICE Specifying What to Read and Where to Store It
Read Coil or Input Status Register, Store in Digital Tag To fill out an information table for a request to read a coil or input status register and store the data in a digital tag, perform the following. Using the following field descriptions, add a table entry for each tag in which data read from the device will be stored when the operation executes.
Tag Name
Specify a tag name for a digital tag in which FactoryLink will store the data read from the device.
Valid Entry: tag name Valid Data Type: digital
Logical Station
Enter the number representing the device from which the data is to be read. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory where the value to be stored in this tag is located. Do not include the register address prefix (0 for coil and 3 for input status) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for coil address 023451, enter 23451; for input status register address 300001, just enter 1.
Valid Entry: 1 - 65535
Specify the type of register to be read as COIL for coil register or INP for input status register.
Valid Entry: COIL, INP
READING DATA FROM A DEVICE | 6 Specifying What to Read and Where to Store It
The Logical Station number defined on the Read/Write Information table must match...
...the Logical Station number defined on the Logical Station Information table...
Read Memory Register, Store in Analog Tag To fill out an information table for a request to read a memory register and store the data in an analog tag, perform the following steps. Using the following field descriptions, add a table entry for each tag in which data read from the device will be stored when the operation executes.
Tag Name
Specify a tag name for an analog tag in which FactoryLink will store the data read from the device.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter the number representing the device from which the data is to be read. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory where the value to be stored in this tag is located. Do not include the register address prefix (6) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for memory address 600001, just enter 1.
Valid Entry: 1 - 65535
6 | READING DATA FROM A DEVICE Specifying What to Read and Where to Store It
Specify the type of register to be read as XMEMnn where nn is a numeric value from 1 to 10.
Valid Entry: XMEM1 - XMEM10
Read Statistics Word, Store in Analog Tag To fill out an information table for a request to read the high or low bytes of a network statistics word and store the data in an analog tag, perform the following.
Note
Reference the high and low bytes of a statistics word in one block read table to ensure the information retrieved for a single word is synchronized. To access the high and low bytes of a single word, enter the same register address twice for two separate analog tags. Specify STATHI in the Data Type field for the first tag and STATLO for the second tag. To create a single word value, use FactoryLink Math & Logic to OR the words together. Using the following field descriptions, add a table entry for each tag in which data read from the device will be stored when the operation executes.
Tag Name
Specify a tag name for an analog tag in which FactoryLink will store the data read from the device.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter the number representing the device from which the data is to be read. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory where the value to be stored in this tag is located.
Valid Entry: 1 - 65535
READING DATA FROM A DEVICE | 6 Specifying What to Read and Where to Store It
Specify STATHI to access a high byte of a statistics word and STATLO to access a low byte. Refer to the IBM documentation for Modbus Plus network-based statistics word assignments.
Valid Entry: STATHI, STATLO
Read Global Data Word, Store in Analog Tag To fill out an information table for a request to read a global data word and store the data in an analog tag, perform the following. Using the following field descriptions, add a table entry for each tag in which data read from the device will be stored when the operation executes.
Tag Name
Specify a tag name for an analog tag in which FactoryLink will store the data read from the device.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter the number representing the device from which the data is to be read. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory where the value to be stored in this tag is located. The first global data word received is always assumed to be word 1, the second is word 2, and so on. If you specify a register address larger than the total number of global data words that will actually be received, an error is generated.
Valid Entry: 1 - 32
In this example, the READ table is configured as follows: When the value of the digital Block Read Trigger tag MODP_READ_TRIGGER is 1, FactoryLink reads the configured register address and writes its value to the tag configured for this table (in the Read/Write Information table). The block read priority, which is set automatically if you do not enter a value, is set to the default of 1, the highest priority. When the value of the digital tag MODP_READ_DISABLE is 1, FactoryLink disregards the trigger tag, MODP_READ_TRIGGER, and does not process the READ table. Once FactoryLink reads the data and writes it to the tag defined to receive it (HOLD_MSG1 in the Read/Write Information table), FactoryLink forces a value of 1 to the digital Block Read State tag, MODP_READ_STATE, and to the Block
Read Complete tag, MODP_READ_COMPLETE. During the read operation, MODP_READ_STATE is set to 0.
Sample Read/Write Information Table for Triggered Read
In this example, when the READ table is triggered by MODP_READ_TRIGGER, FactoryLink reads holding registers 200 through 230 in the device configured as logical station 0, then writes the values read into a message tag, HOLD_MSG1.
How This Triggered Block Read Request Works
When the value of MODP_READ_TRIGGER is 1, FactoryLink processes the table, READ.
Sample Unsolicited Read Request This section provides descriptions of some possible Read/Write Control and Read/Write Information table entries for an unsolicited read request.
Sample Read/Write Control Table for Unsolicited Read
In this example, the UNSOL_READ table is configured to accept unsolicited data of the data type specified on the corresponding Read/Write Information table from the specified addresses associated with these entries. The only required user entries for an unsolicited read request on the Read/Write Control table are Table Name and Unsolicited Read. The entries shown in the above for Exception Write, Block Read Priority, and Block Write Priority are system defaults.
In this example, FactoryLink reads the incoming data upon its arrival then stores it in a message tag, HOLD_MSG1.
How This Unsolicited Read Request Works
When FactoryLink receives data from holding registers 200 through 230 in the device configured as logical station 0, it processes the table, UNSOL_READ.
FactoryLink reads the data then stores it in the message tag, HOLD_MSG1.
Chapter 7
This chapter describes how to define a request to write the values of FactoryLink tags to specified locations in a device. See Reading Data from a Device on page 73 for procedures describing how to define a request to read specified locations in a device and store the values read in FactoryLink tags. To define a write request, you configure the Read/Write table, which consists of two tables: Read/Write Control and Read/Write Information. Like the Logical Station tables, the Read/Write tables are part of the cascading protocol-specific tables displayed when you choose the option for the protocol module you are configuring from the Configuration Explorer.
Note
The Modicon Modbus Plus protocol module is used as an example throughout this chapter to describe basic write operation concepts. For protocol-specific information, see the appropriate reference chapter. When filling out a write request, you specify the following basic information: The tag name assigned to the FactoryLink tag containing the data to be written The logical station to which the data will be written The register address in that logical station to which the data will be written FactoryLink can write data to a device in two ways: as a block write when prompted by a digital trigger tag or as an exception write when prompted by the data changing.
...the task writes the value of each defined tag... ...to the defined address.
A disable trigger disables an exception write table. Once a table is re-enabled, you can use a block write trigger to update any values in the device that changed while the table was disabled. Neither are required unless you plan to periodically disable the table, but both are required if you do plan to disable the table.
When the value of each defined tag changes, the EDI task writes it...
D EFINING
THE
TABLE TYPE
AND
TRIGGERS
To begin configuring a write table, you fill out the Read/Write Control table. Here, you give the table a name, identify the table type, and define any needed trigger tags. The following steps describe how to fill out the Read/Write Control table. 1 Ensure the current domain selection is Shared in the Configuration Explorer. 2 Open the Read/Write Control table. 3 For each write request you want transmitted over a device communication path, add a table entry. The information you provide depends on the type of request you are defining. See the appropriate section for the type of write request you are defining: Block write request on page 100 Exception write request on page 103 Combination write request page 105 Block Write Request To fill out a control table for a block write request, perform the following steps. 1 Using the following field descriptions, add a table entry for each block write request you want to define. Leave all other fields blank. Sample entries are provided in Sample Triggered Block Write Request on page 117.
Table Name
Assign a name to this write request. Define one request (table) per line and do not include spaces in the name. You can define as many requests as available memory allows. Try to make the table name reflective of the operation it represents. When the Block Write Trigger tag defined for this table is forced to 1, or on, the tag prompts FactoryLink to process this write table and any other write table with a Table Name entry associated with the same trigger.
Valid Entry: alphanumeric string of up to 16 characters
Unsolicited Read
Exception Write
Specify how the EDI task will write the values of tags containing information to be transmitted to a device. You define these tags the task will read from the FactoryLink database and then write to the device in the Read/Write Information table. To indicate this is not an exception write, accept the default of NO.
Valid Entry: no
Enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of all write requests, block and exception. If EDI receives two requests at the same time, it processes the request with the highest priority first.
Valid Entry: 1 - 4 (default = 1)
Enter a tag name for a digital tag to initiate a block write of the tag values specified in the associated Read/Write Information table to the register addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values. A Block Write Trigger is required to prompt FactoryLink to process this table for a write operation. The tag you use for the Block Write Trigger can also be defined in another FactoryLink task. For example, you could define a digital tag in the Event or Interval Timer, Math and Logic, or Client Builder, and assign the same tag name to a Block Write Trigger tag. When the tags value changes to 1 (as the result of a math operation or a defined event taking place, for example), it prompts an EDI task write operation. For efficient performance in larger applications, you can define a Block Write Trigger tag as a Block Write State tag, causing a daisy-chain effect within one table or across several tables. When you give identical names to a Block Write State and a Block Write Trigger tag, the completion of one write operation triggers the start of another. For a description and examples of how to create a daisy-chain write operation, see Chapter 8, Application Design Tips and Techniques.
Valid Entry: tag name Valid Data Type: digital
Optionally, enter a tag name for a digital tag to disable a block write to the device addresses specified in this table. When this tags value is forced to 1, the write operation is not executed, even when the block write trigger is set. This tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To re-enable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1.
Valid Entry: tag name Valid Data Type: digital
Optionally, enter a tag name for a digital tag the EDI task forces to 1 (ON), when it starts up, and each time it receives and processes a write request from a protocol module. After the data is written to the device, EDI forces the tag to 1 again. If you are defining a Block Write Complete tag to be used for more than one logical port, create a separate table for each port.
Valid Entry: tag name Valid Data Type: digital
Optionally, enter a tag name for a digital tag the EDI task forces to 1 (ON), when it starts up, and each time it receives and processes a write request from a protocol module. During EDI's transmission of the request, it sets the tag to 0 (OFF). After the data is written to the device, EDI force-writes the tag back to 1. If you are defining a Block Write State tag to be used for more than one logical port, create a separate table for each port.
Valid Entry: tag name Valid Data Type: digital
2 When you have finished filling out the information on this table, click the Save icon. The Tag Definition dialog box displays for each specified tag name that is not defined elsewhere in FactoryLink. 3 For each tag name, choose DIGITAL for Type and accept the default of Shared for domain.
4 Define the data to be written and the target addresses in the Read/Write Information table. See Specifying What to Write and Where to Write It on page 106 for details. Exception Write Request In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device. To fill out a control table for an exception write request, perform the following steps. 1 Using the following field descriptions, add a table entry for each exception write request you want to define. Leave all other fields blank. Sample entries are provided in Sample Exception Write Request on page 120.
Table Name
Give this write request a name. Define one request (table) per line and do not include spaces in the name. You can define as many requests as available memory allows. Try to make the table name reflective of the operation it represents. When the values of the tags you define in the associated Read/Write Information table change, FactoryLink processes this exception write table and any other exception write table with a Table Name entry associated with the same tags.
For the task to write tag values only when those values change, enter YES.
Valid Entry: yes
Accept the default of 1. This field is ignored for exception write operations.
Valid Entry: 1
Note
If you plan to periodically disable this table, both a Block Write Trigger and a Block Write Disable tag are required. See the following field descriptions. If you do not plan to disable this table, do not define either of these tags.
Block Write Trigger
Enter a tag name for a digital tag to trigger the table once it is disabled then subsequently re-enabled by a Block Write Disable tag.
Valid Entry: tag name Valid Data Type: digital
Enter a tag name for a digital tag to temporarily disable this table. When the value of this tag is 1, it disables an exception write of the defined tags to the device addresses specified in the Read/Write Information table. When the tag's value is set to 0 again, the table is re-enabled. Once a table is re-enabled, a Block Write Trigger tag can be used to write any values that changed while the table was disabled.
Valid Entry: tag name Valid Data Type: digital
2 When you have finished filling out the information on this table, click the Save icon. The Tag Definition dialog box displays for each specified tag name that is not defined elsewhere in FactoryLink. 3 For each tag name, choose DIGITAL for Type and accept the default of Shared for domain. 4 Define the data to be written and the target addresses in the Read/Write Information table. See Specifying What to Write and Where to Write It on page 106 for details.
Combination Write Request In some cases, you may want to configure a write operation to execute in two ways: by a digital trigger tag and by exception processing. For example, you could configure a combination block write and exception write table if you want to write the current value of a tag to a register address in the device upon start up and thereafter, only write the tags value to the device when it changes. Sample table entries are provided in Sample Combination Write Request on page 123. To configure a combination write request, perform the following steps. 1 Fill out a control table with the information described inBlock Write Request on page 100, but enter YES in the Exception Write field instead of NO. 2 When you have finished filling out the information on this table, click the Save icon. 3 Define the data to be written and the target addresses in the Read/Write Information table. See Specifying What to Write and Where to Write It on page 106 for details.
S PECIFYING W HAT
TO
W RITE
AND
W HERE
TO
W RITE I T
Once the Read/Write Control table is complete, fill out the Read/Write Information table. Here, you indicate the data to be written to the device during the operation, and to which register addresses it will be written. The data to be written is represented by one or more tags in the FactoryLink database. For a write request, you add an entry in the Read/Write Information table for each tag to be written when the operation is executed. The following steps describe how to fill out the Read/Write Information table. 1 On the Read/Write Control table, select the row for the write request you are defining. Display the Read/Write Information table. The information you provide in this table depends on the type of register to be accessed and the type of data to be written. See the Register and FactoryLink Data Type Configuration Reference table to determine where to go for instructions on filling out this table for your particular application. Each section listed in the table provides sample table entries for a specific type of write request. Additional sample entries are provided in Sample Write Requests on page 117. 2 When you have finished defining all the FactoryLink database tags and the register addresses to which their contents are to be written, click the Save icon to validate the data. The Tag Definition dialog box displays for each specified tag name that is not defined elsewhere in FactoryLink. 3 For each tag name, choose the type of data to be stored in the tag for Type and accept the default of Shared for domain. See the tags field description for the valid data types. 4 To configure another write request, go to the Read/Write Control table and complete the write requests
Register Type
Holding
Analog Digital
Write Analog Tag Value to Holding Register on page 108 Write Digital Tag Value to Holding Register on page 109 To set or clear bits, Set Bits in Holding Register Using Mask Write on page 111
Write Floating-Point or Long Analog Tag Value to Holding Register on page 112 Write Floating-Point or Long Analog Tag Value to Holding Register on page 112 Write Message Tag Value to Holding Register on page 113 Write Digital Tag Value to Coil Register on page 114 Write Analog Tag Value to Memory Register on page 115 Write Analog Tag Value to Global Data Word on page 116
Note: For the maximum number of contiguous registers that can be included in a single block write message for each supported register type, see the Maximum Contiguous Registers in a Single Message table. A write table should not contain more than the maximum number of contiguous registers allowed for a single message accessing a type of register. The maximum number allowed varies from one register type to the next. If more than the maximum number of contiguous register addresses are defined, multiple messages are generated for the operation.
The following table lists the maximum number of contiguous registers included in a single block write message for each supported register type.
Maximum Contiguous Registers in a Single Message
Type of Register
800 100 1 exception write for mask operation 32 global data words 1 exception write for clear statistics operation 100
Write Analog Tag Value to Holding Register To fill out an information table for a request to write the value of an analog tag to a holding register, perform the following. Using the following field descriptions, add a table entry for each tag to be written and define the register addresses to receive each tag value when the operation executes.
Tag Name
Specify a tag name for an analog tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter the number representing the device to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
The Logical Station number defined on the Read/Write Information table must match...
...the Logical Station number defined on the Logical Station Information table for this devices Logical Port number.
Reg. Address
Enter the register address in the devices memory to which the tag value will be written. Do not include the register address prefix (4) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for holding register address 400001, just enter 1.
Valid Entry: 1 - 65535
Specify HREG as the type of register to which the tag value will be written.
Valid Entry: HREG
Write Digital Tag Value to Holding Register To fill out an information table for a request to write the value of a digital tag to a holding register, perform the following. Using the following field descriptions, add a table entry for each tag to be written and define the register addresses to receive each tag value when the operation executes.
When a digital tag is written to a holding register, two messages are sent to the device. The first message reads the entire holding register; the second message writes the new value to the specified bit.
Tag Name
Specify a tag name for a digital tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital
Logical Station
Enter the number representing the device to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory to which the tag value will be written. Do not include the register address prefix (4) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for holding register address 400001, just enter 1.
Valid Entry: 1 - 65535
Specify the bit offset within a register word to which the tag value will be written. Bit 1 is the most significant bit (MSB) and bit 16 the least significant bit (LSB).
MSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 LSB 16
Valid Entry: 1 - 16
Data Type
Specify HREG as the type of register to which the tag value will be written.
Valid Entry: HREG
Go back to step 2 on page 106. Set Bits in Holding Register Using Mask Write In devices that support this operation, a mask write sets or clears bits within a holding register. A mask write is sent to the device as an exception write operation; therefore, it generates a single write message. The following Modicon model types support mask write operations: A120, A130, A141, A145, 685E, 785E, AT4, and VM4. To fill out an information table for a request to send a mask write to a holding register, perform the following steps. Using the following field descriptions, add a table entry for each for each bit to be set or cleared when the value of any bit defined in the table changes. Each bit is referenced by a separate tag name on the Read/Write Information table.
Tag Name
Specify a tag name for a digital tag containing a value to be written to the device. When a digital tag is written to a holding register, two messages are sent to the device. The first message reads the entire holding register; the second one writes the new value to the specified bit.
Valid Entry: tag name Valid Data Type: digital
Logical Station
Enter the number representing the device to which the tag value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address of the word containing the bit to be set or cleared. Do not include the register address prefix (4) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for holding register address 400001, just enter 1.
Valid Entry: 1 - 65535
Specify the bit within the register word that will change as a result of the mask write. Bit 1 is the most significant bit (MSB) and 16 the least significant bit (LSB).
MSB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 LSB 16
Valid Entry: 1 - 16
Data Type
Go back to step 2 on page 106. Write Floating-Point or Long Analog Tag Value to Holding Register To fill out an information table for a request to write the value of a floating-point or long analog tag to a holding register, perform the following steps. Using the following field descriptions, add a table entry for each tag to be written and define the register addresses to receive each tag value when the operation executes.
Tag Name
Specify a tag name for a floating-point or a long analog tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: float, longana
Logical Station
Enter the number representing the device to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory to which the tag value will be written. Floating-point or long analog tag types are addressed in pairs. The first register in the pair contains the high order word; the second register contains the low order word. Enter the address for only the starting register in a register pair. The companion register is implied.
Try to maintain consistency when using register addresses for floating-point and long analog tag types. Adopt either an odd or even starting register sequence and maintain that sequence. For example, 1, 3, 5, 7, 9,... or 2, 4, 6, 8, 10,.... Do not include the register address prefix (4) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for holding register address 400001, just enter 1.
Valid Entry: 1 - 65535
Specify HREG as the type of register to which the tag value will be written.
Valid Entry: HREG
Write Message Tag Value to Holding Register To fill out an information table for a request to write the value of a message tag to a holding register, perform the following. Using the following field descriptions, add a table entry for each tag to be written and define the register addresses to receive each tag value when the operation executes.
Tag Name
Specify a tag name for a message tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: message
Logical Station
Enter the number representing the device to which the tags value will be written.This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory to which the tag value will be written. Enter the first address in the group of registers to which the value will be written. The number of registers to which the data is to be written is defined in the Bit Offset/MSG Length field of this table.
Do not include the register address prefix (4) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for holding register address 400001, just enter 1.
Valid Entry: 1 - 65535
Specify the number of bytes in the devices memory to which the tag value will be written.
Valid Entry: 1 - 80
Specify HREG as the type of register to which the tag value will be written.
Valid Entry: HREG
Write Digital Tag Value to Coil Register To fill out an information table for a request to write the value of a digital tag to a coil register, perform the following. Using the following field descriptions, add a table entry for each tag to be written and define the register addresses to receive each tag value when the operation executes.
Tag Name
Specify a tag name for a digital tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital
Logical Station
Enter the number representing the device to which the tags value will be written.This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory to which the tag value will be written. Do not include the register address prefix (0) or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for coil address 023451, enter 23451.
Valid Entry: 1 - 65535
Specify COIL as the type of register to which the tag value will be written.
Valid Entry: COIL
Write Analog Tag Value to Memory Register To fill out an information table for a request to write the value of an analog tag to a memory register, perform the following. Using the following field descriptions, add a table entry for each tag to be written and define the register addresses to receive each tag value when the operation executes.
Tag Name
Specify a tag name for an analog tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter the number representing the device to which the data in this tag will be written.This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory to which the tag value will be written. Do not include the register address prefix, 6, or leading zeros. The prefix indicates the register type, which is specified in the Data Type field. For example, for memory address 600001, just enter 1.
Valid Entry: 1 - 65535
Specify the type of register to which the tag value will be written as XMEMnn where nn is a numeric value from 1 to 10.
Valid Entry: XMEM1 - XMEM10
Write Analog Tag Value to Global Data Word To fill out an information table for a request to write the value of an analog tag to a global data word, perform the following.
Note
Although global data is considered contiguous in block write tables, you can define register addresses that do not appear contiguous on the information table. For example, if you specify register address 1, 5, 7, 20, and 25 for a write operation, a message is generated for registers 1 through 25. A value of 0 is stored for those registers within the range that do not appear in the read/write information table. Using the following field descriptions, add a table entry for each tag to be written and define the register addresses to receive each tag value when the operation executes.
Tag Name
Specify a tag name for an analog tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter the number representing the device to which the data in this tag will be written.This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg. Address
Enter the register address in the devices memory to which the tag value will be written. The first global data word received is always assumed to be word 1, the second is word 2, and so on. If you specify a register address larger than the total number of global data words that will actually be received, an error is generated.
Valid Entry: 1 - 32
In this example, the WRITE table is configured in the following way: When the value of the digital Block Write Trigger tag MODP_WRITE_TRIGGER is 1, FactoryLink reads the tag configured for this table (in the Read/Write Information table) and writes its value to the configured register address. The block write priority, which is set automatically if you do not enter a value, is set to the default of 1, the highest priority. When the value of the digital tag MODP_WRITE_DISABLE is 1, FactoryLink disregards the trigger tag, MODP_WRITE_TRIGGER, and does not process the WRITE table.
Once FactoryLink writes the tag values, it forces a value of 1 to the digital Block Write State tag, MODP_WRITE_STATE, and to the Block Write Complete tag, MODP_WRITE_COMPLETE. During the read operation, MODP_WRITE_STATE is set to 0.
Read/Write Information Table for Triggered Block Write
In this example, when the WRITE block write table is triggered by MODP_WRITE_TRIGGER, FactoryLink writes the value of a message tag, HOLD_MSG1, to holding registers 200 through 230 in the device configured as logical station 0.
FactoryLink writes the value of HOLD_MSG1... ...into 30 holding registers beginning with address 200.
Sample Exception Write Request This section provides descriptions of some possible Read/Write Control and Read/Write Information table entries for an exception write request.
Read/Write Control Table for Exception Write
In this example, the EXCEPTION table is configured to read the tag configured for this table (in the Read/Write Information table) and write its value to the configured register address. FactoryLink, however, will only perform this operation when the tags value changes. The table is disabled when the Block Write Disable tag, MODP_EXCEPTION_DISABLE, is 1 and the Block Write Trigger tag, MODP_EXCEPTION_TRIGGER is 0. The table is re-enabled when MODP_EXCEPTION_DISABLE is 0.
In this example, whenever the value of the digital tag HOLD_DIG1 changes, FactoryLink processes the EXCEPTION table. This table writes the value of HOLD_DIG1 to holding register 140 in the device configured as logical station 0. If the table is disabled then re-enabled and MODP_EXCEPTION_TRIGGER is set to 1, holding register 140 is updated with the value of HOLD_DIG1 if the value has changed since the table was disabled.
Because this is an exception write table, when the value of HOLD_DIG1 changes... ...FactoryLink writes its value into holding register address 140.
When the value of MODP_EXCEPTION_ TRIGGER is 1 and the table is disabled, FactoryLink writes the value of HOLD_DIG1 if it has changed since the table was disabled.
Sample Combination Write Request This section provides descriptions of some possible Read/Write Control and Read/Write Information table entries for a combination write request.
Read/Write Control Table for Combination Write
In this example, the EXCEPTION table is configured in the following way: When FactoryLink starts up, MODP_EXCEPTION_TRIGGER will trigger FactoryLink to read the tag configured for this table (in the Read/Write Information table) and write its value to the configured register address. (The Block Write Disable tag, MODP_EXCEPTION_DISABLE, is not used in this table; therefore, its value remains 0.) After startup, FactoryLink only writes the tags value to the device when it changes.
In this example, when FactoryLink starts up and whenever the value of the analog tag HOLD_ANA1 changes, FactoryLink processes the EXCEPTION table. This table writes the value of HOLD_ANA1 to holding register address 200 in the device configured as logical station 0.
Because this is an exception write table... ... whenever the value of HOLD_ANA1 changes... ...FactoryLink writes its value into holding register address 200.
Chapter 8
Many of the configuration tables used in the examples throughout this section are for the Modbus Plus protocol module; others are for a fictitious protocol module called Widget. The concepts discussed, however, apply to all the protocol modules in the FactoryLink base set.
G ROUPING
OF
D ATA
Carefully consider the way in which you group data in a read or write table because it can determine the number of messages or packets of data FactoryLink needs to generate to complete the operation. The fewer messages FactoryLink must generate to process a table, the faster the table is processed. When grouping table entries, keep the following types of information together: Logical Stations keep data being read from or written to a particular logical station together; that is, for best results, do not define more than one logical station in a table. Data Types keep like data types (FactoryLink and protocol-specific) together. Any break in data type results in the generation of an additional packet. Contiguous Addresses keep data being read from or written to contiguous or near contiguous addresses together. For example, if the following conditions are met, FactoryLink can process a table in one message: The table only contains data of an amount not exceeding the maximum size the device can handle for one transmission. The data is stored in tags of the same FactoryLink data type. The data is of the same protocol-specific data type. The data is read from or written to contiguous addresses. The figures below illustrate tables in which all or some of these conditions are met.
Tip
Naturally, all conditions cannot be met for each table you define. If your goal is to minimize the number of messages generated, attempt to group read and write table entries the same way in which FactoryLink internally groups and processes them.
In the read table illustrated below, only conditions 1, 2, and 4 are met. To process this table, FactoryLink must generate two messages.
Read Operation Completed in Two Messages
FactoryLink would need to generate two messages to process this table: one to read the specified holding registers and another to read the memory registers.
8 | APPLICATION DESIGN TIPS AND TECHNIQUES Processing Differences in Read and Write Operations
P ROCESSING D IFFERENCES
IN
R EAD
AND
WRITE O PERATIONS
FactoryLink processes data being read differently than it processes data being written. The difference is in how FactoryLink handles the range of addresses specified for a single transmission. Processing of Read Operations Addresses defined in a read table that contain the same data type are read based on the specified range. FactoryLink reads the data at all addresses in the range (provided the range is within the limit for a single transmission) but only stores the data it needs. For example, the table illustrated below reads all addresses in the range 201 to 208 but only stores values read from addresses 201 and 208.
Table That Reads an Address Range but Stores Selected Values
FactoryLink generates one message to process this table. All data at addresses ranging from 201 to 208 are read, but only the values at addresses 201 and 208 are stored in tags.
APPLICATION DESIGN TIPS AND TECHNIQUES | 8 Processing Differences in Read and Write Operations
Note that, in the previous tables, the data FactoryLink reads is identical. Each table results in FactoryLink reading addresses 201 through 208. The difference in the tables is the data FactoryLink stores in tags. One table stores eight of the values read; the other table stores only two values, as shown below.
Both Tables Read the Same Addresses
Processing of Write Operations In a write table, addresses to which FactoryLink data is to be written are not accessed based on range unless the addresses are contiguous. If the same entries made in the read table Table That Reads an Address Range but Stores Selected Values are made in a write table, each row generates a separate message resulting in two messages being sent to the device, as shown in the first table of the following graphic. To send a message to write to addresses 201 through 208, you would need to define each address separately, as shown in the second table of the following graphic. Only contiguous groups of data (up to the maximum allowed by the device) are put in one message for a write operation.
8 | APPLICATION DESIGN TIPS AND TECHNIQUES Processing Differences in Read and Write Operations
S PECIFYING P RIORITY
The Read/Write Control table contains two columns for specifying the priority of block reads and block or exception writes: Block Read Priority and Block Write Priority. The priority of an operation can range from 1 to 4. These values correspond to four first-in/first-out (FIFO) priority queues which are set up in order of importance. Priority queue 1 has the highest priority. The queues are polled for tables according to the rank of the priority. The priority 1 queue is polled the most frequently and the priority 4 queue is polled the least frequently. Every table is eventually processed but the ones in the priority 4 queue are not processed as often as the tables in the priority 1 queue. All tables are placed by default in the priority 1 queue, which is appropriate in most cases. When an application contains a large number of tables, however, or when an exception write table contains tag names for rapidly changing tags, the priority 1 queue can fill up. To more evenly distribute tables across the four priority queues (thus reducing the priority 1 queues burden of handling all the pending I/O requests), you could assign priority 1 or 2 to tables containing more important data and priority 3 or 4 to tables containing less important data. Using this logic, you would, for instance, assign a high priority to an exception write table for an operation that acknowledges a loud annoying alarm, and a low priority to a block write table that downloads a batch recipe once a day.
O VERTRIGGERING
Overtriggering occurs when tables are being placed in shared memory faster than the EDI task or protocol module can pull the tables out and process them. When shared memory is full, an additional request to place a table in it results in the generation of an error message reporting an overtriggered state.
E FFICIENT TRIGGERING
To design your application for optimum performance and avoid overtriggering, consider the following triggering techniques. Timed The basic way to trigger a block read or write operation is with a timed tag. To define a timed trigger tag, enter a tag name for a Block Read Trigger or Block Write Trigger tag in the Read/Write Control table that matches the tag name of an interval timer tag (defined in the Interval Timer Information table). If you define this tag to change once per second, the table is placed in its shared memory once each second. Using timed tags as triggers is acceptable in most cases. An overtriggering situation can occur, however, if the trigger rate causes tables to be placed into shared memory faster than EDI or the protocol module can process them. A situation in which triggers overlap can occur as well. For example, suppose 5-second, a 15-second, and a 30-second timed tags are used to trigger various tables. Each table is placed in its designated queue every 30 seconds when the various triggers line up. The use of prime numbers quickly solves this problem, but a more effective method follows.
Note
The next two triggering methods, cascaded and self-triggered, can solve potential overtriggering situations in many cases. These methods, however, might not be appropriate for every read or write table you define. For instance, the timed method works best for tables that do not need to be updated at the highest possible rate. Cascaded The cascading of tables is an alternative to using timed triggers. It uses the Block Read State and Block Write State tags, which are reset to 1 after EDI processes the table. In the Read/Write Control table, if either the complete or state tag is defined as the trigger tag for the table in the row below the current table, that table is not triggered
and placed into shared memory until the preceding table is processed. If the table defined in the final row of the Read/Write Control table contains a tag name for a complete or state tag that matches the tag name of the trigger tag for the table defined in the first row, the completion of the final table triggers the first table. This endless loop results in the sequential processing of tables at an optimal rate. The following graphic illustrates a series of read tables created using the cascading technique. This type of table setup is also referred to as a daisy chain of tables.
Since r1_state is defined as the read trigger for the READ2 table, READ2 is the next table triggered.
When the READ1 table is processed, its state tag, r1_state, is forced back to 1.
A table is placed into shared memory only after the previous table is processed. If you use the Block Read State or Block Write State tag to perform the cascade, the successful processing of a table prior to the next table in the loop being triggered is not guaranteed; but overtriggering is prevented. Regardless of communications, the loop continues to process. If a table is to be placed into shared memory that has become full, the value of the state tag for that table does not change. Consequently, the next table is not triggered until room is available in shared memory for the current table. If you use the Block Read Complete or Block Write Complete tag to perform the cascade, the next table in the loop is placed into shared memory after the previous table is successfully communicated. In this case, successful processing of the transaction is guaranteed. (A time-out error occurring somewhere in the loop slows the performance of the cascade.)
A parallel between timed and cascaded triggering further illustrates this methods effectiveness. When the same timed trigger tag is used to trigger each of several tables defined in the Read/Write Control table, the tables are processed sequentially (starting with the beginning row of the table) on each occurrence of the trigger. Essentially, this scenario represents a timer-initiated cascade. If each instance of the timed tag is replaced by a tag that, when combined with other tags, creates the cascaded triggering effect, the fastest rate at which the tables can be placed into queues is naturally set by the tables themselves. For example, experimentation determines that when one 3.2-second timed digital tag is used as the same trigger tag for a number of tables, the application can trigger the tables without the overtrigger message appearing. Self-Triggered The use of self-triggered tables can increase the throughput and efficiency of read and write operations. In a self-triggered table, shown below, rather than a state or complete tag serving as a trigger for the next table in a cascaded loop, a state or complete tag serves as a Block Read Trigger or Block Write Trigger tag for the table in which it is defined. In other words, one tag name is defined for both the trigger tag and the complete or state tag in a single table: When FactoryLink starts, the complete or state tag is automatically set to 1. If you have defined this same tag as the trigger tag, the table is also placed in its priority queue at startup. When the complete or state tag is set again as a result of the operation, the cycle starts over and the table is placed in its priority queue again (because the complete or state tag is also the trigger). Overtriggering does not occur with a self-triggered table, because a table destined for a device is placed into shared memory only after the previous table is processed.
Note
The continuation of a cascaded loop or self-triggered table ceases if the Block Read Disable or Block Write Disable tag is set to 1. To restart after the disable tag is set to 0 again, the Block Read Trigger or Block Write Trigger tag must be reset to 1.
The following graphic illustrates the methodology of a self-triggered read table that uses the state tag to self trigger.
At FactoryLink startup, selftrig (as a state tag) is set to 1. As a trigger tag, selftrig also places the R_AGAIN table into queue 1 at startup. During processing of the R_AGAIN table, selftrig (as a state tag) is set to 0. If the table completes successfully (the data is read then stored in the tags defined in the Read/Write Information table), selftrig (as a state tag) is set to 1. When the state tag, selftrig, is set to 1, the table is placed into its queue again because selftrig is also the trigger tag. If selftrig (as a state tag) remains 0 because the table does not complete successfully, selftrig (as a trigger tag) never gets set for queuing the table again.
Chapter 9
This chapter contains information to help you prevent, identify, and correct problems with EDI and the device task. The sections included are listed below. For a series of flowcharts to assist you in identifying and solving problems with EDI, see EDI Flowcharts on page 140. For information about configuring and testing a simple triggered read table, see Verifying Proper Communications on page 144.
EDI F LOWCHARTS
Use the following flowcharts to identify and solve problems with your FactoryLink application configured for the EDI task.
Basic Troubleshooting
Common Errors
2 In the read table, define: A trigger tag (in the sample table, TEST_RTRIG) you will manually force to 1, or on, using the FactoryLink Real-Time Monitor, RTMON. A tag (in the sample table, VALUE1) to hold the value read from a known address in one of the devices in your configuration (in the sample table, address 140 in the device configured as logical station 1). You will watch the activity of this tag in RTMON to verify it is being updated.
3 In the write table, define a tag (in the sample table, VALUE2) to hold a value that will be
written to the same address configured in the read table. You will change this tags value in RTMON to prompt the processing of this table.
The next steps in the procedure involve the use of the FactoryLink Real-Time Monitor. For detailed instructions on using RTMON, see the Fundamentals Guide. 4 In RTMON, create a watch list containing the tags defined in the two tables (TEST_RTRIG, VALUE1, and VALUE2 in the sample tables). To create a watch list, use the Watch option on the RTMON Options menu. 5 Prompt the processing of the triggered read table by forcing a 1 to the read trigger using the Tag Input option on the RTMON Options menu. You can watch the value of the trigger change in the watch list.
When you force the read trigger to 1,... ...its value in the watch list changes from 0to 1.
When the read table is triggered, the value of VALUE1 is updated. If the value read differs from the tags current value, you will see it change in the watch list.
When the triggered read table is processed, the tag defined to hold the value read (VALUE1 in the sample table) is updated with the current value of the specified register address.
Use RTMON to prompt FactoryLink to process the exception write table. Change the value of the tag to be written (VALUE2 in the sample table) using the same option you used to trigger the read table, Tag Input. When you change the tag value in this way, the exception write table is processed and the value is written to the specified register address.
P ROGRAM A RGUMENTS
Argument Description
-C or -c
Clear change. This argument prevents the ping-pong effect of a read immediately after an exception write causing another exception write when a table is defined as both block read and exception write. Warning: Use this argument with extreme caution. Set IPC data size (# = 65535 to 1048576) set queue size (# = 128 to 4096)
Chapter 10
During normal operations and upon detecting an error condition, FactoryLink generates and displays messages for the EDI task, the device protocol module, and the devices in your server application configured for FactoryLink communications. These messages are briefly displayed on the Run-Time Manager screen. For FactoryLink to store system messages, you define database tags to which the messages are written when they occur. These database tags are configured in the Logical Station Control and Information tables. To view the stored messages, you configure these tags as graphic objects using Client Builder. This chapter explains the formats for system messages, as well as a descriptive list of the potential messages FactoryLink can generate and display for EDI at startup and while an application is running. For descriptions of protocol module messages, see the protocol-specific reference chapter.
M ESSAGE F ORMATS
This section contains a description of the Run-Time Manager line format for EDI and protocol module messages, the tag message format for displayed messages, and how the line format translates to the tag format. EDI Run-Time Manager Line Format Messages that report normal operations and error conditions in read and write operations are displayed on the EDI line of the Run-Time Manager screen. These messages can contain the following information:
LPORT:xxx LSTA:xx ER:xxxx TBL:xxx PKT:xxx
where
LPORT:xxx LSTA:xx ER:xxxx TBL:xxx PKT:xxx
is the logical port number assigned to the physical port experiencing the error. is the logical station number assigned to the physical station experiencing the error. is an error code in decimal format. See the protocol-specific reference chapter for details on the error code generated. is the number of the read or write table experiencing the error. is the number of the message packet experiencing the error.
means an error code 2 occurred for port 0, logical station 2, involving the third table in the Read/Write Control table for the second message packet generated. For descriptions of the FactoryLink EDI messages containing this information, see Messages on page 150.
Tag Message Format To capture these Run-Time Manager messages for viewing on an application screen, you can log them to message tags. A message tag is defined in the Logical Station Control table. (This tag is not available for the OMRON protocol module.) To view the contents of a message tag on an application screen, you define the tag as a graphic object using Client Builder. In a message tag, the LPORT field of an EDI Run-Time Manager message is stored in the following format:
Lsta n: MessageText, nnnn
where n: is the number assigned to the logical port causing the message. MessageText is a description of the condition causing the error. nnnn is the code number assigned to the message generated. For information about the protocol-specific codes, see the protocol module reference chapter. For example:
Lsta 2: Read Response Error, 0x03
M ESSAGES
FactoryLink can generate and display various types of messages during the start up of an application or while the application is running. This section describes each type of message. EDI Messages system messages generated by the EDI task at run time are displayed on the Run-Time Manager screen. These messages appear opposite the Shared Task description for EDI in the message area under Last Message. Startup Messages during the startup of a FactoryLink application, messages generated by the device protocol module are displayed on the system monitor as the conditions prompting each message occur. Run-Time Application Messages while the FactoryLink application is running, messages generated by the device protocol module are displayed on an application screen. For information about these messages, see the section, Run-Time Application Messages, in the protocol-specific reference chapter. In the message descriptions, the directory where your FactoryLink application resides is referred to as FLAPP. The information in Italic text in the message descriptions varies depending on certain factors. In messages you see in your server application, information in Italics will be replaced by information specific to your application (for example, port or table number). Some of the messages described in this chapter can also be found in Chapter 9, Testing and Troubleshooting, in a flowchart that describes how to respond to some common error messages generated and displayed by the EDI task. EDI Messages The following messages report operations and error conditions specific to EDI.
Abnormal shutdown of EDI drivers
Cause:
A protocol module was experiencing an error at the time the EDI task was shutting down.
Cause:
The block .DCT file generated by the EDI task for the specified logical port and Read/Write table is corrupt.
Cause:
Cause:
Action: Verify the External Device Definition tables are correct and contact your system administrator.
Bad return code from operation err:hexcode
Cause:
Action: See the description for the hexadecimal number that is displayed after err: in the protocol-specific reference chapter for information about correcting the error.
Block rd n block wr n excpt wr n unsol n
Cause:
The EDI task is displaying the total number of communication transactions configured for each type of operation defined in the .DCT files.
Cause:
The file may be corrupt or absent, or the External Device Definition table may not have any entries.
Action: Ensure the External Device Definition table is configured and the entries are correct.
Cause:
This may be a log file that is opened by another process, or has not been created.
Action: Verify the External Device Definition tables are correct and contact your system administrator.
Cant resolve IPC for LPORT logical port
Cause:
The EDI task was unable to allocate shared memory for the specified logical port. A spawn of the protocol module was attempted but failed.
Action: In the External Device Definition table, define the appropriate logical port to be used for read and write operations. If this does not solve the problem, contact Customer Support.
Cant spawn system unit task for LPORT logical port
Cause:
The Function field of the External Device Definition table contains an invalid entry.
Action: In the Function field on the External Device Definition table, enter the appropriate communication type. For example, enter SYSCOM for serial communications.
EDI task: Cant obtain task number
Cause:
Action: Verify the system has the correct task protection bit configured.
Error opening device definition file
Cause:
One of the necessary device definition files for the EDI task either does not exist or is corrupt.
Action: Verify the External Device Definition table entries are correct.
Error opening port definition file
Cause:
One of the necessary port definition files for the EDI task either does not exist or is corrupt.
Action: Verify the External Device Definition table entries are correct.
Cause:
Action: Verify the External Device Definition table entries are correct.
Error reading port definition
Cause:
Action: Verify the External Device Definition table entries are correct.
External Device Interface startup
Cause:
Cause:
The EDI task could not perform a read or a write operation because the specified logical port has not been defined.
Cause:
An error occurred during a read or write operation to the specified logical station.
Action: The error code specified after err is associated with the port, station, table, and packet indicated. See the description for the hexadecimal number that is displayed after err in the protocol-specific reference chapter for information about correcting the error.
LPORT logical port connecting
Cause:
Cause:
Cause:
Cause:
Cause:
The EDI task does not recognize any read or write operations because the configuration tables contain incorrect entries.
Action: Verify the entries in the External Device Definition table and device-specific configuration tables and correct as needed. Cause: The EDI task does not recognize any read or write operations because the .DCT files were not properly built.
Action: Check the FLAPP\DCT directory to verify the .DCT files were built. If necessary, execute EDISTART -R -V to regenerate the files. Cause: The EDI task does not recognize any read or write operations because the task is unable to read the FLAPP\DCT directory.
Action: Verify the FLAPP\DCT directory has read and write privileges. Grant these privileges if necessary. Cause: The EDI task does not recognize any read or write operations they are not defined.
Cause:
The EDI task is shutting down in response to a normal FactoryLink termination request.
Cause:
The EDI task cannot perform the specified function because the system has run out of memory.
Cause:
The EDI task is reading the preconfigured .CT file and packetizing information from the specified internal .DCT file.
Cause:
The EDI task was unable to perform a read or a write operation on the specified logical port because the port was not properly defined.
Action: Define the logical port number specified. If this does not solve the problem, see the description for the hexadecimal number that is displayed after err: in the protocol-specific reference chapter for information about correcting the error.
Termination flag acknowledgment
Cause:
Cause:
The EDI task was unable to allocate shared memory to process the specified read or write operation.
Start-Up Messages During FactoryLink application startup, the device protocol module can generate messages and display them on the console. These messages display as shown, not in error code or message format.
FactoryLink Ver: n EDI Ver: n.nn protocol module EDI Module Ver: n.nn
Cause:
Action: None. This is only an informational message. protocol module: Protection bit failure Cause: The option key is missing the protocol-specific option bit. Action: Install the option bit. protocol module: Software Protection bit failure; bits (x) and number (y) required Cause: One or both of the option bits (where x and y are decimal values) required to run this protocol module are missing.
Chapter 11
Allen-Bradley
This chapter contains information needed to set up and configure bidirectional communications between the FactoryLink real-time database and the following devices, either directly or through the Allen-Bradley Data Highway protocol: PLC-2 PLC-3 PLC-4 PLC-5 PLC-250 PLC-1774 In your server application, open Device Interfaces > Allen-Bradley.
C ONFIGURING
Note
THE
Before completing the protocol-specific Allen-Bradley configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58 for details. Open the Logical Station Control Table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a device.
Valid Entry: previously defined logical port number
Baud Rate
Enter the speed at which the protocol module communicates with the devices linked to FactoryLink via this logical port. This entry must match the baud rate configuration of the devices. Refer to the device manufacturers documentation for details.
Valid Entry: 110 - 115200 (default=9600)
Parity
Enter the parity error correction during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: none, even, odd (default=none)
Data Bits
Enter the number of data bits used during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 7, 8 (default=8)
Stop Bits
Enter the number of bits sent after a character to create a pause before the start of the next character. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 1, 2 (default=1)
Enter the length of time, in tenths of seconds, the protocol module will wait to receive a response to a read or write command before timing out. You must enter a value greater than 0 for the protocol module to timeout.
Valid Entry: 0-9999 (default=55)
Enter the address of the asynchronous communications module on the Data Highway. Most current modules accept or require 0. Some older Allen-Bradley Data Highway interface modules may require their Data Highway address.
Valid Entry: 0 - 377 (unless specifically required by the Data
Enter the type of longitudinal range error checking used by the Allen-Bradley asynchronous communications interface. Ensure that the communication device matches the setting you choose. If you specify no setting, the LRC error detection defaults to CRC.
Valid Entry: B, C, BCC, CRC (default=CRC)
Retry Request
(For use with BCC longitudinal error checking only.) Enter the maximum number of times the protocol module will retry a read or write command to a device communicating through this logical port if the command response is invalid or is not received.
Valid Entry: 0 - 32767 (default=3)
Enter the length of time in milliseconds to wait for link-level response (ACK/NAK) from the asynchronous interface.
Valid Entry: 0 - 65536 (default=150)
Enter the number of times for the EDI task to re-send ENQs after a timeout before aborting a request.
Valid Entry: 0 - 32767 (default=10)
Enter the number of times for the EDI task to retransmit a send request after receipt of a negative acknowledgment (NAK) before aborting the request.
Valid Entry: 0 - 32767 (default=3)
Enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port. For information about displaying the text stored in a Status Msg Tag tag for an operator using this application, see the Application Editor for ECS Graphics Guide.
Valid Entry: tag name Valid Data Type: message
When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the Allen-Bradley Logical Station Control table. In this example, logical port 0 is configured for a baud rate of 9600, 8 data bits, 1 stop bit, no parity, and a 5.5-second response timeout. The Data Highway I/F address is 0, using FULL duplex. LRC Error detection is CRC, the retry request is 3 with a link timeout of 150 seconds. The ENQ Retry count is 10 and the NAK Retry Count is 3. The EDI task will store communications error messages associated with this logical port in a message tag, AB_LPORT0_MSG
Field
Logical Port Baud Rate Parity Data Bits Stop Bits Response Timeout 0.1 sec Data Highway I/F address (OCTAL)
Entry
0 9600 NONE 8 1 55 0
Field
Duplex LRC Error Detection Retry Request Link Timeout 0.001 sec ENQ Retry Count NAK Retry Count Status Msg Tag
Entry
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. Complete a row for each device to communicate through this logical port.
Error/Status Tag Name
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station). For information about displaying the codes stored in an Error/Status Tag Name tag for an operator using this application, see the ECS Graphics and WebClient Reference Guide.
Valid Entry: tag name Valid Data Type: analog
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. Later, you will enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number identifies the device to or from which data is to be sent or received.
Valid Entry: 0 - 999
Device Type
Enter the physical Data Highway address of the Allen-Bradley device. For some Data Highway types, some addresses may be invalid. For further information about valid addresses for a specific Data Highway type, refer to the Allen-Bradley documentation.
Valid Entry: 0 - 377 (octal)
Comment
(Optional) Enter reference information about this logical station. Valid Entry: alphanumeric string of up to 21 characters
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the Allen-Bradley Logical Station Information table. In this example, logical station 0 is a PLC-5 on logical port 0, with a data highway address of 1. The analog tag defined in the Error/Status Tag Name field, AB_STATION0_STATUS, is configured to hold port errors for logical station 0.
Field
Error/Status Tag Name Logical Station (Decimal) Device Type Station Address (OCTAL) Comment
Entry
AB_STATION0_STATUS 0 PLC-5 1
C ONFIGURING
THE
Next, open the Allen-Bradley Read/Write Control. Complete a row for each read or write table.
Tip
For information about triggering schemes using tags defined in this table, see Application Design Tips and Techniques on page 127.
Table Name
Give this read or write request a name. Define one request (table) per line and do not include spaces in the name. You can define as many tables as available memory allows. Try to make the table name reflective of the operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Unsolicited Read
For EDI to interpret this operation as a triggered block read or as a write operation, accept the default of NO. If this is an unsolicited read operation, enter YES or FORCE. EDI will interpret this operation as an unsolicited read and emulate the devices addressing structure based on entries you make in the Read/Write Information table. The incoming data will be stored in the real-time database as specified in this field. If you enter YES, the incoming data will be stored in the tag represented by the tag name specified in the Read/Write Information table. If the current value of the tag is equal to the new value, the change-status indicator is unaffected. If a different value is being stored the tag, however, it will overwrite the current value and the tags change-status indicator will be set to 1 (ON). If you enter FORCE, the data is stored in the specified tag and the change-status indicator is automatically set to 1, regardless of whether the current value matches the new value.
Valid Entry: yes, no, force (default=no)
Exception Write
For EDI to interpret this operation as a triggered block write or as a read operation, accept the default of NO. For EDI to interpret this operation as an exception write and write tag values to the device only when those values change, enter YES. In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Valid Entry: yes, no (default=no)
Tip
Do not specify tags expected to change at frequent and unpredictable intervals in an exception write table. Any tag specified will be written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communications or result in an error message.
Block Read Priority
If this is a block read operation, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is an unsolicited read or a write operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block read.
Valid Entry: 1 - 4 (default=1)
Note
The Block Read Trigger, Block Read Disable, Block Read Complete, and Block Read State tags apply only to triggered read operations. Do not define these tags for unsolicited read operations or for write operations.
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is required. Enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When this tags value is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1. To reenable a block read table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
Tip
This tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To re-enable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Block Read Complete
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
If this is a block or exception write operation, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a read operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block or exception write.
Valid Entry: 1 - 4 (default=1)
Note
The Block Write Trigger, Block Write Disable, Block Write Complete, and Block Write State tags apply only to write operations. Do not define these tags for read operations.
Block Write Trigger
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is required. Enter a tag name for a digital tag to initiate a block write of the tag values specified in the Read/Write Information table to the addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values.
Valid Entry: tag name Valid Data Type: digital
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable a block write to the addresses specified in this table. When this tags value is forced to 1 (ON), the write operation is not executed, even when the block write trigger is set to 1. To reenable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
Tip
This tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To re-enable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Block Write Complete
If this is a read or exception write operation, ignore this field. If this is a block write table, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this tables Read/Write Information table is written to the device, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup.
While the table is being processed, the tag is set to 0 (OFF). After the data defined in this tables Read/Write Information table is written to the device, the state tag is forced back to 1. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click the Save icon to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box. The table below provides sample entries for the Allen-Bradley Read/Write Control table. In this example, the READ table is configured as follows: When the value of the digital Block Read Trigger tag AB_READ_TRIGGER is 1, FactoryLink reads the configured register address and writes its value to the tag configured for this table (in the Read/Write Information table). The block read priority, which is set automatically if you do not enter a value, is set to the default of 1, the highest priority. When the value of the digital tag AB_READ_DISABLE is 1, FactoryLink disregards the trigger tag, AB_READ_TRIGGER, and does not process the READ_MSG table. Once FactoryLink reads the data and writes it to the tag defined to receive it (MBRDR1 in the Read/Write Information table), FactoryLink forces a value of 1 to the digital Block Read State tag, AB_READ_STATE, and to the Block Read Complete tag, AB_READ_COMPLETE. During the read operation, AB_READ_STATE is set to 0.
Field
Table Name Unsolicited Read Exception Write Block Read Priority Block Read Trigger
Entry
Field
Block Read Disable Block Read Complete Block Read State Block Write Priority Block Write Trigger Block Write Disable Block Write Complete Block Write State
Entry
AB_READ_DISABLE AB_READ_COMPLETE AB_READ_STATE The write priority for this table is set to 1 by default. Because this is a read table, the tags specific to write requests are not defined.
C ONFIGURING
THE
From the Read/Write Control table, select the row for the table you are configuring and open the Read/Write Information table to the foreground. For a Read TableAdd a table entry for each FactoryLink tag in which data read from the device will be stored when the operation executes. For a Write TableAdd a table entry for each tag to be written when the operation executes.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, longana, float, message
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Address
For a read table, enter the address in the devices memory where the value to be stored in this tag is located. For a write table, enter the address in the devices memory to which the tag value will be written.
Valid Entry: Allen-Bradley Address Entries on page 182
Data Type
Specify the type of data being read from or written to the device for each tag defined in the Tag Name field. If you enter the data type BIN, the EDI task automatically selects an Allen-Bradley data type compatible with the FactoryLink data type of the Tag Name tag. For example, if you enter BIN as the data type for an analog tag, the task interprets BIN as INT2 and reads or writes to the tag as if the data type had been entered as INT2.
Valid Entry: Allen-Bradley Data Types on page 173
When the table is complete, click the Save icon to validate the information. Define the data type (digital, analog, long analog, floating-point, or message) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the Allen-Bradley Read/Write Information table. In this example, the protocol module reads data from address 310/00 in the PLC configured as logical station 0. The data is stored in a digital tag, MBRDR1. The protocol module transfers this untranslated binary value (BIN) to the real-time database without conversion.
Field
Tag Name Logical Station Address Data Type
Entry
Signed, 2-byte binary integer Untranslated binary value Signed, 4-byte binary integer Unsigned, 2-byte word representing 3 BCD digits Binary Coded Decimal value Unsigned, 2-byte word representing 4 BCD digits Binary Coded Decimal value Unsigned, 2-byte word representing 4 BCD digits most significant nibble ignored for reads, zero on writes Signed, 4-byte floating-point number Signed, 8-byte floating-point number Two ASCII characters stored in one word: first character in least significant byte; second character in most significant byte
C ONVERSION
OF
D ATA TYPES
FOR
R EAD O PERATIONS
This section describes how the Allen-Bradley protocol module converts data types to tags for read operations. See Allen-Bradley Data Types on page 173 for a list of data types. Digital Tags The Allen-Bradley protocol module supports only the following digital conversion:
BIN to Digital
The value (1 or 0) of the bit at the specified address is transferred to the digital tag without conversion. If no bit number is specified, the value of bit 0 at the specified address is transferred to the digital tag. Analog Tags The Allen-Bradley protocol module supports only the following analog conversions:
BIN to Analog
The value of the word at the specified address is transferred to the analog tag without conversion.
INT2 to Analog
The value of the word at the specified address is transferred to the analog tag without conversion.
INT4 to Analog
The value of the 4-byte integer at the specified address is converted to a 2-byte integer value and is transferred to the analog tag.
BCD3 to Analog
The 3-digit BCD value at the specified address is converted to a 2-byte integer value and is transferred to the analog tag.
BCD4 to Analog
The 4-digit BCD value at the specified address is converted to a 2-byte integer value and is transferred to the analog tag.
UBCD to Analog
The 3-digit BCD value at the specified address is converted to a 2-byte integer value and is transferred to the analog tag.
FLT4 to Analog
The 4-byte floating-point value at the specified address is converted to a 2-byte integer value and is transferred to the analog tag.
FLT8 to Analog
The 8-byte floating-point value at the specified address is converted to a 2-byte integer value and is transferred to the analog tag. Floating-Point Tags The Allen-Bradley protocol module supports only the following floating-point conversions:
BIN to Floating Point
The 8-byte floating-point value at the specified address is transferred to the floating-point tag without conversion.
INT2 to Floating Point
The value of the 2-byte integer at the specified address is converted to an 8-byte floating-point value and is transferred to the floating-point tag.
INT4 to Floating Point
The value of the 4-byte integer at the specified address is converted to an 8-byte floating-point value and is transferred to the floating-point tag.
BCD3 to Floating Point
The value of the 3-digit BCD word at the specified address is converted to an 8-byte floating-point value and is transferred to the floating-point tag.
The value of the 4-digit BCD word at the specified address is converted to an 8-byte floating-point value and is transferred to the floating-point tag.
UBCD to Floating Point
The value of the 3-digit BCD word at the specified address is converted to an 8-byte floating-point value and is transferred to the floating-point tag.
FLT4 to Floating Point
The 4-byte floating-point value at the specified address is converted to an 8-byte floating-point value and is transferred to the floating-point tag.
FLT8 to Floating Point
The 8-byte floating-point value at the specified address is transferred to the floating-point tag without conversion. Longana Tags The Allen-Bradley protocol module supports only the following longana conversions.
BIN to Longana
The value of the 4-byte integer at the specified address is transferred to the longana tag without conversion.
INT2 to Longana
The value of the word at the specified address is transferred to the longana tag without conversion.
INT4 to Longana
The value of the 4-byte integer at the specified address is transferred to the longana tag without conversion.
BCD3 to Longana
The 3-digit BCD value at the specified address is converted to a 4-byte integer value and is transferred to the longana tag.
BCD4 to Longana
The 4-digit BCD value at the specified address is converted to a 4-byte integer value and is transferred to the longana tag.
UBCD to Longana
The 3-digit BCD value at the specified address is converted to a 4-byte integer value and is transferred to the longana tag.
FLT4 to Longana
The 4-byte floating-point value at the specified address is converted to a 4-byte integer value and is transferred to the longana tag.
FLT8 to Longana
The 8-byte floating-point value at the specified address is converted to a 4-byte integer value and is transferred to the longana tag. Message Tags The Allen-Bradley protocol module supports only the following message conversions
BIN to Message
The values of the words specified in the address are transferred to the message tag without conversion.
ASC to Message
The values of the words specified in the address are copied to the message tag with low-order and high-order bytes inverted.
C ONVERSION
OF
TAGS
FOR
W RITE O PERATIONS
This section describes how tags map to the data types listed on page 173 for the Allen-Bradley protocol module for write operations. Digital Tags The Allen-Bradley protocol module supports only the following digital conversion.
Digital to BIN
The value (1 or 0) of the digital tag is transferred to the bit at the specified address without conversion. If no bit number is specified, the value of the digital tag is transferred to bit 0 at the specified address. Analog Tags The Allen-Bradley protocol module supports only the following analog conversions.
Analog to BIN
The value of the analog tag is transferred to the specified address without conversion.
Analog to INT2
The value of the analog tag is transferred to the specified address without conversion.
Analog to INT4
The value of the analog tag is converted to a 4-byte integer value and is transferred to the specified address.
Analog to BCD3
The analog value is converted to a 3-digit BCD value and is transferred to the specified address.
Analog to BCD4
The analog value is converted to a 4-digit BCD value and is transferred to the specified address.
Analog to UBCD
The analog value is converted to a 3-digit BCD value and is transferred to the specified address.
Analog to FLT4
The analog value is converted to a 4-byte floating-point value and is transferred to the specified address.
Analog to FLT8
The analog value is converted to an 8-byte floating-point value and is transferred to the specified address. Floating-Point Tags The Allen-Bradley protocol module supports only the following floating-point conversions.
Floating Point to BIN
The value of the floating-point tag is transferred to the four-word address without conversion.
Floating Point to INT2
The value of the floating-point tag is converted to a 2-byte integer and is transferred to the specified address.
Floating Point to INT4
The value of the floating-point tag is converted to a 4-byte integer and is transferred to the specified address.
Floating Point to BCD3
The value of the floating-point tag is converted to a 3-digit BCD word and is transferred to the specified address.
Floating Point to BCD4
The value of the floating-point tag is converted to a 4-digit BCD word and is transferred to the specified address.
The value of the floating-point tag is converted to a 3-digit BCD word and is transferred to the specified address.
Floating Point to FLT4
The value of the floating-point tag is converted to a 4-byte floating-point value and is transferred to the specified address.
Floating Point to FLT8
The value of the floating-point tag is transferred to the specified address without conversion. Longana Tags The Allen-Bradley protocol module supports only the following longana conversions.
Longana to BIN
The value of the longana tag is transferred to the specified address without conversion.
Longana to INT2
The value of the longana tag is converted to a 2-byte integer value and is transferred to the specified address.
Longana to INT4
The value of the longana tag is transferred to the specified address without conversion.
Longana to BCD3
The longana value is converted to a 3-digit BCD value and is transferred to the specified address.
Longana to BCD4
The longana value is converted to a 4-digit BCD value and is transferred to the specified address.
Longana to UBCD
The longana value is converted to a 3-digit BCD value and is transferred to the specified address.
Longana to FLT4
The longana value is converted to a 4-byte floating-point value and is transferred to the specified address.
Longana to FLT8
The longana value is converted to an 8-byte floating-point value and is transferred to the specified address. Message Tags The Allen-Bradley protocol module supports only the following message conversions.
Message to BIN
The values of the message tags are written to the words specified in the address without conversion.
Message to ASC
The values of the message tags are written to the words specified in the address with the low-order and high-order bytes inverted.
where
word
(Required) Word address of the data table in octal Valid Entry: 0 - 7777 (octal) (The actual high address depends
bit
significant bit)
(Optional) Number of words in a message string in decimal Word 15 decimal Bit 17 of word 23 (word 19 decimal) Bit 7 of word 7 (word 15 decimal) First 100 decimal words
If you configure PLC-3 and PLC-5 for PLC-2 compatibility, these addresses are also valid for PLC-3 and PLC-5.
PLC-3 Addresses The Allen-Bradley PLC-3 uses the following types of address formats: Logical word addressing Logical file addressing Symbolic word addressing Symbolic file addressing
Logical Word Addressing
where
W filetype
(Optional) Logical word addressing default if no other addressing type is specified (Required) One of the letters specifying a PLC-3 file type shown in the following table.
Description Section # Words/Tag
Type
O I T C N F D B A
Output image Input image Timer Counter Integer Floating-point BCD Binary ASCII
1 2 3 4 5 6 7 8 9
1 1 3 3 1 2 1 1 1
Type
Description
Section #
Words/Tag
H P S
filenumber tag subtag bit length
10 11 13
2 2 1
(Optional) Tag number in specified file in decimal, except types I and O, which are octal (Optional) Subtag in decimal (Optional) Bit address in octal (Optional) Number of words in decimal Least significant bit of word 8 (decimal) of input file 12 (decimal) Bit 17 of word 11 (decimal) of input file 0 First 10 (decimal) words of output file 0 Words 8 - 17 (decimal) inclusive of output file 10 Bit 17 of second word in timer 8 (the ninth timer structure timer file number 10)
When you use logical file addressing, all numbers are in decimal, regardless of file type. Bit 16 refers to the least significant bit of the next word in the PLCs memory. Logical file addressing uses the following address formats:
F filetype[filenumber:][tag][.subtag][/bit] F filetype[filenumber:][tag][.subtag][,length]
where
F
filetype
(Required) One of the letters specifying a PLC-3 file type shown in the table below.
Valid Entry: 999 (default=0)
Type
Description
Section #
Words/Tag
O I T C N F D B A H P S
filenumber tag subtag bit length
Output image Input image Timer Counter Integer Floating-point BCD Binary ASCII High-order integer Pointer Status
1 2 3 4 5 6 7 8 9 10 11 13
1 1 3 3 1 2 1 1 1 2 2 1
(Optional) File number in decimal (Optional) Tag number in specified file in decimal (Optional) Subtag in decimal (Optional) Bit number (Optional) Number of words in decimal Bit 15 of word 15 of output file 0 (Word 15 is the 16th word in the file.) Bit 0 of word 16 of input file 5 (Word 16 is the 17th word in the file.)
FO/255 FI5:/256
Bit 0 of word 26 of input file 0 (Word 26 is the 27th word in the file.) Bit 0 of word 26 of input file 5 (Word 26 is the 27th word in the file.) Floating-point value 2, floating-point file 3 (Floating-point value number 2 is the 5th and 6th words in this file.)
where
@ AAAAAAAA bit length
(Required) The symbolic addressing flag character (Required) 1- to 8-character symbolic name defined in the PLC (use only uppercase characters) (Optional) Bit number in octal (Optional) Number of words in message string in decimal Symbol Most significant bit of the word at SYMBOL 20 words starting at SYMBOL
where
@
1- to 8-character symbolic name defined in the PLC (use only uppercase characters) (Required) Word number (offset) from symbol in decimal (specify a word, even if it is 0) (Optional) Bit number in decimal (Optional) Number of words in message string in decimal First word of PLC ASCII symbol file Least significant bit of word at SYMBOL + 11 20 words starting at SYMBOL + 10
PLC-5 Addresses Depending on the file type being addressed, the Allen-Bradley protocol module supports two formats for addressing PLC-5s. The Allen-Bradley PLC-5 Input and Output Image tables use the following address formats:
filetype:[wordnumber][/bit] filetype:[wordnumber][,length]
where
filetype wordnumber bit length I:34/17 O:/0 I:,100
(Required) One of the letters (I or O) specifying a PLC-5 Input or Output Image table (Optional) Word number in octal
Valid Entry: 0 - 777 (default=0) (Optional) Bit address in octal
(Optional) Number of words in decimal Bit 17 of word 28 in the Input Image table Bit 0 of Word 0 in the Output Image table First 100 word of the Input Image table
The remaining Allen-Bradley PLC-5 data table files use the following address formats:
filetype[filenumber]:[tag][.subtag][/bit] filetype[filenumber]:[tag][.subtag][,length]
where
filetype
(Required) One of the letters specifying a PLC-5 file type shown in the following table
Description Default File # # Words/Tag
Type
S B T C R N F A D
filenumber
2 3 4 5 6 7 8 N/A N/A
1 1 3 3 3 1 2 1 1
(Optional) File number in decimal. If not specified, file number is assumed to be the default file number for the file type specified.
Valid Entry: 0 - 999
(Optional) Tag number in specified file in decimal (default=0). (Optional) Subtag number in decimal (default=0). (Optional) Bit address in decimal. (Optional) Number of words in decimal. Bit 15 of word 23 of integer file 7. (Word 23 is the 24th word in the file.)
Float value 17 in Floating-point file 8. (Float word 17 is the 18th float word.) Bit 15 of Word 15 of Bit file 17. (Bit 15 is the most significant bit. Word 15 is the 16th word.) Bit 15 of word 15 of Bit file 3. (Bit 15 is the most significant bit. Word 15 is the 16th word.)
PLC 5-250 Native Mode Addresses The Allen-Bradley protocol module supports a limited subset of PLC5-250 native mode addresses. It supports only those features specifically described in this document. If you try to use other features, FactoryLink application errors will occur.
PLC Type PLC-250
Use the PLC type PLC-250 in the Logical Station table to describe a logical station as a PLC5-250. This PLC type supports limited native addressing to a PLC5-250.
Unsolicited Read Support
Create a logical station with a PLC type of PLC-2 for unsolicited reads from the PLC5-250. The PLC5-250 may then send Unprotected Write (PLC-2 format) commands to the protocol module. The protocol module ignores any definitions of unsolicited reads on a station with a PLC type of PLC-250.
Native Addressing
Specify all numbers in the address in decimal. The following are limitations on the data that can be accessed: The data must reside either in the resource manager or a logic processor addressable from the resource manager. The files native tag must not contain subtags. The file identifier must consist of a single character.
Address Format
where
spaces brackets [ ] colon (:)
MODULE_ID
Are for readability only; do not include them in the actual address string Are optional in the address string Are required in the address string
If 0, the MODULE_ID is the resource manager; if 1-8, MODULE_ID is a logic processor. If a logic processor is specified, this number is the value set on the thumbwheel on the front of the logic processor. If the MODULE_ID is omitted, the resource manager will be assumed.
FILE_ID
The FILE_ID specifies the type of file. It consists of a single uppercase alphabetic character. Valid FILE_IDs are:
B N L F
FILE_NUMBER
The FILE_NUMBER specifies which file of the FILE_ID file is addressed. It consists of a 1- to 4-character decimal number ranging from 0 to 9999. If the FILE_NUMBER is omitted, it is assumed to equal 0.
FILE_TAG
The FILE_TAG specifies which tag in the file is addressed. It consists of a 1- to 4-character decimal number ranging from 0 to 9999. If the FILE_TAG is omitted, it is assumed to equal 0.
The BIT_NUMBER and MESSAGE_LENGTH are the same as the other PLC types, except that the BIT_NUMBER must range between 0 and 15. Bit 0 is the least-significant bit; bit 15 is the most-significant bit.
Example
The following sample strings illustrate PLC5-250 native mode addressing format:
Address 0B14:10/15 B14:10/15 3N5:3 Description
The most significant bit of the 11th binary word (address 10) of the 15th binary file (address 14) in the resource manager Same as previous The fourth (address 3) integer tag of the sixth (address 5) integer file in logic processor 3
Use the same conversions (INT2, INT4. . .) as those with logical stations of type PLC-5. See PLC-5 Addresses on page 187 for more information.
SW1
SW2
SW3 123
SW4 123
SW5 12 UU
12
123
123
12
The following are the switch settings and addresses for the 1771-KE.
SW1 Address SW5 SW6
12345 DDDDD
12 As needed
123
123
12 UU
1234 UDDU
1771-KG The following are the switch settings and addresses for the 1771-KG.
SW1 SW2 Address
12345 DDUUD
12 As needed
123
123
12 DD
12 DD
12 DD
12 DD
123 UDD
123 DUD
ER:xxxN is a single-digit format in which one digit represents a single error condition. In some cases, two individual codes appear within a string to indicate multiple error conditions.
Double-Digit Code Format
ER:xxNN is a double-digit format in which two digits represent a single error condition.
Single-Digit Codes Hexadecimal error codes 0001 through 000F are Allen-Bradley protocol module internal errors, described in the following table.
Error Message Description
Internal error (invalid rcv/xmt state) Unable to transmit request to Data Highway Interface Unable to receive request response from Data Highway Interface
Error Message
Description
Internal error (CPT translate error) Internal error (DSF translate error) Invalid extended status (above 080h) from Data Highway Interface Invalid length retry count exceeded
Error codes received from the Data Highway interface can signify Local, Extended, or Remote STS errors.
Local STS Error Codes
EDI error codes from 0010 through 001F denote Local STS errors received from the Data Highway Interface. Read the least significant nibble of the EDI error code to obtain the local error code.
Error Message Description
Designate node out of buffer space Remote node specified does not acknowledge (ACK) the command message Duplicate token holder detected Local port is disconnected
EDI error codes from 0020 through 002F denote Remote STS errors received from the Data Highway Interface. Read the least significant nibble of the EDI error code as the most significant nibble of the remote error code to obtain the remote error code.
Error Code Description
0021 0022 0023 0024 0025 0026 0027 0028 0029 002B
Illegal command or format The host has a problem and will not communicate The remote node host is missing, disconnected, or shut down The host could not complete function because of hardware fault Addressing problem or memory protect rings Function disallowed because of command protection selection Processor is in program mode Compatibility mode file missing or communication zone problem Remote node cannot buffer command Remote node problem caused by download
EDI error codes above 002F denote Extended STS errors received from the Data Highway interface. Subtract 0030 from the EDI error code to obtain the Extended error code.
Error Message Description
Error in converting block address Fewer levels specified in address to address More levels specified in address than system supports
Error Message
Description
0034: 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F 0040 0041 0042 0043
Note
Symbol not found The symbol is of improper format Address does not point to something usable The file is the wrong size Cannot complete request; situation has changed since the start of the command The file is too large The transaction size plus word address is too large Access denied; improper privilege Condition cannot be generated; resource is not available (some have upload active) Condition already exists; resource is already available The shutdown could not be executed Requestor does not have upload or download access; noprivilege Histogram overflow Illegal data type Bad parameter An address reference(s) exists to a deleted data table(s)
Chapter 12
General Electric
This chapter contains information needed to set up and configure bidirectional communications between the FactoryLink real-time database and one or more General Electric devices, using GE CCM protocol. In your server application, open Device Interfaces > GE Fanuc.
C ONFIGURING
Note
THE
Before completing the protocol-specific General Electric configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58 for details. Open the Logical Station Control Table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a device.
Valid Entry: previously defined logical port number (default=0)
Baud Rate
Enter the speed at which the protocol module communicates with the devices linked to FactoryLink via this logical port. This entry must match the baud rate configuration of the devices. Refer to the device manufacturers documentation for details.
Valid Entry: 110 - 115200 (default=9600)
Parity
Enter the parity error correction during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: none, even, odd (default=none)
Data Bits
Enter the number of data bits used during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 8
Stop Bits
Enter the number of bits sent after a character to create a pause before the start of the next character. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 1
Timeout
Enter the length of time, in tenths of a second, the protocol module will wait to receive a response to a read or write command before timing out. You must enter a value greater than 0 for the protocol module to timeout.
Valid Entry: 0 - 9999 (default=20 or 2 seconds)
(Optional) Enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the General Electric Logical Station Control table.
Field
Logical Port
Entry
Description
9600 NONE 8 1
Specifies the logical communication path configured by this table Specifies the communication rate No parity checking Specifies 8 data bits in the transmission Specifies 1 stop bit in the transmission The response timeout 1 second Error messages written to the message tag GENE_LPORT0_MSG
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. Complete a row for each device to communicate through this logical port.
Error/Status Tag Name
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station).
Valid Entry: tag name Valid Data Type: analog
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port.
Later, you will enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry: 0 - 255
Device Type
Enter the type of General Electric device to which communications are to be directed.
SERIES_1 GE Series One PLC SERIES _3 SERIES _5 SERIES _6 S1_JR S1_PLUS SRS_9070 SRS_9030 GE Series Three PLC GE Series Five PLC GE Series Six PLC GE Series One JR PLC GE Series One PLUS PLC GE Series 9070 GE Series 9030
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the General Electric Logical Station Information table:
Field
Error/Status Tag Name Logical Station Device Type Physical Station
Entry
Description
Contains information about communication errors. Specifies the logical communication path. Specifies the physical device type associated with this logical station. Specifies the physical station number associated with this logical station.
C ONFIGURING
THE
Open the Read/Write Control table. Complete a row for each read or write table.
Table Name
Assign a name to this read or write request. Define one request (table) per line and do not include spaces in the name. You can define as many tables as available memory allows. Try to make the table name reflective of the operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Exception Write
For EDI to interpret this operation as a triggered block write or as a read operation, accept the default of NO. For EDI to interpret this operation as an exception write and write tag values to the device only when those values change, enter YES.
In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Valid Entry: yes, no
Tip
Do not specify tags expected to change at frequent and unpredictable intervals in an exception write table. Any tag specified will be written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communications or result in an error message.
Block Read Priority
If this is a block read operation, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a write operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block read.
Valid Entry: 1 - 4 (default=1)
Note
The Block Read Trigger, Block Read Disable, Block Read Complete, and Block Read State tags apply only to triggered read operations. Do not define these tags
Field
Tag Name Logical Station Address Data Type
Entry
MBRDR1 0 310/00 BIN If this is a write operation, ignore this field. If this is a triggered read operation, this field is required. Enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When this tags value is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1. To re-enable a block read table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
Tip
This tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To re-enable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
If this is a block or exception write operation, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a read operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block or exception write.
Valid Entry: 1 - 4 (default=1)
Note
The Block Write Trigger, Block Write Disable, Block Write Complete, and Block Write State tags apply only to write operations. Do not define these tags for read operations.
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is required. Enter a tag name for a digital tag to initiate a block write of the tag values specified in the Read/Write Information table to the addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values.
Valid Entry: tag name Valid Data Type: digital
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable a block write to the addresses specified in this table. When this tags value is forced to 1 (ON), the write operation is not executed, even when the block write trigger is set to 1. To reenable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
Tip
This tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To re-enable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
If this is a read or exception write operation, ignore this field. If this is a block write table, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this tables Read/Write Information table is written to the device, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the data defined in this tables Read/Write Information table is written to the device, the state tag is forced back to 1. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click the Save icon to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the General Electric Read/Write Control table:
Field
Table Name Exception Write Block Read Priority Block Read Trigger
Entry
Description
Name of the read/write table. This is not an exception write. The block read priority for the READ table is set to 1. When the value of GENE_READ_TRIGGER is 1, a block read of values specified in the Read/Write Information table associated with this table occurs. When triggered, GENE_READ_ DISABLE disables the block read operation. The value of GENE_READ_ COMPLETE is set to 1 when the read is complete. The write priority for this table is set to 1 by default. Since this is a read table, the tags specific to write requests are not defined.
Block Write Priority Block Write Trigger Block Write Complete Block Write Disable Block Write State
C ONFIGURING
THE
From the Read/Write Control table, select the row for the table you are configuring and open the Read/Write Information table. For a Read Table Add a table entry for each FactoryLink tag in which data read from the device will be stored when the operation executes. For a Write Table Add a table entry for each tag to be written when the operation executes.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, float, message
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Data Type
Specify the type of data being read from or written to the device for each tag defined in the Tag Name field.
REG Series 5/6 Register Table, 9030, 9070 INPUT Series 6 Input Status Table, 9030, 9070 OUTPUT Series 6 Output Status Table, 9030, 9070 REAL_O Series 6 Real Output points REAL_I Series 6 Real Input points DESC_O Series 6 Internal Discrete Output Reference DESC_I Series 6 Internal Discrete Input Reference DIAG Diagnostic status area 1+_INP 2+_INP Series 5I1+Inputs Series 5I2+Inputs
LC_INP Series 5 Local Inputs SP_INP 1+_OUT 2+_OUT LC_OUT 1-_OUT 2-_OUT EXT_IO INT_IO S_REG D_REG PORT Channel Series 5 Special Inputs Series 5 O1+Outputs Series 5 O2+Outputs Series 5 Local Outputs Series 5 Internal Coils O1Series 5 Internal Coils O2Series 1, 1JR, 1+ and 3 External I\O Series 1, 1JR, 1+ and 3 Internal I/O Series 1, 1JR, 1+ and 3 Shift Registers Series 1, and 3 Data Registers Port ON/OFF
Enter the channel number in the controller on which the address is located.
Valid Entry: 0 - 15
This channel number is valid for Series 6 and the following data types: REAL_O, REAL_I, DESC_O, and DESC_I.
Address Dec
For a read table, enter the address in the devices memory where the value to be stored in this tag is located. For a write table, enter the address in the devices memory to which the tag value will be written.
Valid Entry: 1 - 16384 (decimal address for Series 5 and 6, 9030,
9070)
Address Octal
For a read table, enter the address in the devices memory where the value to be stored in this tag is located. For a write table, enter the address in the devices memory to which the tag value will be written.
Valid Entry: 1 - 10000 (octal address for Series 1, 1+ JR, and 3)
Bit Offset
Name column) associated with this entry is digital, enter the bit
This field is required for digital data type. If the tag (entry in the Tag
offset within the word that contains the value to be read or to which the tag value is to be written. Bit 1 is the most significant bit (MSB) and bit 16 is the least significant bit. Leave this field blank for all other FactoryLink data types.
Valid Entry: 0 - 15
If you enter a FactoryLink digital tag in the Tag Name field and specify the data type as REG, TIMER, or D_REG, the protocol module reads the Bit Offset; otherwise, it is ignored. When the table is complete, click the Save icon to validate the information. Define the data type (digital, analog, long analog, or floating-point) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the General Electric Read/Write Information table:
Field
Table Name Tag Name Logical Station Data Type Channel
Entry
Description
Display only; specifies the Read/Write table name. The value read from the device will be stored in GERDR1. Specifies the path to send the request. Data type for this controller. Specifies the channel in the controller where the address is located. Decimal address of the word being read.
Address Dec
10
error condition.
If you define message tags in the General Electric Logical Station Control table for all logical stations on this logical port, the protocol module copies these error messages in the following format:
GENE read request status: [1]. GE error: [2] GENE read response for write request: [1]. GE error: [2] GENE write response: [1]. GE error: [2]
where
[1]
is one of the message codes 1 - 4 listed in the Single-Digit Error Code Format ER:xxxN table. This message code is displayed as a text string.
[2]
is one of the message codes 1 - F listed in Single-Digit Error Code Format ER:xxNx table. This message code is displayed as a text string.
Example:
GENE read request status: IO_ERROR GE error: RCV_FDB_ERR
This example indicates an input/output error in receiving an FDB message. Single-Digit Codes The following tables list the single-digit error codes that can be generated and displayed by the General Electric protocol module.
Single-Digit Error Code Format ER:xxxN
Code
xxx1 xxx2 xxx3 xxx4
Text String
Description
Transmission error Transmission aborted Invalid transmit message length or transmit buffer too short Unknown error
Code
xx1x xx2x xx3x xx4x xx5x
Text String
Description
Error occurred during transmit Error occurred during receive Error receiving ENQ message Error receiving HDR message Error receiving FDB message
Code
xx6x xx7x xx8x xx9x xxAx xxBx xxCx xxDx xxEx xxFx
Text String
Description
RCV_ACK_ERR XMIT_ENQ_ERR XMIT_HDR_ERR XMIT_ACK_ERR XMIT_FDB_ERR XMIT_NAK_ERR RCV_ENQ_TIMEOUT RCV_HDR_TIMEOUT RCV_FDB_TIMEOUT RCV_ACK_TIMEOUT
Error receiving ACK message Error transmitting ENQ message Error transmitting HDR message Error transmitting ACK message Error transmitting FDB message Error transmitting NAK message Timeout error receiving ENQ message Timeout error receiving HDR message Timeout error receiving FDB message Timeout error receiving ACK message
Double-Digit Codes The double-digit format is displayed in the error strings middle two digits. This format contains a 1 in the hundredths position (ER: x1Nx). The following table lists the double-digit error codes that can be generated and displayed by the General Electric protocol module.
Double-Digit Error Code Format ER:xNNx
Code
x10x x11x
Text String
Description
RCV_EOT_TIMEOUT RCV_EOT_ERR
Chapter 13
The General Purpose Interface (GPI) protocol module provides a communication interface between a FactoryLink application and external devices using asynchronous communication techniques and protocols such as ASCII or binary. The GPI is a general purpose protocol module that was written for no specific external device. The information provided in the Application Programsand Capabilities, Limitations, and Trade-Offssections can help you determine if the GPI is suitable for your application. You can use the GPI protocol module with a variety of devices. To determine the cable connections needed to set up your particular external device, refer to the documentation available from the manufacturer.
A PPLICATION P ROGRAMS
The GPI protocol module provides a set of options and capabilities to support many, though not all, asynchronous devices. The FactoryLink application controls overall transactions, such as retries and error recovery. The FactoryLink application performs the following additional tasks: Defines and implements the general FactoryLink application. Provides correct information in the command tables and ensures the information is triggered at the appropriate time. (For information about command tables, see the Configuring the Command/Response Control Table on page 225.) Monitors the communication response status and FactoryLink data returned from the GPI communication interface. Logs and/or manipulates the data received by the FactoryLink real-time database.
C APABILITIES , L IMITATIONS ,
AND
TRADE -O FFS
The GPI protocol module provides bidirectional asynchronous communications between a FactoryLink application and external devices. The GPI provides a variety of options that allow you to implement many different types of asynchronous protocols at the FactoryLink application level. While it is flexible, the GPI protocol module cannot support every asynchronous protocol. Since the GPI was not written for a specific device, to determine if the GPI is suitable for your particular application, evaluate it based on the information provided in this section. Capabilities The GPI has the following capabilities: Handles more than one protocol at a time. Communicates with more than one device at a time. Makes available a wide selection of checksum routines. Handles up to eight different response formats for an outgoing message. Each response must share the same end-of-response indicator. (For example, if eight response tables define the response formats, each table might have the response data length in field 2). Limitations In general, the GPI has the following limitations: Permits only single handshaking protocols Lacks support for protocols which require checksums to handle special-character sequences Lacks support for protocols which require character substitutions for special-character sequences Trade-Offs and Compromises in Design Any engineering design makes trade-offs and compromises in design. Flexibility was the major goal for the GPI protocol module. This consideration had priority in matters such as speed and ease of use.
A CCESSING
THE
C ONFIGURATION TABLES
Note
Before completing the protocol-specific Allen-Bradley configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58 for details. In your server application, open Device Interfaces > General Purpose Interface.
C ONFIGURING
THE
Open the Logical Station Control table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a device.
Valid Entry: previously defined logical port number (default=0)
(Optional) Enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this logical port.
Valid Entry: tag name Valid Data Type: analog
Baud Rate
Enter the speed at which the protocol module communicates with the devices linked to FactoryLink via this logical. This entry must match the baud rate configuration of the devices. Refer to the device manufacturer's manual for details.
Valid Entry: 110 - 115200 (default=9600)
Parity
Enter the parity error correction during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturer's manual for details.
Valid Entry: odd, even, none (default=none)
Data Bits
Enter the number of data bits used during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturer's manual for details.
Valid Entry: 5, 6, 7, 8 (default=8)
Stop Bits
Enter the number of bits sent after a character to create a pause before the start of the next character. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturer's manual for details.
Valid Entry: 1, 2 (default=1)
Enter the maximum amount of time, in tenths of a second, the protocol module will wait to receive the first character of a device response after an outgoing command table is triggered. For the protocol module to time out, you must enter a value greater than 0.
Valid Entry: 1 - 32000 (default=30 or 3 seconds)
Enter the maximum amount of time, in tenths of a second, the protocol module allows between the reception of two consecutive characters.
Valid Entry: 1 - 32000 (default=30 or 3 seconds)
This field is required for the protocol module to time out while in unsolicited mode. Enter the maximum amount of time, in tenths of a second, the protocol module will wait to receive the first character of a device response after an outgoing command table that puts the GPI in unsolicited mode is triggered. For the protocol module to time out, you must enter a value greater than 0.
Valid Entry: 1 - 32000 (default=30 or 3 seconds)
Specify the size of the buffer required to hold the outgoing message (the response command).
Valid Entry: 256 - 32000 (default=1024 bytes)
Specify the size of the buffer required to hold the incoming response (the response data).
Valid Entry: 256 - 32000 (default=1024 bytes)
(Reserved for future use) Enter a tag name for a digital tag to temporarily disable the sending and receiving of messages to and from devices communicating via this port. When this tag's value is 1, the port is disabled for GPI messages.
Valid Entry: tag name Valid Data Type: digital
CAUTION
During normal operations, disable the Status Debug Level feature. Enable this feature only when debugging an application.
Status/ Debug Level
During normal operations, enter STAT_OFF. When debugging your application, enter either STAT_ON, LOG1, or LOG2 (depending on the desired debug level) to specify how to log: the bytes of the outgoing message just before they are transmitted, the bytes of the incoming response after they are received (before they are parsed). STAT_OFF Reports only analog error values to the LSTA Status Analog Tag tag STAT_ON Reports analog error values and error message text to the screen
LOG1 Performs the functions of STAT_ON and also prints the outgoing and incoming message protocols in hexadecimal bytes LOG2 Performs the functions of LOG1 and also prints the analog error value and error message text to the screen When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog.
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. Complete a row for each device to communicate through this logical port.
LSTA Status Analog Tag
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station). You can animate output-text objects to display the codes stored in an Error/Status Tag Name tag on a graphics screen.
Valid Entry: tag name Valid Data Type: analog
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. Later, you will enter this logical station number in a command or response table to represent the device defined in this row. In a command or response table, this number identifies the device to or from which data is to be sent or received.
Valid Entry: 0 - 999
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box.
If you expect a response from the external device, you must configure separate command and response tables for both the outgoing message and for the incoming response, respectively.
Command Table The command table defines the complete asynchronous communication protocol and processing needed to format an outgoing message to the external device. The commands can be triggered by the FactoryLink application. The entries in the command table consist of the following information: Data from FactoryLink tags Special characters like preamble/postamble strings or delimiters Special processing, such as computed message lengths, checksumming, data format conversions, or mathematical functions If you expect a response to the outgoing message, you must configure the command table to specify one or more other response tables that define the possible responses to the outgoing message. For example, in an outgoing message, the command table initiates either a command or response operation to the external device. It formats (but does not process) any incoming response data. If the command or response operation requires a response from the external device, you must configure this command table to define the end-of-response delimiter of the data from that external device and specify which other table contains the response format. The section Summary of Basic Concepts on page 241 contains a diagram that shows how these concepts relate to one another. Response Table The response table defines the information needed to parse an incoming response to an asynchronous communication (outgoing message). The entries consist of the following information: Data to be parsed out of the response, converted, and returned to FactoryLink tags Special characters like preamble/postamble strings or delimiters Special processing, such as checking embedded message lengths, checksumming, data format conversions, or mathematical functions The GPI parses the incoming response from the external device and matches it to the incoming response formats. The GPI then extracts the relevant data from the incoming response and writes it to FactoryLink tags.
C ONFIGURING
THE
Open the Command/Response Control table. Complete a row for each command or response table you want transmitted to a device. Each row represents a table and includes the table name, table type, and (for a command table) one or more trigger tags.
Table Name
Assign a name to this command or response table. Define one table per line and do not include spaces in the name. You can define as many tables in this table as available memory allows. Try to make the table name reflective of the operation it represents. When the Command Trigger tag is forced to 1 (ON), FactoryLink processes this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Enable Response
For EDI to interpret this table as an outgoing command, accept the default of NO. For EDI to interpret this table as an incoming response, enter YES or FORCE to indicate whether all change-status indicators are to be set to 1 (ON) when an incoming response occurs, or just the ones for values that have changed. If you enter YES, the incoming message will be processed as specified in the GPI Command/Response Information table. The message will serve as a valid check against the incoming data response and change-status indicators will only be set for tags with values that have changed since the last incoming response; that is, if the current value of the tag is equal to the new value, the change-status indicator is unaffected. If a different value is being stored the tag, however, it will overwrite the current value and the tag's change-status indicator will be set to 1 (ON). If you enter FORCE, the incoming message will be processed as specified in the GPI Command/Response Information table. The incoming data is stored and the change-status indicator in each tag is automatically set to 1, regardless of whether the current value matches the new value; that is, if the values have not changed since the last incoming response, the indicators are still set.
Valid Entry: yes, no, force (default=no)
Command Priority
If this is an outgoing command table, enter a number to indicate the priority of this table, relative to other command tables. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of command tables. If EDI receives two tables at the same time, it processes the one with the highest priority first. If this is an incoming response table, accept the default of 1. This field defaults to 1 regardless of whether the table being defined is for a command or for a response.
Valid Entry: 1 - 4 (default=1)
Note
The Command Trigger, Command Disable, Command Sent, and Command Complete tags apply only to outgoing messages. Do not define these tags for incoming responses.
Command Trigger
If this is an incoming response table, ignore this field. If this is an outgoing command table, this field is required. Enter a tag name for a digital tag to initiate the operation defined in the Command/Response Information table. When this tag's value is forced to 1 (ON), FactoryLink processes the table.
Valid Entry: tag name Valid Data Type: digital
Command Disable
If this is an incoming response table, ignore this field. If this is an outgoing command table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable the operation defined in the Command/Response Information table. When this tag's value is forced to 1 (ON), the operation is not executed, even when the Command Trigger tag is set to 1.
To reenable a command table that is disabled, set this tag back to 0 (OFF).
Tip
The Command Disable tag can be used to disable a command table that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered command table, the Command Trigger tag must be toggled or forced to 1.
Valid Entry: tag name Valid Data Type: digital
Command Sent
If this is an incoming response table, ignore this field. If this is an outgoing command table and you need a digital tag to indicate when this operation is complete, this field is optional. Enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this table's Command/Response Information table is written to the device, the Command Sent tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
Command Complete
If this is an incoming response table, ignore this field. If this is an outgoing command table and you need a digital tag to indicate the state of this operation (in progress or complete), this field is optional. Enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the data defined in this table's Command/Response Information table is written to the device, the Command Complete tag is forced back to 1. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
Logical Station
This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs. If this is an incoming response table, enter the number representing the device sending the response back to the GPI protocol module. If this is an outgoing command table, enter the number representing the device to which the operation defined in the Command/Response Information table will be sent.
Valid Entry: previously defined logical station number
When the table is complete, click the Save icon to validate the information.
C ONFIGURING
THE
You can configure the GPI Command/Response Information table for commands that can be triggered by the FactoryLink application. Each GPI Command/Response Information table defines the complete communication protocol and the processing needed to format one outgoing message to the external device. In addition, the GPI Command/Response Information table identifies one or more responses to the communication. The entries in the GPI Command/Response Information table consist of data from FactoryLink tags; special characters such as preamble/postamble strings or delimiters; and special processing such as computed message lengths, checksumming, data format conversions, or mathematical functions. Each line of the GPI Command/Response Information table specifies one of the following GPI functions: Defines a field of the outgoing message or incoming response Modifies a previously defined field Specifies a method to detect the end-of-expected-response to the outgoing message in this table Defines STAT_TAG tags to report the status of transactions Defines the connector (unique response ID) between the outgoing message and its plausible incoming response For a diagram of these relationships, see Associating an Outgoing Message with an Incoming Response on page 247.
CAUTION
To satisfy current EDI task requirements, you must configure at least one FactoryLink tag for each GPI Command/Response table. FactoryLink tags associated with the STAT_TAG option of the GPI do not satisfy this EDI task requirement.
When you configure a GPI Command/Response table, to satisfy current EDI task requirements, do one of the following things: Enter TAGVALUE in the Field Type column. The tag name associated with this field satisfies the EDI task requirement. Enter STRING, NUMERIC, or PROCESS in the Field Type column, and a dummy FactoryLink tag name in the Tag Name column. The GPI will ignore this FactoryLink dummy tag. In a command table, if you configure the GPI for the unsolicited mode, enter STRING in the Field Type column, 0 (zero) in the Field Length column, and a dummy FactoryLink tag name in the Tag Name column. For further information about configuring the GPI for the unsolicited mode, see Putting the Protocol Module in Unsolicited Mode on page 251. From the Command/Response Control table, select the row for the table you are configuring and open the Command/Response Information table. Use this table to define an outgoing message (command) to a device or the parameters of an expected incoming response from a device.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, longana, float, message
Field Type
Specify either the source of the field value, an end-of-response, the command/ response table link, the debug status of the outgoing message or incoming response, or notification to the application that database updates for the response are done. To determine what to enter, use the following descriptions:
The field's value comes from the tag specified in the Tag
The field's value is specified in the Constant String column for this row.
The field's value is specified in the Constant Numeric column for this row. The field's value is the whole, unparsed response. Define a tag name for a message tag in the Tag Name column for this row. PROCESS is only valid in a command table. The field's value is the result of some computation or processing at run time. Define this computation in the Process Function column for this row.
PROCESS
To specify the end-of-response: RESP_FXD If the expected response is known in advance, in the Field Type column for this row, enter RESP_FXD. In the Response LN, POS, TM column, enter the length of the expected response. If the length of the expected response is not known in advance but is given in the incoming response itself, in the Field Type column for this row, enter RESP_VAR. In the Response LN, POS, TM column, enter the position of the byte giving the response length. If the entire response can be received in a reasonable amount of time, in the Field Type column for this row, enter RESP_TM. In the Response LN, POS, TM column, enter the response time. If the expected response is terminated by a string of special characters, in the Field Type column for this row, enter RESP_STR. In the Constant String column, enter the string.
RESP_VAR
RESP_TM
RESP_STR
To specify a command/response table link: RESP_ID Enter RESP_ID when specifying a unique response format identification number that identifies the command/response tables in which the protocol module compares a received response with associated response formats. While you can reference up to eight IDs, the incoming response can define only one. To indicate which response format from a GPI Command/Response Information table to use to parse the reply to this command, complete the Response ID field. For more information, see Associating an Outgoing Message with an Incoming Response on page 247.
To specify the debug status: STAT_TAG For each outgoing message and incoming response, configure an analog tag and a message tag. The analog tag reports a numeric value. The message tag reports an informative message. Enter STAT_TAG in the Field Type column and the tag name in the Tag Name column.
To specify application notification of response data completion: DB_DONE (Optional) This field allows you to enter the name of a tag to be set to 1 (one) when the response message is processed. The specified tag is set after any values extracted from the incoming message are returned or any status tag is updated with the result of processing (as the result of a STAT_TAG entry). Note that because of the DB_DONE tag is only set when tag values are updated, it cannot be used with a response packet type of MULT_RSP (see definition of Response Packet). Allowed DB_DONE tag types are digital, analog, float, long analog, or message. The tag is set to 1 or 1 for a message tag. It is the responsibility of the application to clear the tag if required.
Field Pos.
Enter a decimal number to identify this field's position in the completed communication message.
Valid Entry: 1 - 999
Enter a decimal number that defines the specific bit of a byte. In general, you can map up to eight digital tags into a single byte of the outgoing message, or map eight bits of an incoming response to eight FactoryLink digital tags.
Valid Entry: 1 - 8
Process Function
If you enter PROCESS in the Field Type column, this field is required. Define the process function and the scope of that function. Process functions perform specific operations on specified fields of a table. For a complete list of process functions and descriptions, see Using Process Functions on page 254.
Fld#
If you enter PROCESS in the Field Type column, this field is required. Specify a number to indicate the starting range of decimal field numbers over which the process function operates. For example, to compute the exclusive-or (XOR) function for fields 1 through 10 (inclusive), enter XOR in Process Function column, l in the first Fld# column, and 10 in the second Fld# column. The numbers 1 and 10 define the range of fields over which the XOR function is computed.
Valid Entry: 1 - 999
Arg.
If you enter PROCESS in the Field Type column, this field is required. Specify a decimal value to be used as a process function argument. For example, for the process function SLxx (shift left xx-bit positions), enter SL in the Process Function column and xx (a decimal number) in the Arg column.
Valid Entry: -32768 - +32767
Conversion Function
Specify the conversion performed on this field after its value is obtained from a FactoryLink tag (as the result of a process function operation) or from incoming data from an external device or process function.
Valid Entry: For a list of possible conversion functions, see
Format String
If you enter TSPRINTF in the Conversion Function column, this field is required. Specify information about formatting the field of an outgoing message.
Valid Entry: alphanumeric string of up to 16 characters
Response ID
If you enter RESP_ID in the Field Type column, this field is required. Define a unique numeric identifier that specifies which response format from a GPI Command/Response Information table to use to parse the reply to this command. Every incoming response defines one unique identifier (ID). Every outgoing message references from 1 to 8 response Ids.
Valid Entry: 1 - 255
If you enter RESP_FXD, RESP_VAR, RESP_TM, or RESP_STR in the Field Type column, this field is required. Define the length, position, or timeout of the expected response. Depending upon the conditions, you might also need to enter information in the Field Type column, the Constant String column, or both.
Valid Entry: 1 - 999
If...
Enter...
You know the expected response length in advance You do not know the response length in advance but it is given at the beginning of the response The end of response must be detected by the protocol module from a string of special characters It is not possible to specify the length of the response or a terminating string for the response
RESP_FXD in the Field Type column, and the response length in this column RESP_VAR in the Field Type column, and the position of the byte specifying the length in this column RESP_STR in the Field Type column, and the string of special characters in the Constant String column RESP_STR in the Field Type column, and RESP_TM in the Field Type column
Response Packets
If you enter RESP_FXD, RESP_VAR, RESP_TM, or RESP_STR in the Field Type column, this field is required. Specify how an incoming response is grouped when it returns to the GPI protocol module: NO_RSP You expect no response. If you enter NO_RSP, for the GPI protocol module to process the table, enter RESP_FXD, RESP_VAR, RESP_TM, or RESP_STR in the Field Type column. The protocol module will ignore the Field Type entry. SNGL_RSP You expect a single-packet response. GPI processes the received response and returns it to FactoryLink in a single packet. MULT_RSP You expect a multiple-packet response. GPI queues the entire received response in its internal buffer for later retrieval via the BUFR_RSP delimiter in a different outgoing message. BUFR_RSP GPI processes buffered response data and returns it to FactoryLink; repeated calls may be necessary to take information from the internal buffer.
Constant Numeric
(Optional) If the entry in the Field Type column is NUMERIC, define a field value in an outgoing message or a delimiter to parse/match in the incoming response.
Valid Entry: 0 - 32657
Constant String
(Optional) If you enter STRING or RESP_STR in the Field Type column, define a field value in an outgoing message or a delimiter to parse/match in the incoming response.
Valid Entry: alphanumeric string of up to 30 characters
Comment
When the table is complete, click the Save icon to validate the information.
F LEXIBILITY
AND
D ESIGN
OF THE
GPI
The primary goal in designing the GPI protocol module was the flexibility to use it with a variety of external devices. In simple terms, the outgoing message from the communication port is just a series of bytes. To describe each byte, the GPI needs to know only the bytes value and its position in the message. Enter the following information in the columns of the command tables you configure to describe these bytes: The Field Type, which specifies where to obtain or enter the fields value The Field Pos, which specifies the fields position in the outgoing message or incoming response
Note
Throughout this chapter, the term column refers to areas for data within the GPI configuration tables, and the term field refers to the fields of a communication message. When you enter information in the columns of a command or response table, you are configuring an outgoing message or an incoming response containing fields that are composed of bytes. If you do not know the value of a field or byte at configuration, the value must be calculated at run time. If you know the value at configuration, then specify it as a constant (numeric or string). If the fields value must be calculated at run time, the value must come either from a FactoryLink tag or from the result of a calculation on other fields. For example, a checksum value may be the result of an exclusive-or (XOR) on the bytes of an outgoing message. See Using Process Functions on page 254 for further information about the process function XOR.
F ORMATTING
AN
O UTGOING M ESSAGE
The following components typically comprise the format of the outgoing message: Preamble Device Address Data Checksum Postamble The next sections provide the following information for these components: A diagram of the format and sources of information in the outgoing message A discussion of the field entries A sample GPI Command/Response Information table for a command table Format and Sources of Information in the Outgoing Message The outgoing message illustrated in the following diagram consists of several parts, including Preamble, Device Address, Data, Checksum, and Postamble. (The term checksum refers to all error checking schemes, such as CRC, LRC, and Modulo 256.) The illustration describes only one possible scenario. In this diagram, the breakdown of the outgoing message into fields and the length of each field is provided to clarify and to demonstrate the various parts of an outgoing message. Using other features of the GPI, you could construct other divisions or combinations.
The fields described in the following table correspond to the fields in the outgoing message illustrated in the previous diagram.
Field Description
Field 1
Field 2 Field 3
Field 4 Field 5
One-byte constant used as the start-of-command character, STX; the Preamble is a special character whose value you know at configuration. Two-byte Device Address whose value comes from the analog tag, ATAG. One-byte digital Data field consisting of 8-bits where only bit6, bit4, and bit2 change during the command; these correspond to digital tags DTAG6, DTAG4, and DTAG2, respectively. The other bits do not change. Four-byte Data area whose value comes from the floating point tag, FTAG. Ten-byte Data area whose value comes from the message tag, MTAG.
Field
Description
Field 6
Field 7
One-byte Checksum whose value is computed using process function XOR (exclusive-or) on the bytes of fields 2 through 5, inclusive. Except for the preamble and postamble fields, this will be the XOR of all bytes of the message. One-byte end-of-command character, ETX; at configuration, you know the value of the special character Postamble is a special character.
Sample Information Table for a Command Table The format and sources of information for the outgoing message establish a basis for understanding the entries in the table below.
Tag Name Field Type Field Pos Field Len Bit Pos. Process Funct. Fld# Fld# Arg. Constant Numeric Constant String Comment
STRING atag dtag2 dtag4 dtag6 ftag mtag * TAGVALUE TAGVALUE TAGVALUE TAGVALUE TAGVALUE TAGVALUE PROCESS
1 2 3 3 3 4 5 6
1 2 1 1 1 4 10 1
* * 2 4 6 * * *
* * * * * * * XOR
* * * * * * * 2
* * * * * * * 5
* * * * * * * *
* * * * * * * *
\x02 * * * * * * *
STRING
\x03
ETX
For simplification purposes, some of the columns in this table are omitted. For a complete GPI Command/Response Information table, see Configuring the Command/Response Control Table on page 225. Note: An asterisk (*) indicates an entry the GPI does not need and will not use.
D EBUGGING TOOLS
The following tools aid you in debugging the application. Status/Debug Levels When enabled, this feature logs information about the steps the GPI protocol module takes to compose each outgoing message and to parse each incoming response. You can use the logged information to debug the application. Disable this feature during normal operations. The following table describes the various levels of status/debug information logged or displayed:
Debug Entry Description
Reports only analog error values to the tag Reports analog error values and message error text to the FactoryLink tag Reports STAT_ON plus prints the outgoing and incoming messages in hexadecimal bytes to the screen Reports LOG2 plus prints the analog error value and error message to the screen
For further information about the Debug/Status Level, see the Configuring the Command/Response Control Table on page 225. RAW VALUE This feature allows up to 255 bytes of the incoming response to be read into a FactoryLink message tag before parsing the response.
STAT_TAG This feature provides alphanumeric status information at different stages of the GPI response or command operation. This information is then passed on via FactoryLink analog and message tags.
S UMMARY
OF
B ASIC C ONCEPTS
The following summarizes the basic concepts of the GPI protocol module: An outgoing communication message is made up of bytes. When constructing this outgoing message, the value and position of these bytes is of major concern. The value of the bytes is either known at the time of configuration or the value is obtained at run time. The position of each field/byte is always known at configuration. The format of the outgoing message is described to the GPI protocol module via an outgoing message configured in a command table. The format of the incoming response is described to the GPI protocol module via an incoming response configured in a response table. At configuration, through unique identifiers (IDs), you correlate the command and response tables. The following diagram illustrates how to configure two GPI Command/Response tables for an expected response and how to link these tables together with a unique ID (configured in the ID field of the GPI Command/Response Information table).
External Device
Response
GPI F UNCTIONS
This section describes the functions of the GPI protocol module and shows the relationships among the different columns of the GPI configuration tables. The sample tables omit some fields to simplify some of the discussions in this section. See Configuring the Command/Response Control Table on page 225 for complete descriptions of the entries in the GPI configuration tables. Principles of Operation You must configure the GPI Command/Response tables with the following information to enable communications to occur between a FactoryLink application and an external device via the GPI protocol module: The format of the outgoing message The format of the incoming response from the external device Configuring the GPI Command/Response tables requires an understanding of the external device protocol and the options that the GPI protocol module provides. The GPI Command/Response table describes the external device protocol to the GPI in a language the GPI understands. The GPI provides this language as a set of tools for you to use to set up communications. Defining the Outgoing Message Defining the outgoing message involves completing specific columns in the GPI Command/Response Information table for the command table, including specifying packet responses you expect to receive from the external device.
Completing the Command/Response Information Table
You need to define an outgoing message in a command table if your application requires that the GPI protocol module request data from an external device. This puts the GPI protocol module in the solicited mode. See Putting the Protocol Module in Unsolicited Mode on page 251 for information about the unsolicited mode.
Use the following columns in the GPI Command/Response Information table to define the message in the command table for the outgoing message.
Field Type
STRING String entered at configuration. PROCESS Computed value entered at run-time through use of a predefined process function, such as XOR (exclusive-or). RESP_ID Unique number assigned to the outgoing message Response ID which matches an incoming messages Response ID field. RESP_VAR Response length (in bytes) is given in the response itself; byte position for the response length is defined in the Response LN, POS, TM field and the type of packet in the Response Packets field. RESP_STR Response has a special terminating character defined in Constant field (such as POSTAMBLE EXT.). RESP_FXD Response length (in bytes) is known at configuration; number of bytes is defined in the Response LN, POS, TM field. RESP_TM Response received in a specified amount of time; the response time is defined in the Response LN, POS, TM field.
Field Pos Field Len Process Function Constant Numeric Constant String
Specifies the sequence of the bytes in the outgoing message (external device protocol). Specifies the size of the field in bytes. Specifies the operations performed to produce results which will be substituted for a defined field. Specifies a value used in an outgoing message. Specifies a string used in an outgoing message.
Use the following columns in the outgoing message command tables GPI Command/Response Information table to specify packet responses.
Field Type
Specify an entry (RESP_FXD, RESP_VAR, RESP_TM, or RESP_STR) in the Field Type column for each entry in the Response Packets column.
Response Packet
In the command table, specify which of the following types of response packets you expect to receive from the external device: No response If you do not expect a response to the outgoing message, do not configure a response table (so there will be no unique response identifier). Single-packet response If you expect a single-packet response, the GPI protocol module can return the entire incoming response to the FactoryLink real-time database as the response to a single outgoing message. Multiple packet and buffered responses If you expect a multiple-packet response, the collection of data may be too large for a single response table (incoming message) to handle. To transfer large amounts of data to the FactoryLink real-time database from the GPI internal buffers, you may need to trigger the response table several times. To do this, enter MULT_RSP in the Response Packet column of the outgoing message. The MULT_RSP command sets up the queues for the internal buffer but returns no packets until another outgoing message with BUFR_RSP is triggered. Repeat this triggering as needed until the GPI processes all the buffered data in the Response Packet column. The table below describes the valid entries for the Response Packet column in the GPI Command/Response Information table of a command table:
Note
If you enter NO_RSP, you must also enter an End-of-Response indicator (RESP_FXD, RESP_VAR, RESP_TM, or RESP_STR) in the Field Type column for the protocol module to process the table. (The protocol module will ignore this Field Type entry.)
Description
Expects no response to the outgoing message. Processes the received response and returns it to FactoryLink all at once. Queues the entire received response in its internal buffer for later retrieval via the BUFR_RSP delimiter. Returns no data to FactoryLink at this time. Processes buffered response data and returns it to FactoryLink; repeated calls may be necessary to take all information from the internal buffer.
BUFR_RSP
Formatting the Incoming Response Use the following columns in the GPI Command/Response Information table to define the format of the expected response from the external device in the response table for the incoming response: Field Type Field Pos Field Len Conversion Function Response Packets Constant Numeric Constant String Define the format of the incoming message (the expected response) in the GPI Command/Response Information table for the response table using tags so the GPI can return the response to the FactoryLink database. Like the outgoing message, the incoming response is composed of fields or bytes. Indicate the position of each field of the incoming response by configuring the position in the Field Pos column of the response tables GPI Command/Response Information table.
Configure the incoming response using the following guidelines: If you know the field length, enter the length in bytes in the Field Len column. If you do not know the field length, enter a -1 in the Field Len column and a delimiter in the Constant String column. If the fields value is to be returned to FactoryLink, enter the keyword TAGVALUE in the Field Type column and a tag name in the Tag Name column. If the field type is NUMERIC or STRING, then the GPI protocol module parses the field as a response delimiter and expects to find the content of the field in the Constant Numeric and Constant String columns. See Defining the Outgoing Message on page 243 for further information about entries for the columns of the incoming response. Associating an Outgoing Message with an Incoming Response Use the Field Type and Response ID columns in the GPI Command/Response Information table to associate an outgoing message with its incoming (expected) response: In the GPI Command/Response Information table, for the outgoing message and incoming response, enter an identification (ID) number in the Response ID column and the keyword RESP_ID in the Field Type column. Assign each response format a unique identification (ID) number. If a GPI Command/Response Information table for a command table that defines an outgoing message contains more than one RESP_ID entry, use a different ID for each response. The GPI protocol module compares the received response with all response formats associated with the RESP_ID in the GPI Command/Response Information table for the corresponding response table (incoming response) and processes it appropriately. In the GPI Command/Response Information table for the command table, you can reference up to eight ID numbers; the incoming response can define only one. This relationship is illustrated in the following diagram.
Outgoing Message Tables Outgoing Message Format Response IDs: 1, 21, 50, 63, 65, 66, 97, 108 Outgoing Message Format Response IDs: 1, 65 Outgoing Message Format Response IDs: 21, 63, 66
Incoming Response Tables Incoming Response Format Unique Response ID: 1 Incoming Response Format Unique Response ID: 21 Incoming Response Format Unique Response ID: 50 Incoming Response Format Unique Response ID: 63 Incoming Response Format Unique Response ID: 65 Incoming Response Format Unique Response ID: 66 Incoming Response Format Unique Response ID: 97 Incoming Response Format Unique Response ID: 108
Specifying Methods to Detect an End-of-Response Use the following columns in the GPI Command/Response Information table for the command table defining the outgoing message to specify various methods to detect an end-of-response. Field Type Response LN, POS, TM Constant Numeric Constant String Define how the GPI protocol module detects an end-of-response for each outgoing message. In the Field Type column of the GPI Command/Response Information table, enter one of the end-of-responses described; if indicated, also enter corresponding information in the Response LN, POS, TM column:
RESP_FXD
If the external device returns a fixed response, enter RESP_FXD in the Field Type column. In the Response LN, POS, TM column, enter the length of the response in bytes. To determine the type of response, refer to documentation for your specific external device. If the external device returns a variable length response, enter RESP_VAR in the Field Type column. In the Response LN, POS, TM column, enter the byte position in the response that specifies the number of bytes to follow before you reach the end of the response. To determine the type of response, refer to documentation for your specific external device. If the GPI receives the response length in a reasonable amount of time, enter RESP_TM in the Field Type column. Also, enter the response time in the Response LN, POS, TM column. If special characters terminate the response, enter RESP_STR in the Field Type column. Also, enter the special characters in the Constant String column.
RESP_VAR
RESP_TM
RESP_STR
Non-Printable or Do Not Care Characters Use the following columns in the GPI Command/Response Information table in both the outgoing message and the incoming response for non-printable or do not care characters: Format String Constant Numeric Constant String If you enter a string containing non-printable or do not care characters in the Constant String column, it can be used in these different ways: To detect the end-of-response (in conjunction with the RESP_STR option) As a field delimiter (with the STRING option in a GPI Command/Response Information table) Characters in a string may be one of the following types: Printable characters if all characters of the string are printable, simply enter the string as it appears. For example, if the string is ABCD, enter ABCD. Non-printable characters if one or more of the characters in a string are non-printable, enter \x followed by the Hexadecimal ASCII value of the character. For example, using this format, the string A, B, followed by the non-printable characters EOT, ending with D, F, becomes AB\x04DF. (04 is the hexadecimal ASCII value of EOT.)
Note
After the entry \x, you must enter two hexadecimal digits.
The following table lists special non-printable characters used with the GPI protocol module.
Non-Printable Characters
\t or \T \n or \N \r or \R \\
A response can be terminated by a special string of characters; some are fixed and some are variable (such as a checksum). Use the fixed characters to detect the end of a response, but ignore the variable characters. Treat the variable characters like do not care characters and enter \xxx in the variable characters position(s) in the string. Initiating a Transmission Use the Command Trigger column in the outgoing message command tables GPI Command/Response Control table to initiate a transmission. To initiate the transmission of an outgoing message, trigger the command tables GPI Command/Response Information table that defines the outgoing message. Putting the Protocol Module in Unsolicited Mode Use the following columns in the outgoing message command tables GPI Command/Response Information table to put the protocol module in the unsolicited mode: Field Type Format String Response Packets Response ID If your application requires that the GPI receive data from an external device without requesting it, then you must configure and trigger a GPI Command/Response Information table with no field positions specified in a manner that sends a zero (0) length command. (See Configuring the Command/Response Information Table on
page 229 for additional information.) In other words, do not build an outgoing message. This puts the GPI in unsolicited mode. For the outgoing message, enter the same response format information as required for a solicited table. RESP_ID describes which command/response tables to use for parsing the response RESP_FXD, RESP_VAR, and RESP_STR describes how to detect the end-of-response SNGL_RSP, and MULT_RSP describes the type of incoming response For information about putting the protocol module in solicited mode, see Defining the Outgoing Message on page 243. Reporting Message Status Use the following columns in the GPI Command/Response Information table to report the status of the outgoing message or the incoming response: Tag Name Field Type If you configure the proper tags, the GPI can report the status of each outgoing message or incoming response to FactoryLink. To do this, for each outgoing message or incoming response, configure two tags one analog and one message which are defined in the following manner: The message tag reports information about status of the outgoing message or incoming response. The analog tag reports a numeric value and can be used in Math and Logic applications. See the Task Configuration Reference Guide for more information.
Enter the tag name in Tag Name column of the GPI Command/Response Information table and the keyword STAT_TAG in the Field Type column. Define a separate set of tags for each outgoing message and incoming response.
Note
Use different tags for the STAT_TAG entry for different tables. If you use the same set of tags for the STAT_TAG in different tables, information from one table overwrites information from another table. Converting a Fields Value Use the following columns in the GPI Command/Response Information table in both the outgoing message and the incoming response to convert a fields value: Tag Name Field Type Field Pos Field Len Conversion Function In an outgoing message, the values of a field come from two sources: During configuration, as a constant At run time, from a FactoryLink tag Before substituting these values in a field, convert them to a required format using the conversion functions. For example, if the device protocol requires ASCII conversion, the binary value of a field whose source is a FactoryLink tag can be converted to ASCII before transmission. In the incoming response, when parsing the received response and returning values to FactoryLink, similar conversions are possible. For a complete list of conversion functions, see Using Conversion Functions on page 274.
Calculates the length of the range of bytes between the first Fld#, inclusive and the second Fld# and substitutes the result for the current field. Calculates the exclusive-or (XOR) of the range of bytes between the first Fld#, inclusive and the second Fld# and substitutes the result for the current field. Adds the value given in Arg. to the value in the current field.
XOR
ADD
For further information about each process function, see Using Process Functions on page 271. Associating a Digital Tag to a Bit Use the following columns in the GPI Command/Response Information table in both the outgoing message and the incoming response to associate a digital tag to a bit: Tag Name Field Type Field Len Bit Pos
In the outgoing message and the incoming response, you can associate a FactoryLink digital tag to a bit and can also map up to eight FactoryLink digital tags into a single byte. To link a digital tag to a bit of a field, enter the FactoryLink digital tag in the Tag Name column of the GPI Command/Response Information table, and the position of the bit (1 through 8) in the Bit Pos column. For all digital tags accessing the same byte, the field position will be the same. Enter one (1) in the Field Len column.
Note
Bit 1 is the LSB (Least Significant Bit) and bit 8 is the MSB (Most Significant Bit) of the byte. Determining the Sources of Field Values To determine the sources of field values, use the following columns in the GPI Command/Response Information table in both the outgoing message and the incoming response: Tag Name Field Type Process Function Constant Numeric Constant String
Note
For the incoming response, the Process Function is not valid. If you know the value of a field at configuration, then you can specify it as a numeric constant or string constant. If the value must be determined at runtime, then it either comes from a FactoryLink tag or results from a calculation. For example, an LRC value is the result of XOR (exclusive-or) on specific bytes of an outgoing message.
Known at configuration
NUMERIC or STRING for Field Type, and the specific value of the field for Constant Numeric or Constant String TAGVALUE for Field Type, the tag name for Tag Name, and the length of the field for
Field Len
Extracted from a FactoryLink tag at run-time Computed Returned to FactoryLink from data from the device
PROCESS for Field Type, and the process function in the Process Function column TAGVALUE in Field Type column, the FactoryLink tag name in Tag Name column, and the length of the field in the Field Len column
Modifying a Previously Defined Field Use the following columns in the outgoing message command tables GPI Command/Response Information table to modify a previously defined field: Tag Name Field Type Process Function By making multiple entries that reference the same Field Position column in the command table, you can modify the same field more than once. For example, use the process function LEN to calculate the number of bytes in a range of fields. Enter the result in the field being defined. Finally, use either the process function ADD or SUB to add or subtract a number from this value. For further information about process functions, see Using Process Functions on page 271.
GPI C ONFIGURATION
This section illustrates how to configure an outgoing message for the GPI to communicate with the PMD 300 Programmable Message Display. Configuration Example This section provides configuration table entries for an outgoing message from the GPI and for an expected incoming response from a PMD 300 programmable device. The outgoing message contains instructions for displaying operator messages. The incoming response parameters and tags prepare FactoryLink for the expected reply from the device. The PMD 300 is an intelligent, alphanumeric display table that interfaces with any type of controller. The device provides complete information about machine or process diagnostics, operator prompting, and fault indications. For further information about the PMD 300, refer to the manufacturers documentation.
Command/Response Information Table Entries The Command/Response Information table entries illustrated in this section instruct the GPI device protocol module to display a message on a PMD 300 display table. For an explanation of the outgoing message format for the PMD 300 device, see Defining the Outgoing Message to the GPI on page 267.
Entries for the Outgoing Message Table
The following series of tables lists, by row, sample Command/Response Information table entries for an outgoing message table, OUTGOING_MSG. In this section, the entries are presented in several tables to accommodate the numerous table entry columns.
Table Name: OUTGOING_MSG
Field Tag Name Field Type Field Pos. Field Len. Bit Pos....
NUMERIC PROCESS NUMERIC NUMERIC NUMERIC NUMERIC PROCESS cb1_0 (digital) cb1_4 (digital) cb1_6 (digital) cb2_4 (digital) TAGVALUE TAGVALUE TAGVALUE TAGVALUE
1 2 3 4 5 6 7 8 8 8 9
1 1 1 1 1 1 1 1 1 1 1
Field Tag Name Field Type Field Pos. Field Len. Bit Pos....
cb2_6 (digital) cb3_0 (digital) cb3_1 (digital) cb3_2 (digital) cb3_3 (digital) cb3_4 (digital) cb3_5 (digital) cb3_6 (digital) scrlmsg (message)
9 10 10 10 10 10 11 12 13
1 1 1 1 1 1 56 1 1
Process Function Tag Name... ...Process Function Range Arg.... Fld# Fld#
Process Function Tag Name... ...Process Function Range Arg.... Fld# Fld#
LEN
13
LEN cb1_0 (digital) cb1_4 (digital) cb1_6 (digital) cb2_4 (digital) cb2_6 (digital) cb3_0 (digital) cb3_1 (digital) cb3_2 (digital) cb3_3 (digital) cb3_4 (digital) cb3_5 (digital) cb3_6 (digital) scrlmsg (message)
11
Process Function Tag Name... ...Process Function Range Arg.... Fld# Fld#
XOR ONESCOMP
2 12
11
cb2_4 (digital) cb2_6 (digital) cb3_0 (digital) cb3_1 (digital) cb3_2 (digital) cb3_3 (digital) cb3_4 (digital) cb3_5 (digital) cb3_6 (digital) scrlmsg (message)
170
16 2 2 1
cb1_0 (digital) cb1_4 (digital) cb1_6 (digital) cb2_4 (digital) cb2_6 (digital) cb3_0 (digital) cb3_1 (digital) cb3_2 (digital) cb3_3 (digital) cb3_4 (digital) cb3_5 (digital) cb3_6 (digital) scrlmsg (message)
Ctrl Byte 1 Ctrl Byte 1 Cntrl Byte 1 Ctrl Byte 2 Ctrl Byte 2 Ctrl Byte 3 Ctrl Byte 3 Ctrl Byte 3 Ctrl Byte 3 Ctrl Byte 3 Ctrl Byte 3 Ctrl Byte 3 Scroll Message
Exclusive-Or Ones Complement sngl_rsp Response Variable Response ID stat_msg (message) stat_ana (analog)
Entries for Incoming Response Table
The following series of tables lists sample Command/Response Information table entries for an incoming response table, INCOMING_RSP, that defines parameters for the various types of expected PMD 300 replies to the outgoing message defined in OUTGOING_MSG.
Field Tag Name Field Type Field Pos. Field Len. Bit Pos....
NUMERIC length uaddr TAGVALUE TAGVALUE NUMERIC reply error cksum TAGVALUE TAGVALUE TAGVALUE RESP_ID astring mstring STAT_TAG STAT_TAG
1 2 3 4 5 6 7
1 1 2 1 1 1 2
Process Function Tag Name... ...Process Function Range Arg.... Fld# Fld#
length uaddr
reply
Process Function Tag Name... ...Process Function Range Arg.... Fld# Fld#
error cksum
astring mstring
Conversion Function Tag Name... ...Conversion Function Format String Response Response ID Response LN, POS, TM...
astring mstring
Hex AA Length Unit Address Place Holder (Delimiter) Reply Code Error Code Error Checking Response ID
astring mstring
Defining the Outgoing Message to the GPI The field entries described below are for the sample GPI configuration:
1 2
One-byte numeric constant with a value of 170 (Hex AA). Size equals the length of the entire outgoing message except for the first byte (Hex AA). The process function LEN calculates the number of bytes in Fields 2 - 13 (inclusive). Use the result of the calculation as the value of the second field of the outgoing message. One-byte numeric types whose values you know at configuration. Enter their corresponding values in the Constant Numeric column.
3, 4, 5, 6
The length of the string to be displayed on the device plus the number of control bytes. Three control bytes occupy fields 8, 9, and 10. The LEN process function calculates the number of bytes of fields 7 - 11 (inclusive). The result is the value of Byte 7. These are control bytes. The PMD 300 customizes the string displayed on its screen using the value of these control bytes. The FactoryLink application controls the PMD device's capabilities by linking various digital tags (up to eight per byte) to individual bits of these control bytes. This provides much flexibility at the application level. This example defines the digital tags in the following manner: The FactoryLink application links three digital tagsCB1_0, CB1_4, and CB1_6to bits 1, 5, and 7 of field 8 (control byte 1). The FactoryLink links two digital tagsCB2_4 and CB2_6to bits 5 and 7 of Field 9 (control byte 2). (Field 7 in this example is the second control byte for the PMD 300 protocol.) The FactoryLink application links seven digital tagscb3_0, CB3_1, CB3_2, CB3_3, CB3_4, CB3_5, and CB3_6to field 3 (control byte 3).
8, 9, 10
11
TAGVALUE. The FactoryLink message tag SCRLMSG, which is 56 bytes long and linked to field 11, contains the string that the PMD 300 will display on screen. Process functions that calculate the checksum using the PMD 300 protocol. Field 12 is the exclusive-or (XOR) of all the bytes from fields 2 - 11 (inclusive); therefore, use process function XOR on this range of fields. Field 13 is the one's complement of the previous field. The following three entries for the sample GPI configuration do not require field positions:
12, 13
The unique response ID is 111. Single packet response; length is the second byte of the response data. FactoryLink message tag STAT_MSG and analog tag STAT_ANA.
Defining Response Termination and Status Tags The PMD 300 example illustrates how to define response termination and status tags. The GPI protocol module then relays this status/error information about the outgoing message which is transmitted to the device. In the Field Type column of the PMD 300 GPI Command/Response table, the single-packet response, SNGL_RSP, specifies a variable-length response. According to the PMD 300 protocol, the second byte of the response specifies the length of the response. For the GPI protocol module to detect the end-of-response, enter a 2 (for the second byte) in the Response LN, POS, TM column. The number of bytes in the response begins with third byte. In the Response Packet column, the single-packet response SNGL_RSP is an example of a common response. The next line in the table matches the response to the response format required by the outgoing message with the unique response ID, 111. The last two lines of the table define FactoryLink analog and message tags. This allows the GPI protocol module to report the status of the outgoing message to the FactoryLink application.
Defining the Incoming Response to the GPI The following field entries describe the sample GPI configuration:
1 2 3 4 5 6 7
One-byte numeric constant with a value of 170 (hexadecimal value AA) One-byte length of the incoming message stored in a FactoryLink analog tag Two-byte unit address received in HILOW format One-byte numeric place holder (delimiter) One-byte reply code that will be stored in a FactoryLink analog tag One-byte error code that will be stored in a FactoryLink analog tag Two-byte checksum received in HILOW format that will be stored in a FactoryLink analog tag The unique response ID is 111 FactoryLink tags ASTRING and MSTRING
For the Field Type PROCESS, the Field Length can only be 1 or 2 bytes. Also, if a PROCESS FUNCTION has entries in the FLD# or Arg columns, then, depending on the value specified in the Field Length, it is a char (1-byte) or a short (2-bytes). Process Functions Table The table below describes operations of each process function:
Name Use Description
ADDS the value given in Arg to the present value of the current field. AND MASKS (AM) the value of the current field with the value in Arg. Bit-wise AND operation on FLD#. Computes the CRC of the specified range using a CRC_SEED=0x1021 (inclusive). Uses Arg to set the initial value.
CRCCC_RV
CRCCC_RV FLD#, Arg Computes the CRC of the specified range using a CRC_SEED=0x8408 (inclusive). Uses Arg to set the initial value.
Name
Use
Description
CRC16
Computes the CRC of the specified range using a CRC_SEED=0x8005 (inclusive). Uses Arg to set the initial value. Computes the CRC of the specified range using a CRC_SEED=0xA001 (inclusive). Uses Arg to set the initial value. Computes Modulo 256 checksum; uses Arg to set the initial value. Exclusive-or the value of the current field with the value in Arg. Bit-wise EXCLUSIVE-OR operation on FLD#. Computes the LENGTH in bytes of a range of fields in a message starting with number in the first FLD# through the second FLD#, inclusive. Substitutes the result for the current field. OR MASKS (OM) the value of the current field with the value in Arg. Puts the ONE'S COMPLEMENT of FLD# notice current field. (ONESCOMP is the same as negation.) Puts the TWO'S COMPLEMENT of FLD# into the current field. Bit-wise OR operation on FLD#. SHIFTS LEFT (SL) the value of the current field Arg number of times.
CRC16_RV
OM ONESCOMP
Name
Use
Description
SHIFTS RIGHT (SR) the value of the current field Arg number of times. SUBtracts the value given in Arg from the present value of the current field. SWAPs the two consecutive bytes in the current field. Computes the EXCLUSIVE-Or of the range of bytes between FLD#, inclusive, and substitutes the result for the current field.
A_TO_FL
When parsing the response used to convert ASCII numerals to the appropriate FactoryLink data type, the GPI uses ANSI C standard functions to convert ASCII numerals to appropriate FactoryLink data types as follows:
GPI Conversion FunctionName ANSI C Function FactoryLink Data Type
Converts like %s format Binary Coded Decimal Base 2 Converts like %0d format Base 10 Base 16
Name
Description
Converts like %0x format Converts to a 2-byte MSB LSB Converts to a 4-byte MSW LSW Converts to a 4-byte IEEE MSW LSW Converts to a 4-byte IEEE LSW MSW Converts to an 8-byte IEEE MSDW LSDW Converts to an 8-byte IEEE LSDW MSDW Converts to a 2-byte LSB MSB Converts to a 4-byte LSW MSW
MBUSFLOT Converts to a Modicon float format where: LSB is the least-significant byte. MSB is the most-significant byte. LSW is the least-significant word. MSW is the most-significant word. LSDW is the least-significant double word. MSDW is the most-significant double word. Word is a 2-byte entity. Double Word is a 4-byte entity. NONE OCTASC TSPRINTF No conversion necessary Converts like %0 format Converts according to the explicit format given in the Format String column; the TSPRINTF function is a tiny sprintf( ) that handles %s, %d, %u, %x, %0, %lu, %lx, %lX, %l0, and %%. It recognizes width and pad specifications (%3d, %03d, etc.), long values, and left or right justification.
Note: Because the TSPRINTF function does not recognize floating-point formats (%e, %f, %g) and minimum widths, use this function with FactoryLink Analog, Longana, and Message types with the appropriate format string.
S AMPLE P ROTOCOLS
This section provides sample protocols that illustrate the format of various messages and responses. Use these as examples of protocols and not in your specific application. Response Protocols
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7
0001
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 RESP_ID
xxxx
xxxx
FCS
CR
(1 byte) Preamble Constant value (2 byte) PLC device address Constant value (2 byte) Response chars Constant value or FactoryLink analog tag (2 byte) Response header charsd Constant value or FactoryLink analog tag (2 byte) Frame check sequence PROCESS (1 byte) Command terminator Constant value (1 byte) Postamble Constant value 101 Constant value CR
RESP_STR
Field 1
Field 2
Field 3
Field 4
Field 5
Field 6
Field 7
Field 8
0001
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Field 8 RESP_ID
xxxx
xxxx
xxxx
FCS
CR
(1 byte) Preamble Constant value (2 byte) PLC device address Constant value (2 byte) Response chars FactoryLink analog tag (2 byte) Response header chars FactoryLink analog tag (2 byte) Frame check sequence FactoryLink analog, digital, or float tag (1 byte) FCS Checksum codes Constant value (Optional) (1 byte) Command terminator Constant value (Optional) (1 byte) Postamble Constant value (Optional) 101
Command Protocols
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Field 8
0001
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Field 8 RESP_ID
xxxx
xxxx
xxxx
FCS
CR
(1 byte) Preamble Constant value (2 byte) PLC device address Constant value (2 byte) Command chars Constant value or FactoryLink analog tag (2 byte) Command header chars Constant value or FactoryLink analog tag (?-byte) Command data FactoryLink analog, digital, or float tags (2 byte) Frame check sequence Process function (1 byte) Command terminator Constant value (1 byte) Postamble Constant value 222 Length of 11 bytes constant value
RESP_FXD
Field 1
Field 2
Field 3
Field 4
Field 5
Field 6
Field 7
0001
Field 1 Field 2
xxxx
xxxx
FCS
CR
(1 byte) Preamble Constant value (2 byte) PLC device address Constant value
(2 byte) Response chars FactoryLink analog tag (2 byte) Response header chars FactoryLink analog tag (2 byte) Frame check sequence Constant value (Optional) (1 byte) Response terminator Constant value (Optional) (1 byte) Postamble Constant value (Optional) 222
xxxx
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7
01
xx
0006
20
xx
xxxx
xxxx
xxxx
(1 byte) Preamble Constant value (2 byte) Length of network command Constant value (1 byte) Network send data command Constant value (1 byte) Secondary network address Constant value (2 byte) Response length Constant value (1 byte) Response code Constant value (1 byte) Response memory type Constant value
(1 byte) # of data tags Constant value (?-byte) Address of response data Constant value (2 byte) Checksum codes Process function (1 byte) Postamble Constant value (Optional) 1 Constant string (;)
Field 1
Field 2
Field 3
Field 4
Field 5
Field 6
Field 7
Field 8
Field 9
Field 10
Field 11
xxxx
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Field 8
01
xx
0006
20
xx
xxxx
xxxx
xxxx
(1 byte) Preamble Constant value (2 byte) Length of network command Constant value (1 byte) Network send data command Constant value (1 byte) Secondary network address Constant value (2 byte) Response length Constant value (1 byte) Response command code Constant value (1 byte) Response memory type Constant value (1 byte) # of data tags Constant value
(?-byte) Response data from device FactoryLink analog, digital, or float tag (2 byte) Checksum codes Process function (1 byte) Postamble Constant value (Optional) 1
xxxx
01
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Field 8 Field 9
xx
0006
20
xx
xxxx
DDDD xxxx
(1 byte) Preamble Constant value (2 byte) Length of network command Constant value (1 byte) Network send data command Constant value (1 byte) Secondary network address Constant value (2 byte) Command length Constant value (1 byte) Command code Constant value (1 byte) Command memory type Constant value (1 byte) # of data tags Constant value (?-byte) Command data FactoryLink analog, digital, or float tag(s)
(2 byte) Checksum codes Process function (1 byte) Postamble Constant value 555 Constant string (;)
Field 1
Field 2
Field 3
Field 4
Field 5
Field 6
Field 7
Field 8
Field 9
Field 10
Field 11
Field 12
xxxx
01
xx
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Field 8 Field 9
0005
xx
30
HH
EE
FF
xxxx
(1 byte) Preamble Constant value (2 byte) Length of network command Constant value (1 byte) Network send data command Constant value (1 byte) Secondary network address Constant value (2 byte) Command length Constant value (1 byte) Command error code FactoryLink analog or digital tag (1 byte) Command code Constant value (Place holder) (1 byte) Attached device status FactoryLink analog tag or digital tag (1 byte) Device auxiliary power source FactoryLink analog or digital tag (1 byte) NIM status code FactoryLink analog or digital tag
Field 10
(2 byte) Checksum codes FactoryLink analog (Optional) (1 byte) Postamble Constant value (Optional) 555
Analog
Message Tag
100 102
Analog
Message Tag
101 103 105 107 109 111 113 115 117 119 121 123 125
ASYNDSF.C(DSF_WRITE): cmnd length of %d exceeds SND_BUF_LEN, FLD#%D ASYNDSF.C(DSF_WRITE): Invalid FLD TYPE %d; FLD %d ASYNDSF.C(DSF_WRITE): MAX_TERM_STR reached ASYNDSF.C(DSF_WRITE): dsf_t_q_mail returned ERROR ASYNDSF.C(GET_BUF_INX): Invalid INFO_TYPE=%D IN DIV_DEF ASYNDSF.C(WRT_DO_STRING): Invld cnvr FUNC %D STRING,fld #%d ASYNDSF.C(WRT_DO_NUMERIC): Invld cnvr Func %d NUMERIC, fld #%d for for
ASYNDSF.C(WRT_DO_PROCESS): Invld PROCESS Func %d, FLD #%D ASYNDSF.C(WRT_DO_PROCESS): Invld cnvr FUNC%D for PROCESS, fld #%d ASYNDSF.C(WRT_DO_PROCESS): Invld PROCESS Func %d, #%d ASYNDSF.C(WRT_DO_PROCESS): Invld cnvr Func %d PROCESS, FLD #%D ASYNDSF.C(WRT_DO_PROCESS): Invld fld len%d for a PROC_FUNC FLD #%D ASYNCPT(XMIT): xmit error for fld
Analog
Message Tag
ASYNDSF.C(PROCESS_RESPONSE): Start to PROC RESP #%D ASYNDSF.C(PROCESS_RESPONSE): MULT_RSP Completed ASYNDSF.C(PROCESS_RESPONSE): ProcessED Resp ID# %d AOK
Analog
Message Tag
201 203 205 207 209 211 213 215 217 219 221
ASYNDSF.C(PROCESS_RESPONSE): RSP_BUF too short %d ASYNDSF.C(PROCESS_RESPONSE): inter char time out ASYNDSF.C(PROCESS_RESPONSE): RSP_TM_OUT ASYNDSF.C(PROCESS_RESPONSE): RESPONSE ERROR ASYNDSF.C(MATCH_RSP): Invalid DIV-DS.INFO_TYPE=%D, RPS_ID =%D ASYNDSF.C(GET_USL_BUF_INX): DLMTR FOR FLD #%D, RSP ID #%D, not found ASYNDSF.C(GET_USL_BUF_INX): End of RSP_BUF reached INX %D, FLD #%D, RSP ID #%D ASYNDSF.C(GET_USL_BUF_INX): DLMTR FOR FLD # %D, RSP ID #%D, not found ASYNDSF.C(GET_USL_BUF_INX): End of RSP_BUF REACHED, INX%D, FLD #%D, RSP ID #%D ASYNDSF.C(RD_DO_TAGVALUE): Fld. Len. Exceeded 255; RESP #%D ASYNDSF.C(RD_DO_TAGVALUE): Invalid CNVR for digital; FLD# %D
Analog
Message Tag
223 225 227 229 231 233 235 237 239 241 243
ASYNDSF.C(RD_DO_TAGVALUE): Invalid cnvr for analog; FLD# %D ASYNDSF.C(RD_DO_TAGVALUE): Invalid cnvr for lanalog; FLD# %D ASYNDSF(RD_DO_TAGVALUE): Invalid cnvr for float; FLD# %D ASYNDSF.C(RD_DO_TAGVALUE): Invalid cnvr for MESSAGE Tag; FLD#%D ASYNDSF.C(RD_DO_TAGVALUE): Invalid fl_type%d for FLD# %D ASYNDSF.C(RD_DO_STRING): STRING; Parser failed FLD# %D ASYNDSF.C(RD_DO_NUMERIC): NUMERIC, Parser failed, FLD# %D ASYNDSF.C(RD_DO_RAWVALUE): Fld. Len. Exceeded 255; Resp #%d ASYNDSF.C(RD_DO_RAWVALUE): Invalid cnvr for MESSAGE Tag fld#%d ASYNDSF.C(RD_DO_RAWVALUE): Invalid FL_TYPE %d for RAWVALUE ASYNDSF.C(PROCESS_RESPONSE): USL_TM_OUT
Analog
Message Tag
ASYNDSF.C(ALLOC_MEM_ON_ARTIC): AllocED %d bytes on ARTIC for SND bufr ASYNDSF.C(ALLOC_MEM_ON_ARTIC): AllocED %d bytes on Artic for RCV BUFR ASYNDSF.C(ALLOC_MEM_ON_SU): ALLOCED %D bytes for SND BUFR ASYNDSF.C(ALLOC_MEM_ON_SU): ALLOCED %D bytes for RCV BUFR ASYNDSF.C(FREE_MEM_ON_SU): freed mem for send and RCV BUFRS ASYNDSF.C (DSF_START): PORT_SETUP_AOK
Analog
Message Tag
ASYNDSF.C(ALLOC_MEM_ON_ARTIC): Unable to alloc mem on Artic for SND BUFR %D bytes ASYNDSF.C(ALLOC_MEM_ON_ARTIC): Unable to alloc mem on ARTIC for RCV BUFR %D bytes ASYNDSF.C(ALLOC_MEM_ON_SU): Unable to alloc mem for SND BUFR ASYNDSF.C(ALLOC_MEM_ON_SU): Unable to alloc mem for RCV BUFR ASYNCPT.C(CPT_START): Protection bit failure (ASYNCPT) ASYNCPT.C(CPT_START): PORT_SETUP failed%04Xh ASYNCPT.C(CPT_TSLICE): unknown state: %d ASYNCPT.C(XMIT): xmit error
Analog
Message Tag
319 321 323 325 327 329 331 333 335 337
ASYNCPT.C(XMIT): CPT_SND_USL returned: %04XH ASYNCPT.C(XMIT): INVALID PKT_TYPE: %04XH ASYNCPT.C(RCV_CK_RSP_TM): receive character error %04XH ASYNCPT.C(RCV_CK_RSP_TM): USL_TM_OUT error ASYNCPT.C(RCV_CK_RSP_TM): RSP_TM_OUT error ASYNCPT.C(RCV_CHAR): receive character error %04Xh ASYNCPT.C(RCV_CHAR): ICH_TM_OUT error ASYNCPT.C(RCV_CHAR): TOTAL_TM_OUT reached ASYNCPT.C(RCV_RSP_TM): TOTAL_TM_OUT reached ASYNCPT.C(RCV_FINITO): CPT_SND_USL returned: %04XH
Chapter 14
Modbus Plus
The FactoryLink EDI task allows you to configure bidirectional communications between the FactoryLink real-time database and any Modicon Modbus Plus PLC.
Note
Before completing the protocol-specific Modbus configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58 for details. In your server application, open Device Interfaces > Modicon Modbus Plus. Sample table entries are provided in Reading Data from a Device on page 73 and Writing Data to a Device on page 97.
C ONFIGURING
THE
Open the Logical Station Control table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a device.
Valid Entry: previously defined logical port number
Adapter Number
Enter the number assigned to the SA85 host adapter. In a Windows environment, follow the installation procedure in the appropriate LNET (LocalNet Library) software manual to set up the SA85 driver for your specific hardware system. Configure the SA85 card as adapter 0 or 1.
Valid Entry: 0 or 1
(Optional) Enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
Enter a number between 1 and 8 that defines the number of internal master paths on the SA85 device for command/response transactions.
Valid Entry: 1 - 8
Specify whether or not this path can be used as a data slave (DS) path for unsolicited data. This can be one of the following: YES This path can be used as a data slave path. NO This path cannot be used as a data slave path. These fields enable you to specify up to eight paths. For information about data slave paths, refer to the Modicon Modbus Plus documentation.
When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box.
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. Complete a row for each device to communicate through this logical port.
LSTA Status Analog Tag
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station). You can animate output-text objects to display the codes stored in an Error/Status tag on a graphics screen.
Valid Entry: tag name Valid Data Type: analog
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. You will later enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry: 0 - 999 (default=0)
PLC Type
Enter the type of Modicon device represented by this entry. Use 984-BITWRITE if mask write operations are supported by this device. You can specify 984-BITWRITE for the following Modicon models: A120, A130, A141, A145, 685E, 785E, AT4, VM4.
Valid Entry: 984 or 984-BITWRITE
Physical Station
Enter the physical address of the Modicon device represented by this entry. Be sure this number corresponds to the actual address setting of the device.
Valid Entry: 1 - 64 (default=1)
Router 1 - Router 4
Enter a number between 1 and 64 that defines the Modbus Plus network address of a router/bridge. Up to four routes can be defined for each physical station.
Valid Entry: 1 - 64
Enter the length of time, in hundredths of a second, that the protocol module will wait to receive a response to a read or write command before timing out. You must enter a value greater than 0 for the protocol module to timeout. For example, if you specify 300, timeout occurs after 3 seconds has elapsed. If the number of retries is 3, communications terminates in 9 seconds for that transmission attempt.
Valid Entry: 1 - 300 (default=100)
Number of Retries
Enter a number between 0 and 10 that defines the maximum number of consecutive times a read or write command is sent before communications between FactoryLink and the device terminates for that transmission attempt.
Valid Entry: 0 - 10 (default=3)
(Optional) Enter a tag name assigned to reference a digital tag that contains the status of communication attempts for this logical station. If the value of this tag is 0 (off), the communication attempt to this logical station was successful. If the value of this tag is 1 (on), the communication attempt to this logical station failed. You can employ this tag to create an alarm in the Alarm Supervisor that indicates a communication failure.
Valid Entry: tag name Valid Data Type: digital
(Optional) Enter a tag name assigned to reference a message tag that contains text describing the status of communication attempts for this logical station. This tag works in conjunction with the LSTA Failure Digital Tag field to display a meaningful error message for the operator on the Alarm Supervisor screen.
Valid Entry: tag name Valid Data Type: message
Comment
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box.
C ONFIGURING
THE
Open the Read/Write Control table. A read or write table should not contain more than the maximum number of contiguous registers allowed for a single message accessing a type of register. The maximum number allowed varies from one register type to the next. If more than the maximum number of contiguous register addresses are defined, multiple messages are generated for the operation. For example, if a block read table for a holding register in a 984 device contains entries that access contiguous addresses from 100 to 127, two messages are generated. The first message reads the first 125 addresses (addresses 100 to 124). The second message reads addresses 125 through 127. The following table lists the maximum number of contiguous registers included in a single block read or write message for each supported register type.
Type of Register Maximum Number For Block Read Maximum Number For Block Write
Coil Holding Global Input Status Input Mask Statistics Word Memory
Table Name
Assign a name to this read or write request. Define one request (table) per line and do not include spaces in the name. You can define as many tables as available memory allows. Try to make the table name reflective of the operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Unsolicited Read
For EDI to interpret this operation as a triggered block read or as a write operation, accept the default of NO. If this is an unsolicited read operation, enter YES. EDI will interpret this operation as an unsolicited read and emulate the devices addressing structure based on entries you make in the Read/Write Information table. The incoming data will be stored in the real-time database as specified in this field. If you enter YES, the incoming data will be stored in the tag represented by the tag name specified in the Read/Write Information table. If the current value of the tag is equal to the new value, the change-status indicator is unaffected. If a different value is being stored the tag, however, it will overwrite the current value and the tags change-status indicator will be set to 1 (ON).
Valid Entry: yes, no (default=no)
Exception Write
For EDI to interpret this operation as a triggered block write or as a read operation, accept the default of NO. For EDI to interpret this operation as an exception write and write tag values to the device only when those values change, enter YES. Do not specify tags expected to change at frequent and unpredictable intervals in an exception write table. Any tag specified will be written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communications or result in an error message. In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this
indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Valid Entry: yes, no (default=no)
If this is a block read operation, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is an unsolicited read or a write operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block read.
Valid Entry: 1 - 4 (default = 1)
Note
The Block Read Trigger, Block Read Disable, Block Read Complete, and Block Read State tags apply only to triggered read operations. Do not define these tags for unsolicited read operations or for write operations.
Block Read Trigger
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is required. Enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When this tags value is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
Tip
The Block Read Disable tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for details.
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1. To reenable a block read table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
If this is a block or exception write operation, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1.
If this is a read operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block or exception write.
Valid Entry: 1 - 4 (default = 1)
Note
The Block Write Trigger, Block Write Disable, Block Write Complete, and Block Write State tags apply only to write operations. Do not define these tags for read operations.
Block Write Trigger
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is required. Enter a tag name for a digital tag to initiate a block write of the tag values specified in the Read/Write Information table to the addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values.
Valid Entry: tag name Valid Data Type: digital
Tip
The Block Write Disable tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for details.
Block Write Disable
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable a block write to the addresses specified in this table. When this tags value is forced to 1 (ON), the write operation is not executed, even when the block write trigger is set to 1.
To reenable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write table, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this tables Read/Write Information table is written to the device, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the data defined in this tables Read/Write Information table is written to the device, the state tag is forced back to 1. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click the Save icon to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box.
C ONFIGURING
THE
From the Read/Write Control table, select the row for the table you are configuring and open the Read/Write Information table. For a Read Table add a table entry for each FactoryLink tag in which data read from the device will be stored when the operation executes. For a Write Table add a table entry for each tag to be written when the operation executes.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: The following table lists valid tag types for each register type. (See the Data Type field of this table
Tag Type
Tag Description
Analog
A tag that stores a signed 16-bit integer with a value range between -32,768 and +32,767
HREG GLBL IREG STATHI STATLO XMEMnn COIL HREG INP IREG
Digital
A tag that stores a binary that indicates either a set (1) or unset (0) bit
Tag Type
Tag Description
Float
A tag that stores a floating point integer HREG with a value that can range up to 31 places to the right side of the decimal point A tag that stores a signed 32-bit integer HREG with a value range between + or - 2 billion A tag that stores ASCII text HREG
Longana Message
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg Address
For a read table, enter the address in the devices memory where the value to be stored in this tag is located. For a write table, enter the address in the devices memory to which the tag value will be written. The format of a register address is: paaaaa where
p The address prefix that identifies the Modicon
register type
aaaaa The actual address of the register
When defining register addresses, do not include the address prefix or leading zeros. The prefix indicates the register type, and this information is specified in the Data Type field of this table. The leading zeros are extraneous. For example, for holding register address 400001, enter 1. The 4 indicates the register type, and the leading zeros are not necessary.
If you are defining an address for floating-point or long analog tag types, keep in mind these tag types are addressed in pairs. The first register in the pair contains the high-order word; the second register contains the low-order word. Enter the address for the starting register in a register pair; the companion register is implied. Try to maintain consistency when using register addresses for floating-point and long analog FactoryLink data types. Adopt either an odd or even starting register sequence and maintain that sequence. For example: 1, 3, 5, 7, 9, ... or 2, 4, 6, 8, 10, ... If you are defining an address for a message tag type, the address specifies the first in a group of registers that contains the message characters. The message length is specified in the Bit Offset/MSG Length field. If you are defining the register address for an unsolicited read table, the register addresses for each logical station must be unique. Examples: LSTA 1 - HREG 1000, LSTA 2 - HREG 2000 If you are defining an address for global data words, use the register address range of 1 to 32. For global data word read operations, it is assumed the first global data word received is always word 1, the second is word 2, and so on. If you specify a register address in the block read table that is larger than the total number of global data words that will actually be received, an error is generated. Although global data is considered contiguous in block write tables, you can define register addresses that do not appear contiguous on the information table. For example, if you specify register address 1, 5, 7, 20, and 25, a message is generated for registers 1 through 25. A value of 0 is stored for those registers within the range that do not appear in the information table. If you are defining an address to read the high or low byte of a statistical word, each pair addresses a single register between 1 and 54.
To access the low and high bytes of a single word, enter the same register address twice for two separate analog tags. Define STATHI in the Data Type field for the first tag and STATLO in the Data Type field for the second tag. If you want to create a single word value, use Math & Logic to OR the bytes together. If you want to access the high and low bytes of a common register, you must define them in the same block read table or the values retrieved may not be synchronized. If you are defining a STATCLR exception write operation, do not specify a register address. Accept the default of 1. If you are reading or writing to extended memory, a block read, block write, or exception write operation may read or write multiple register addresses for the same register file.
Bit Offset/MSG Length
Name column) associated with this entry is digital, enter the bit
This field is required for digital data type. If the tag (entry in the Tag
offset within the word that contains the value to be read or to which the tag value is to be written. Bit 1 is the most significant bit (MSB) and bit 16 is the least significant bit. The purpose of this field depends on the tag type of the tag. For digital tags that reference an address in memory from a holding register or input register (see Data Type field description), this is the bit offset between 1 and 16 within a register word that contains the value of the tag. When defining this offset, follow Modicons convention for bit ordering, where bit 1 is the most significant bit (MSB) and bit 16 is the least significant bit (LSB).
MSB 1
10
11
12
13
14
15
LSB 16
For digital tags that reference mask write functions, use this field to indicate which bit between 1 and 16 will change in the register as a result of a mask write command. You can only address one bit per tag entry. For message tags, this is the number of bytes in the devices memory, between 1 and 80, containing the message. This number of bytes, starting from the location specified in the Address field of this table,
is read into the message tag as raw binary data. The FactoryLink Modbus Plus protocol module does not perform verification on these bytes to see if they are printable ASCII. Data Type Specify the type of data being read from or written to the device for each tag defined in the Tag Name field. The following table describes the register types supported by the FactoryLink Modbus protocol module. For additional information about Modicon register types, refer to the Modicon controller manuals.
Data Type Valid Operations
COIL
Block read operations read current value of the tag. Block write and exception write operations are used to force the state of coils to either on or off.
HREG
Block read operations are used to get contents of a holding register. Block write and exception write operations are used to set the contents of a holding register.
GLBL or GL
Block read operations are used to read global data. Block write operations are used to write global data. This requires that the local computer with the SA85 adapter be assigned as a logical station with a physical station address of 0.
Block read operations read the ON/OFF status of discrete inputs. Input is stored in a controller as bits. Block read operations are used to read the binary contents of an input register. Exception write operations are used to set or clear bits within a holding register. The current state of the digital tag determines the ON/OFF setting of the bit within the holding register. To set a bit within the holding register, the digital tag must be set to 1 (ON) and to clear a bit, it must be set to 0 (OFF).
Data Type
Valid Operations
Block read operations read the high or low bytes of a statistics word. Exception write operations clear statistics data. Block read operations read the contents of extended memory. Block write and exception write operations write to extended memory.
When the table is complete, click the Save icon to validate the information. Define the data type (digital, analog, long analog, or floating-point) for any tag names displayed in the Tag Definition dialog box.
O O O O O O O O O
321
Cause:
One or both of the option bits (where x and y are decimal values) required to run this protocol module are missing.
Cause:
For Windows, the SA85 card is incorrectly installed. It is placed in the wrong slot in an EISA chassis, a bad memory address switch settings, or a bad software interrupt setting.
Action: Verify the path for MBHOST.SYS is correct, and check its parameters in the CONFIG.SYS file. If either is incorrect, make the correction and restart the program.
Modbus Plus: SA85 Adapter (x) identified as node (y)
Cause:
For Windows, the Windows SA85 Modbus Plus loaded successfully and the adapter (where x is a decimal value) shown is at the Modbus Plus address node number (where y is a decimal value).
Action: None
Logical Port Messages The EDI task writes logical port messages to the LPORT tag when this tag is defined on the Read/Write table. These messages occur after the application starts up.
Modbus Plus: Communications OK
Cause:
Normal.
Action: None.
Modbus Plus: Lsta n: Write Request Error, 0xnn
Cause:
A command for a WRITE operation was made to logical station (n) resulting in a NetBIOS return code of 0xnn, a hexadecimal value. This error occurred on a WRITE table operation to a specific logical station.
Action: Refer to the NetBIOS Error Return Codes in the Modicon documentation for details.
Modbus Plus: Lsta n: Write Response Error, 0xnn
Cause:
A response to a WRITE operation was made to logical station (n) resulting in an error with a NetBIOS return code of 0xnn, a hexadecimal value. This error occurred on a WRITE table operation to a specific logical station.
Action: Refer to the NetBIOS Error Return Codes in the Modicon documentation for details.
Modbus Plus: Lsta n: Read Request Error, 0xnn
Cause:
A READ operation request was made to logical station n resulting in a NetBIOS return code of 0xnn, a hexadecimal value. This error occurred on a READ table operation to a specific logical station.
Action: Refer to the NetBIOS Error Return Codes in the Modicon documentation for details.
Cause:
A response to a READ operation request was made to logical station n resulting in a NetBIOS return code of 0xnn, a hexadecimal value.
Action: Refer to the NetBIOS Error Return Codes in the Modicon documentation for details.
Modbus Plus: Illegal func code 0xnn rcvd for unsol data
Cause:
An illegal command function code was detected in an unsolicited message. Modbus Plus only expects the Preset Multiple Regs commandModbus command function 0x10as the only valid command for unsolicited operations.
Action: Decrease the rate at which unsolicited data is sent to FactoryLink; or be certain the PLC is attempting to send only function code 0x10 for unsolicited messages. Logical Station Messages The EDI task writes logical station messages to the LSTA tag when this tag is defined on the Read/Write table. These messages occur after the application starts up.
Lsta: n Communications OK
Cause:
Normal.
Action: None.
Lsta: n Netbios Transmit Error 0xnn
Cause:
A NetBIOS error 0xnn, a hexadecimal value, resulted from the send of a Modbus command.
Action: Refer to the NetBIOS Error Return Codes in the Modicon documentation for details.
Cause:
A NetBIOS error 0xnn, a hexadecimal value, resulted from the request for a Modbus response to a previously sent Modbus command request.
Action: Refer to the NetBIOS Error Return Codes in the Modicon documentation for details.
Lsta: n Incurred a Time-out Error
Cause:
All retries are exhausted in the attempt to get a response from logical station n.
Action: Check on status of logical station n: Is it powered off, off line, or have a faulty cable connection?
Lsta: n Exception Response Error x
Cause:
An exception response 0xnn, a hexadecimal value, was received from logical station n. A controller encountered a programming or operation error while attempting to carry out a Modbus command request. Typically, this error flags an illegal data reference in a message or controller problems, a no response to an interface table or communication difficulties with a slave.
Action: Refer to the NetBIOS Error Return Codes in the Modicon documentation for details.
Lsta: n Insufficient number of global data words rcvd
Cause:
The number of words returned was less than expected during a read of global data. The number expected is always equal to or greater than the largest register address specified in the READ table for global data.
Action: Either adjust the number of global data words broadcast by the controller, or adjust the number of tags defined in the block READ table for global data.
Chapter 15
Modbus Serial
This chapter contains information needed to set up and configure bidirectional communications between the FactoryLink real-time database and any Modbus Serial PLC.
Note
Before completing the protocol-specific Modbus Serial configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58 for details. In your server application, open Device Interfaces > Modicon Modbus.
C ONFIGURING
THE
Open the Logical Station Control table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a Modicon Modbus device.
Valid Entry: previously defined logical port number
Baud Rate
Enter the speed at which the protocol module communicates with the devices linked to FactoryLink via this logical port. This entry must match the baud rate configuration of the devices. Refer to the device manufacturers documentation for details.
Valid Entry: 110 - 115200 (default=9600)
Parity
Enter the parity error correction during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: none, even, or odd (default=odd)
Data Bits
Enter the number of data bits used during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 7, 8 (default=8)
Stop Bits
Enter the number of bits sent after a character to create a pause before the start of the next character. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 1, 2 (default=1)
Timeout
Enter the length of time, in tenths of a second, the protocol module will wait to receive a response to a read or write command before timing out. You must enter a value greater than 0 for the protocol module to timeout.
Valid Entry: 1 - 32000 (default=30)
Enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box.
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. Complete a row for each device to communicate through this logical port.
Error/Status Tag Name
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station). You can animate output-text objects to display the codes stored in an Error/Status Tag Name tag on a graphics screen.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. You will later enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry: 0 - 999
Device Type
Enter the type of Modicon device represented by this entry. The following table lists the valid entries and their variations. You can specify any of the valid entry variations in this field.
Valid Entry Variation
Valid Entry
Variation
984BITWRITE
(Used for mask writes)
984-BW M84, M, or M8
M84 (Micro84)
Station Address
Enter the physical address of the Modicon device represented by this entry.
Valid Entry: 1 - 24 (default=1)
Comment
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box.
C ONFIGURING
THE
Open the Read/Write Control Table. A read or write table should not contain more than the maximum number of contiguous registers allowed for a single message accessing a type of register. The maximum number allowed varies from one register type to the next. If more than the maximum number of contiguous register addresses are defined, multiple messages are generated for the operation. For example, if a block read table for a holding register contains entries that access contiguous addresses from 100 to 127, two messages are generated. The first message reads the first 125 addresses (addresses 100 to 124). The second message reads addresses 125 through 127. The following table lists the maximum number of contiguous registers included in a single block read or write message for each supported register type.
Type of Register
Maximum Number Maximum Number For Block Read For Block Write
Coil
Holding
Input Status
Input
184, 384 484 584, 884, 984 M84 184, 384 484 584, 884, 984 M84 184, 384 484 584, 884, 984 M84 184, 384 484 584, 884, 984 M84
Memory
800 512 2000 64 100 254 125 32 800 512 2000 64 100 32 125 4 100
100
Assign a name to this read or write request. Define one request (table) per line and do not include spaces in the name. You can define as many tables as available memory allows. Try to make the table name reflective of the operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Exception Write
For EDI to interpret this operation as a triggered block write or as a read operation, accept the default of NO. For EDI to interpret this operation as an exception write and write tag values to the device only when those values change, enter YES. In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Tip
Do not specify tags expected to change at frequent and unpredictable intervals in an exception write table. Any tag specified will be written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communications or result in an error message.
Block Read Priority
If this is a block read operation, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a write operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block read.
Valid Entry: 1 - 4 (default=1)
Note
The Block Read Trigger, Block Read Disable, Block Read Complete, and Block Read State tags apply only to triggered read operations. Do not define these tags
If this is a write operation, ignore this field. If this is a triggered read operation, this field is required. Enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When this tags value is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1. To reenable a block read table that is disabled, set this tag back to 0 (OFF).
Tip
This tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Valid Entry: tag name Valid Data Type: digital
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
If this is a block or exception write operation, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a read operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block or exception write.
Valid Entry: 1 - 4 (default=1)
Note
The Block Write Trigger, Block Write Disable, Block Write Complete, and Block Write State tags apply only to write operations. Do not define these tags for read operations.
Block Write Trigger
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is required. Enter a tag name for a digital tag to initiate a block write of the tag values specified in the Read/Write Information table to the addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values.
Valid Entry: tag name Valid Data Type: digital
Tip
The Block Write Disable tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for details.
Block Write Disable
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable a block write to the addresses specified in this table. When this tags value is forced to 1 (ON), the write operation is not executed, even when the block write trigger is set to 1. To reenable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this tables Read/Write Information table is written to the device, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup.
While the table is being processed, the tag is set to 0 (OFF). After the data defined in this tables Read/Write Information table is written to the device, the state tag is forced back to 1. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click the Save icon to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box.
C ONFIGURING
THE
From the Read/Write Control table, select the row for the table you are configuring and open the Read/Write Information table. For a Read Table add a table entry for each FactoryLink tag in which data read from the device will be stored when the operation executes. For a Write Table add a table entry for each tag to be written when the operation executes.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Tag Type
Tag Description
Analog
A tag that stores a signed 16-bit integer with a value range between -32,768 and +32,767 A tag that stores a binary that indicates either a set (1) or unset (0) bit
Digital
Float
A tag that stores a floating-point integer with a value that can range up to 31 places to the right side of the decimal point A tag that stores a signed 32-bit integer with a value range between + or - 2 billion A tag that stores ASCII text
Longana
HREG
Message
HREG
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Reg Address
Enter the register address in Modicon memory where this tags value is located. The format of a register address is: paaaaa where
p Address prefix that identifies the Modicon register
type
aaaaa Actual address of the register
When defining register addresses, do not include the address prefix or leading zeros. The prefix indicates the register type, and this information is specified in the Data Type field of this table. The leading zeros are extraneous. For example, for holding register address 400001, enter 1. The 4 indicates the register type, and the leading zeros are not necessary. If you are defining an address for floating-point or long analog tag types, keep in mind that these tag types are addressed in pairs. The first register in the pair contains the high-order word; the second register contains the low-order word. Enter the address for the starting register in a register pair; the companion register is implied. Try to maintain consistency when using register addresses for floating-point and long analog FactoryLink data types. Adopt either an odd or even starting register sequence and maintain that sequence. For example: 1, 3, 5, 7, 9, ... or 2, 4, 6, 8, 10, ...
If you are defining an address for a message tag type, the address specifies the first in a group of registers that contain the message characters. The message length is specified in the Bit Offset/MSG Length field. If you are reading or writing to extended memory, a block read, block write, or exception write operation may read or write multiple register addresses for the same register file.
Bit Offset/MSG Length
Name column) associated with this entry is digital, enter the bit
This field is required for digital data type. If the tag (entry in the Tag
offset within the word that contains the value to be read or to which the tag value is to be written. Bit 1 is the most significant bit (MSB) and bit 16 is the least significant bit. Leave this field blank for all other FactoryLink data types. For digital tags that reference an address in memory from a holding register or input register (see Data Type field description), this is the bit offset between 1 and 16 within a register word that contains the value of the tag. When defining this offset, follow Modicons convention for bit ordering, where bit 1 is the most significant bit (MSB) and bit 16 is the least significant bit (LSB).
MSB 1
10
11
12
13
14
15
LSB 16
For digital tags that reference mask write functions, use this field to indicate which bit between 1 and 16 will change in the register as a result of a mask write command. You can only address one bit per tag entry. For message tags, this is the number of bytes in the devices memory, between 1 and 80, containing the message. This number of bytes, starting from the location specified in the Address field of this table, is read into the message tag as raw binary data. The FactoryLink Modbus Plus protocol module does not perform verification on these bytes to see if they are printable ASCII.
Valid Entry: 1 - 16 if data type is digital
Data Type
Specify the type of data being read from or written to the device for each tag defined in the Tag Name field.
Valid Operations
Data Type
COIL
Block read operations read current value of the tag. Block write and exception write operations are used to force the state of coils to either on or off.
HREG
Block read operations are used to get the contents of a holding register. Block write and exception write operations are used to set the contents of a holding register.
INP
Block read operations read the ON/OFF status of discrete inputs. Input is stored in a controller as bits. Each bit has an address. Block read operations are used to read the binary contents of an input register. Exception write operations are used to set or clear bits within a holding register. The current state of the digital tag determines the ON/OFF setting of the bit within the holding register. To set a bit within the holding register, the digital tag must be set to 1(ON) and to clear a bit, it must be set to 0 (OFF). Block read operations read the contents of extended memory. Block write and exception write operations write to extended memory.
IREG MASK
XMEMnn
When the table is complete, click the Save icon to validate the information. Define the data type (digital, analog, long analog, or floating-point) for any tag names displayed in the Tag Definition dialog box.
Cause:
Action: Verify the device configuration and cabling. The FactoryLink configuration tables must contain the proper station addresses and parameters. The Logical Station Control table must contain the proper baud rate, parity, and data format parameters.
2 (Decimal equivalent: 2)
Cause:
Cause:
I/O aborted because of a time-out while the protocol module is waiting for a device response.
4 (Decimal equivalent: 4)
Cause:
Cause:
Exception response the slave cannot respond to the function code given in the query.
Action: Check the read and write tables and verify the data types are valid for the destination device.
25 (Decimal equivalent: 37)
Cause:
Exception response the data address received in the query by the device is not valid.
Action: Verify the register addresses in the table experiencing the error.
35 (Decimal equivalent: 53)
Cause:
Exception response an invalid data value in the query is detected by the device.
Action: Depending on the data type of the table in error, verify each tag value is valid for the specified data type.
45 (Decimal equivalent: 69)
Cause:
Exception response the device has experienced an unrecoverable error while executing a requested action.
Action: Determine whether the device is in proper working order. It might require servicing.
55 (Decimal equivalent: 85)
Cause:
Exception response the device requires a long time to carry out the requested action.
Action: If the ladder logic programmed into the device is inefficient, it can result in time-consuming processing of requests. Reprogram the device according to the manufacturers recommendations.
Cause:
Exception response the device is busy carrying out a previously requested action.
Action: The device needs more time to finish processing the current request before it begins processing the next one. Lessen the frequency of requests sent to the device.
75 (Decimal equivalent: 117)
Cause:
Exception response the device cannot perform the program function received in the query.
Action: Use the Modicon diagnostic software to determine the cause of the problem.
85 (Decimal equivalent: 113)
Cause:
Exception response the device attempted to read extended memory but detected a memory parity error.
Action: Determine whether the device is in proper working order. It might require servicing. In Message Tags This section describes the run-time messages as they appear in the message tags.
Modbus: Communications OK
Cause:
Normal.
Cause:
Action: The specified error is the decimal equivalent of a hexadecimal error code. For details, see Run-Time Manager Codes on page 327.
Cause:
Action: The specified error is the decimal equivalent of a hexadecimal error code. For details, see Run-Time Manager Codes on page 327.
Modbus: Write error decimalcode to Lsta logical station
Cause:
Action: The specified error is the decimal equivalent of a hexadecimal error code. For details, see Run-Time Manager Codes on page 327.
Modbus: Read error decimalcode to Lsta logical station
Cause:
Action: The specified error is the decimal equivalent of a hexadecimal error code. For details, see Run-Time Manager Codes on page 327.
Chapter 16
This chapter contains information needed to set up and configure bidirectional communications between the FactoryLink real-time database and the following devices, either directly or using the OMRON Host Link: C120 C200H C500 C1000 C2000 In your server application, open Device Interfaces > OMRON.
C ONFIGURING
Note
THE
Before completing the protocol-specific General Electric configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58 for details. Open the Logical Station Control table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a device.
Valid Entry: previously defined logical port number (default=0)
Baud Rate
Enter the speed at which the protocol module communicates with the devices linked to FactoryLink via this logical port. This entry must match the baud rate configuration of the devices. Refer to the device manufacturers documentation for details.
Valid Entry: 110 - 115200 (default=9600)
Parity
Enter the parity error correction during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: odd
Data Bits
Enter the number of data bits used during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 8
Stop Bits
Enter the number of bits sent after a character to create a pause before the start of the next character. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 1
Timeout
Enter the length of time the protocol module will wait to receive a response to a read or write command before timing out. You must enter a value greater than 0 for the protocol module to timeout.
Valid Entry: 1 - 32767 (default=10)
When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the OMRON Logical Station Control table:
Field
Logical Port
Entry
Description
Baud Rate
9600
Specifies the logical communication path configured by this table. Specifies the communication rate.
Field
Parity Data Bits Stop Bits Response Timeout (0.1 Sec)
Entry
Description
EVEN 8 1 10
No parity checking. Specifies 8 data bits in the transmission. Specifies 1 stop bit in the transmission. The response timeout is 1 second.
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. Complete a row for each device to communicate through this logical port.
Error/Status Tag Name
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station). You can animate output text objects to display the codes stored in an Error/Status Tag Name tag on a graphics screen.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. You will later enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry: 0 - 999
Device Type
Enter the type of OMRON device to which communications are to be directed. C20 C120 PLC
K/P-SR K & P-Series PLCs (C20K, C28K, C40K, C60K, C20P, C28P, C40P, C60P) C120 C120 & C120F PLCs C200H C200H PLC (default) C500 C500 PLC C500F C500F PLC C1000H C1000H PLC C2000H C2000H PLC
Physical Station
Enter the physical station address of the OMRON device with which the EDI task communicates when using this logical station in a Read/Write table.
Valid Entry: 0 - 31
Comment
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the OMRON Logical Station Information table:
Field
Error/Status Tag Name Logical Station Physical Station
Entry
Description
OMRN_STATION0_ STATUS 0 0
Contains information about communication errors Specifies the logical communication path Specifies the physical station address associated with this logical station Specifies the external device type associated with this logical station
Device Type
C200H
C ONFIGURING
THE
Open the Read/Write Control table. Complete a row for each read or write table.
Tip
See Application Design Tips and Techniques on page 127 for information about triggering schemes using tags defined in this table.
Table Name
Assign a name to this read or write request. Define one request (table) per line and do not include spaces in the name. You can define as many tables as available memory allows. Try to make the table name reflective of the operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Exception Write
For EDI to interpret this operation as a triggered block write or as a read operation, accept the default of NO. For EDI to interpret this operation as an exception write and write tag values to the device only when those values change, enter YES. In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Tip
Do not specify tags expected to change at frequent and unpredictable intervals in an exception write table. Any tag specified will be written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communications or result in an error message.
Block Read Priority
If this is a block read operation, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a write operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block read.
Valid Entry: 1 - 4 (default=1)
Note
The Block Read Trigger, Block Read Disable, Block Read Complete, and Block Read State tags apply only to triggered read operations. Do not define these tags If this is a write operation, ignore this field. If this is a triggered read operation, this field is required. Enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When this tags value is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1. To reenable a block read table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
Tip
This tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Block Read Complete
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
If this is a block or exception write operation, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a read operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block or exception write.
Valid Entry: 1 - 4 (default=1)
Note
The Block Write Trigger, Block Write Disable, Block Write Complete, and Block Write State tags apply only to write operations. Do not define these tags for read operations.
Block Write Trigger
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is required. Enter a tag name for a digital tag to initiate a block write of the tag values specified in the Read/Write Information table to the addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values.
Valid Entry: tag name Valid Data Type: digital
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field.
If this is a block write table or an exception write table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable a block write to the addresses specified in this table. When this tags value is forced to 1 (ON), the write operation is not executed, even when the block write trigger is set to 1. To reenable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
Tip
This tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Block Write Complete
If this is a read or exception write operation, ignore this field. If this is a block write table, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this tables Read/Write Information table is written to the device, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the data defined in this tables Read/Write Information table is written to the device, the state tag is forced back to 1.
Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click the Save icon to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the OMRON Read/Write Control table.
Field
Table Name Exception Write Block Read Priority Block Read Trigger
Entry
Description
OMRN_READ_ STATE
Block Write Priority Block Write Trigger Block Write Complete Block Write Disable Block Write State
Specifies the table name. The table will not perform exception writes. The block read priority for the table will be 1. When the value of OMRN_ READ_TRIGGER is 1 or (on), a block read of values specified by the Read/Write Information table associated with table 1 occurs. This tag is defined to disable the block read operations. The value of OMRN_READ_ COMPLETE is set to 1 when the read is complete. The value for OMRN_READ_ STATE is set to 1 if a read operation of table 1 is in progress, and the value is 0 if it is inactive. The write priority for this table is set to 1 by default. Since this is a read table, the tags specific to write requests are not defined.
C ONFIGURING
THE
From the Read/Write Control table, select the row for the table you are configuring and open the Read/Write Information table. For a Read Table add a table entry for each FactoryLink tag in which data read from the device will be stored when the operation executes. For a Write Table add a table entry for each tag to be written when the operation executes.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, float
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Data Area
Enter the data area of the OMRON controller to be read/written. See OMRON Data Types and PLC Data Areas on page 345 for more information about these data areas. ST PLC operating status; channel number is ignored. Use tag type A and data type BIN1. ER PLC errors; channel number must be 0 or 1 for error word 1 or 2, respectively. Use data type BIN1. IR HR AR LR TC I/O and internal relay area. Holding relay area. Auxiliary relay area. Link relay area. Timer/counter area. Use tag type D and data type TCTR.
DM PV
Channel
Data memory area. Present value area. Use tag type A or F and data type BCD1, BCD2, TIM, or TIMH.
Enter the channel number within the data area of the value to be read or written.
Valid Entry: 0 - 9999
Bit Offset
Name column) associated with this entry is digital, enter the bit
This field is required for digital data type. If the tag (entry in the Tag
offset within the word that contains the value to be read or to which the tag value is to be written. Bit 1 is the most significant bit (MSB) and bit 16 is the least significant bit. Leave this field blank for all other FactoryLink data types.
Valid Entry: 0 (least significant bit), 15 (most significant bit)
Data Type
Specify the type of data being read from or written to the device for each tag defined in the Tag Name field. See OMRON Data Types and PLC Data Areas on page 345 for valid data types. BIN1 BIN2 BCD1 BCD2 TIM TIMH TCTR 16-bit binary value (-32768 to 32767). Use tag type D or A. Two consecutive 16-bit binary values or 32-bit binary value (0 to 4294967295). Use tag type F. 16-bit BCD value (0 to 9999). Use tag type A. Two consecutive 16-bit BCD values or 32-bit BCD value (0 to 9999999). Use tag type F. 16-bit timer BCD value with units of 0.1 second (0.0 to 999.9). Use tag type F. 16-bit high-speed timer BCD value with units of 0.01 second (0.00 to 99.99). Use tag type F. One-bit timer/counter value (0 or 1). Use tag type D and data area TC.
When the table is complete, click the Save icon to validate the information. Define the data type (digital, analog, or floating-point) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the OMRON1 Read/Write Information table:
Field
Table Name Tag Name Logical Station Data Area Channel Bit Offset Data Type
Entry
Description
Specifies the Read/Write table name. The value read from the device is stored in OMRNRDR1. Specifies the path to send the request. Data area of the controller to be read/written. Channel number in the external device. Specific location of information to read. Data type read from or written to this controller.
OMRON HOST LINK | 16 OMRON Data Types and PLC Data Areas
AND
The following table shows the FactoryLink data types and the OMRON data types that are to be used for each OMRON PLC data area:
FactoryLink Data Type OMRON Data Type OMRON PLC Data Area
ER IR, HR, AR TC ST ER IR, HR, AR LR and DM PV IR, HR, AR LR and DM LR and DM LR and DM PV PV
This table shows the data area maximum channel ranges for each OMRON PLC type.
16 | OMRON HOST LINK OMRON Data Types and PLC Data Areas
C20 K/P-Series C120 & C120F C200H C500 C500F C1000H C2000H
0 1 2 3 4 5 6 7
0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1
09 09 31 99 31 31 99 99
---27 --27 27
--31 63 31 31 63 63
condition. In some cases, two individual codes appear within a string to indicate multiple error conditions.
(MSD), the leftmost integer, and least significant digit (LSD), the rightmost integer.
ER:00nn is a double-character format in which two characters represent a single error condition. Decode the ER:00nn string by interpreting nns most significant digit
OMRON Error Codes The following error code values occur in the LSD.
Example: If: Then:
Case 0:
Cause:
Action: Command request cannot be performed with the device in RUN mode.
2
Cause:
Action: Command request cannot be performed with the device in MONITOR mode.
3
Cause:
Action: Command request cannot be performed with the device with PROM mounted.
4
Cause:
B
Cause:
Action: Command request cannot be performed with the device in PROGRAM mode.
Cause:
Action: Command request cannot be performed with the device with PROM mounted.
D
Cause:
Action: Command request cannot be performed with the device in LOCAL mode.
Case 1: ER:001e OMRON Response Errors 0
Cause:
Parity error.
Cause:
Framing error.
Action: Verify the number of data and stop bits set up matches the device.
2
Cause:
Overrun.
Action: Verify the number of data and stop bits setup matches the device.
3
Cause:
FCS error.
Action: Verify the parity and the number of data and stop bits setup matches the device.
4
Cause:
Action: Verify the Read/Write configuration table entries are valid for device parameter. Contact Customer Support if the problem persists.
Cause:
Entry number data error (parameter error, data code error, data length error).
Action: Verify the Read/Write configuration table entries are valid for device parameter. Contact Customer Support if the problem persists.
6
Cause:
Action: Verify the Read/Write configuration table entries are valid for device parameter. Contact Customer Support if the problem persists.
8
Cause:
Action: Verify the Read/Write configuration table entries are valid for device parameter. Contact Customer Support if the problem persists.
9
Cause:
Command not executable due to non-executable error clear, non-registration of I/O table, or others.
Cause:
I/O table generation impossible due to unrecognized Remote I/O Unit, channel over, or duplication of Optical Transmitting I/O Unit.
Cause:
Transmit error.
Action: Verify the cable is constructed properly and that it is connected to the logical port and device.
Case 4:
Cause:
Timeout error.
Action: Verify the cable is connected to the logical port and device. Also, check that the timeout period is defined for the recommended time.
3
Cause:
Action: Verify the parity and the number of data and stop bits are configured properly for the device. Also, verify the cable ground wire is connected properly.
4
Cause:
Cause:
Action: Verify the parity and the number of data and stop bits are configured properly for the device.
6
Cause:
Action: Verify the Read/Write configuration table entries are valid for device parameter. Also, verify the parity and the number of data and stop bits are configured properly for the device and that the cable ground wire is connected properly.
Case 5:
Cause:
Action: Verify the IBM RIC/ARTIC board and the OMRON protocol module have sufficient data storage defined. Contact Customer Support if the problem persists.
1
Cause:
Action: Verify the IBM RIC/ARTIC board and the OMRON protocol module have sufficient data storage defined. Contact Customer Support if the problem persists.
2
Cause:
Cause:
Cause:
Cause:
Action: Verify the number of data and stop bits setup matches the device.
Cause:
Action: Verify the number of data and stop bits set up matches the device.
4
Cause:
Action: Verify the Read/Write configuration table entries are valid for device parameter. Contact Customer Support if the problem persists.
5
Cause:
Action: Verify the Read/Write configuration table entries are valid for device parameter. Contact Customer Support if the problem persists.
8
Cause:
Action: Verify the Read/Write configuration table entries are valid for device parameter. Contact Customer Support if the problem persists.
Case B: ER:00Be OMRON Response Errors 0
Cause:
Chapter 17
Opto 22 OPTOMUX
The External Device Interface (EDI) task allows you to configure FactoryLink to This chapter contains information needed to set up and configure bidirectional communications between the FactoryLink real-time database and one or more Opto 22 OPTOMUX devices. Note: Before completing the Opto OPTOMUX configuration tables, you must complete the External Device Definition table. See Configuring Communication Paths on page 57 for details. Enter the information as specified with one exception: in the Device Name column, enter OMUX.
C ONFIGURING
Accessing
THE
In your server application, open Device Interfaces > Opto 22 OPTOMUX > OPTOMUX Logical Station Control. Field Descriptions
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to an Opto 22 OPTOMUX device.
Valid Entry: previously defined logical port number 0 - 99
(default = 0)
Baud Rate
Parity
Length of time, in tenths of a second, the driver waits to receive a response to a read or write command.
Valid Entry: 1 - 999 (0.1 to 99.9 seconds)
Optionally, enter a tag name for a message tag to which a text string is written to indicate a communication error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
When the table is complete, click Save to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box. The following table shows sample Logical Station Control Table entries.
Column Logical Port Entry 10 Description The communication path used for read and write operations between FactoryLink and devices communicating via this port is represented as 10. This specifies the communication rate as 9600. No parity checking. The driver communicates to the device using 8 data bits in the transmission. The driver communicates to the device using 1 stop bit in the transmission. The driver waits 3 seconds for a response to a read or write command before timing out.
Baud Rate Parity Data Bits Stop Bits Timeout 0.1 Sec Status Msg Tag Name
9600 NONE 8 1 30
LP1ERR The EDI task stores communication error messages associated with this logical port in a message tag, LP1ERR.
C ONFIGURING
Accessing
THE
In your server application, open Device Interfaces > Opto 22 OPTOMUX > OPTOMUX
Logical Station Control > your logical port > OPTOMUX Logical Station Information.
Field Descriptions
Error/Status Tag Name
Optionally, enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station).
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. This number must be unique among all Opto 22 OPTOMUX devices across all ports. You will later enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number identifies the device to or from which data is sent or received.
Valid Entry: unique numeric value from 0 - 999 (default = 0)
Device Type
Define the type of Opto 22 OPTOMUX device to which communications are to be directed.
Valid Entry: Enter one of the following values:
Station Address
Comment
When the table is complete, click Save to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box. The following tables shows sample Logical Station Information Table entries.
Column Error/Status Tag Name Logical Station Device Type Station Address Comment Entry PORT1_ERR1 Description Communication error codes generated for this logical station are stored in an analog tag, PORT1_ERR1. A device communicating with FactoryLink via logical port 0 is assigned a logical number of 10. DIG16 specifies the device type associated with this logical station. Station address 0 specifies the physical station address associated with this logical station. User reference
C ONFIGURING
Accessing
THE
In your server application, open Device Interfaces > Opto 22 OPTOMUX > OPTOMUX Read/Write Control. Field Descriptions Complete a row for each read or write table. See Reading Data from a Device on page 73 and Writing Data to a Device on page 97 for specific instructions on configuring each type of read and write operation.
Table Name
Give this read and/or write request a name. Define one request (table) per line and do not include spaces in the name. You can define as many tables in this table as available memory allows. Try to make the table name reflective of the data and operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Exception Write
If this is an exception write operation in which tag values are written to the device only upon change, enter YES. In an exception write, an internal change-status indicator (the change status bit) within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Valid Entry: no, yes (default = no)
Note: Do not specify tags expected to change at frequent intervals in an exception write table. Any specified tag is written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communication or result in an error message.
If this table is configured for block read operations, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first.
Valid Entry:
1 - 4 (default = 1) Note: The Block Read Trigger, Block Read Disable, Block Read Complete, Block Read State, and Block Read Priority fields only apply to Triggered Read Operations. Of these tags, only Block Read Trigger is required; the others are optional. Do not define these block read tags for unsolicited read operations or for write operations.
Block Read Trigger
If this table is configured for triggered read operations, enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When the value of the block read trigger is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
If this table is configured for triggered read operations and you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When the value of the tag represented by this tag name is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1.
To re-enable a block read table that is disabled, set this tag back to 0 (OFF). Valid Entry: tag name Valid Data Type: digital Note: The Block Read Trigger, Block Read Disable, Block Read Complete, Block Read State, and Block Read Priority fields only apply to Triggered Read Operations. Of these tags, only Block Read Trigger is required; the others are optional. Do not define these block read tags for unsolicited read operations or for write operations.
Tip The Block Read Disable tag can disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle ceases upon disabling, however. To re-enable a cascaded loop or a self-triggered read table, the Block Read Disable tag must be changed to 0 and the Block Read Trigger tag must be forced to 1.
If this is an unsolicited read operation, a write operation, or a triggered read table in which more than one logical port is specified, ignore this column. If this is table is configured for a triggered read operation and you need a digital tag to indicate when the operation is complete, enter a tag name. The value of the tag represented by this tag name is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again.
Valid Entry: tag name Valid Data Type: digital
Note: Do not use the Block Read Complete if the associated information table contains logical stations assigned to more than one logical port.
Block Read State
If this is an unsolicited read operation, a write operation, or a triggered read table in which more than one logical port is specified, ignore this column. If this table is configured for a triggered read operation and you need a digital tag to indicate the state of the operation (in progress or complete), enter a tag name. The value of the tag represented by this tag name is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
Note: Do not use the Block Read Complete if the associated information table contains logical stations assigned to more than one logical port.
Block Write Priority
If this table is configured for block or exception write operations, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first.
Valid Entry: 1 - 4 (default = 1)
Note: The Block Write Trigger, Block Write Disable, Block Write Complete, Block Write and Block Write Priority tags apply only to write operations. Of these tags, only Block Write Trigger is required for a block write table; the others are optional. Do not define these block write tags for read operations.
State,
If this table is to be configured for block write operations, enter a tag name for a digital tag to initiate a block write of the tag values represented by the tag names specified in the Read/Write Information table to the addresses defined to receive the values. When the value of the block write trigger is forced to 1 (ON), the tag values are written.
Valid Entry: tag name Valid Data Type: digital
If this table is configured for block write operations or exception write operations, you plan to periodically disable, enter a tag name for a digital tag to disable writes to the addresses specified in this table. When the value of the tag represented by this tag name is forced to 1 (ON), the write operations are not executed, even when the block write trigger is set to 1 or an exception value changes. To re-enable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
Tip The Block Write Disable tag can disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle ceases upon disabling, however. To re-enable a cascaded loop or a self-triggered read table, the Block Write Disable tag must be changed to 0 and the Block Write Trigger tag must be forced to 1. See Application Design Tips and Techniques on page 127 for details.
To disable exception writes you must also define a Block Write Trigger even if it is never used.
If this table is configured for block write operations and you need a digital tag to indicate when the operation is complete, enter a tag name. The value of the tag represented by this tag name is forced to 1 (ON) at startup. After the data defined in the Read/Write Information table is written to the device, the complete tag is forced to 1 again.
Valid Entry: tag name Valid Data Type: digital
If this table is configured for block write operations and you need a digital tag to indicate the state of the operation (in progress or complete), enter a tag name. The value of the tag represented by this tag name is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the data defined in the Read/Write Information table is written to the device, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click Save to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box. The following table shows sample Read/Write Control Table entries.
Column
Table Name Exception Write Block Read Priority Block Read Trigger Block Read Disable
Entry
READ
Description The name of this table is READ. This is not an exception write table. The block read priority, which is automatically set if you do not enter a value, is 1, the highest priority. When the value of omux_rtrig1 is 1, FactoryLink reads the specified address and stores its value in the tag configured for this table (in the Read/Write Information table).
NO 1
omux_rtrig1
omux_rdbl1 When the value of omux_rdbl1 is 1, FactoryLink disregards the trigger tag, omux_rtrig1, and does not process the READ table.
Block Read Complete Block Read State Block Write Priority Block Write Trigger Block Write Disable Block Write Complete Block Write State
omux_rcpt1
Once the data in the device is read and stored in the specified tag (defined in the Read/Write Information table), FactoryLink forces a value of 1 to omux_rcpt1. Once the data is read and stored in the specified tag, FactoryLink forces a value of 1 to omux_rst1. During the read operation, omux_rst1 is set to 0. The block write priority is set to 1 by default. Leaving this field blank configures the table to not support triggered writes. Since this is not configured as a write table, tag names for tags unique to write tables are not defined. Since this is not configured as a write table, tag names for tags unique to write tables are not defined. Since this is not configured as a write table, tag names for tags unique to write tables are not defined.
omux_rst1
C ONFIGURING
Accessing
THE
In your server application, open Device Interfaces > Opto 22 OPTOMUX > OPTOMUX Read/Write Control > your table name > OPTOMUX Read/Write Information. Field Descriptions
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink stores the data read from the device. For a write table, specify a tag name for a tag containing a value written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, float
Logical Station
Enter the number representing the device from which the data is read or to which the tags value is written. This number was originally defined in the Logical Station Information table for the logical port through which communication with this device occurs.
Valid Entry: previously defined logical station number (0 - 999)
Module Position
Position on the Opto 22 OPTOMUX device to be read or written to by the EDI task.
Valid Entry: 0 - 15
Attribute
Attribute name identifying the type of read or write command to send to the Opto 22 OPTOMUX device.
Valid Entry: For a list of valid entries, see Technical Notes on
page 368.
Init Data
Data to be read from or written to the memory address that you specify in the Module Position field.
Valid Entry: alphanumeric or hexadecimal string of up to four
characters
Note: The Init Data column is typically not used. See Read/Write Information Init Data Field Notes on page 370 for more information about this feature. Typical users can leave this field blank.
When the table is complete, click Save to validate the information. Define the data type (digital, analog, float) for any tag names displayed in the Tag Definition dialog box. The following table shows sample Read/Write Information Table entries.
Column
Table Name Tag Name
Entry
READ PROCVAR
Description The table name defined in the Read/Write Control table is displayed. When the READ table is triggered by omux_rtrig1 (defined in the Read/Write Control table), FactoryLink processes the table. The value read from the device is stored in PROCVAR. The value stored in this tag is read from the device configured as logical station 1. This specifies the position on the Opto 22 OPTOMUX device to access. This specifies the type of command to execute using this device. Data to read from or write to the memory address you specified in the Module Position column.
1 0 digital 0101
C ONFIGURING
THE
You can configure one OPTOMUX Initialization table with up to 1,000 entries through the OPTOMUX Initialization Information table. The EDI task executes this table at startup of the EDI task or when the Opto 22 OPTOMUX protocol module receives a Power Up Clear Expected message from a logical station. Accessing In your server application, open Device Interfaces > Opto 22 OPTOMUX > OPTOMUX Initialization Information. Field Descriptions
Logical Station Number Module Position
Enter a number to identify the logical station to which initialization commands are sent.
Valid Entry: 0 - 999
Attribute
Attribute name identifying the type of write command to send to the Opto 22 OPTOMUX device.
Valid Entry: For a list of valid entries, Technical Notes on page
368.
Init Data
Data to be written to the memory address specified in the Module Position field.
Valid Entry: alphanumeric or hexadecimal string of up to four
characters.
When the table is complete, click the Save to validate the information.
TECHNICAL N OTES
Cable Diagrams This section contains pin-out diagrams for cables required to connect the Opto 22 OPTOMUX devices to the serial cards.
Serial Connections
To connect a serial card to an Opto 22 OPTOMUX AC-7, create an RS232-C cable with the following pinout.
RS 232 Cable - Serial Card to Opto 22 OPTOMUX AC-7
Serial Card
2 TxD 3 RxD 4 RTS CTS 5 Ground 7 DSR 6 RLSD 8 DTR 20
OPTOMUX AC-7
2 3 4 5 7 6 8 20 TxD RxD RTS CTS Ground DSR RLSD DTR
Serial RS-422
The following diagram shows the connection between adjacent Opto 22 OPTOMUX controllers on the serial link and serial RS-422 cards. The last Opto 22 OPTOMUX has only 5 wires To Host, From Host, and common. Note: Always think of the previous Opto 22 OPTOMUX as the Host.
Read/Write Information Init Data Field Notes These are detailed notes for users who want to use of the Init Data feature of the driver. Typical users can leave this field blank and skip this discussion. The Init Data column is used to send static data to the logical station and module number specified in the Read/Write Information record. It is not used in read operations. When used in a table designated as write, the value in the related tag is ignored and the data in the Init Data column is sent in its place. For example, assume a table is configured for exception writes and the record is configured with an analog tag with an Attribute of ANAOUT and Init Data of 284. When the analog value changes, its value is discarded by the driver and the value of 284 is sent in its place. To determine how the data is interpreted by the device you must look up the command sent in the OPTO 22 operations manual. (See below to determine the command sent for the entered attribute). The Init Data is placed in the [data] portion of the command. In the above example, the Attribute ANAOUT send a command S. From the OPTO 22 operations manual, a command S accepts [data] contains three ASCII-Hex digits and so the 284 is interpreted as hexadecimal. This list provides the Attributes used in the Init Data column. If an Attribute is not listed, the Init Data is not used; leave it blank. The Attributes are grouped based on how the data entered in the Init Data column is interpreted. Valid characters to enter are based on the selected Attribute. Refer to the OPTO 22 operations manual for the Attributes valid entries.
One ASCII Character
The first character entered is sent as the write data. If additional characters are entered in the field, then an error is generated by the driver when the command is to be issued and the write is aborted. Commands using One ASCII Character are: CFGDWDOG and CFWAWDOG.
Valid Entry: Accepted character is any character accepted in the
field. Valid characters to enter are based on the selected Attribute. Refer to the OPTO 22 operations manual for valid entries for the Attribute.
The first two characters entered are sent as the write data. If less than two or more than two characters are entered in the field, then an error is generated by the driver when the command is to be issued and the write is aborted. Commands using Two ASCII Characters are TIMERRES and RDAVERAG.
Valid Entry: Accepted characters are any characters accepted in
the field. Valid characters to enter are based on the selected Attribute. Refer to the OPTO 22 operations manual for valid entries for the Attribute.
One to three entered characters are sent as the write data. If more than three characters are entered in the field, then an error is generated by the driver when the command is to be issued and the write is aborted. Commands using One to Three ASCII Characters are ANAOUT.
Valid Entry: Accepted characters are any character accepted in
the field. Valid characters to enter are based on the selected Attribute. Refer to the OPTO 22 operations manual for valid entries for the Attribute.
One to four entered characters are sent as the write data. If more than four characters are entered in the field, then an error is generated by the driver when the command is to be issued and the write is aborted. Commands using One to Four ASCII Characters are CFGTMPRB, DELAY1, DELAY2, DELAY3, DELAY4, ONPULSE, and OFFPULSE.
Valid Entry: Accepted characters are any character accepted in
the field. Valid characters to enter are based on the selected Attribute. Refer to the OPTO 22 operations manual for valid entries for the Attribute.
Four entered characters are sent as the write data. If more than four characters are entered in the field, then an error is generated by the driver when the command is to be issued and the write is aborted. If less than four are entered, then leading zeros (0)s are added to the data sent. For example, if a B is entered, 000B is sent. Commands using Four ASCII Characters are CFGOFFST, CFGGAIN, LRESSQWV and HRESSQWV.
the field. Valid characters to enter are based on the selected Attribute. Refer to the OPTO 22 operations manual for valid entries for the Attribute.
0 or 1 Character
Either a 0 or a 1 must be entered. If a character other than 0 or 1 is entered, the results are unpredictable. If more than one character is entered in the field, then the additional characters are ignored, only the first is used. Commands using 0 or 1 Character are digital.
Valid Entry: 0 or 1
If a 0 is entered, a command L Deactivate Outputs is sent. If a 1 is entered, a command K Activate Outputs is sent.
Initialization Sequence The data from the initialization tables is sent to each configured brain board at start up. If the initialization data cannot be sent to a particular brain board successfully, then that station is marked as requiring initialization. Each time a read or write is requested from the EDI task, the driver checks the stations initialization status. If the status is initialized successfully, the read or write commands are sent immediately. If the status is initialization required, then the initialization data is sent. If initialization is unsuccessful, the read or write is marked as failed due to power up clear error and returned to EDI. If, during normal read and write operations, a brain board returns a Power Up Clear (PUC) error, the driver will attempt to send the initialization data to that station again and then retry the command that had the PUC error response. If the initialization cannot be completed successfully, the read or write response is returned to EDI as failed due to a PUC error and the station is marked as requiring initialization. No further read or write commands will be attempted until the initialization data is successfully sent again. Note: Prior to driver version 6.5.1, initialization was treated on a per port bases, that is, if any station configured on the port fails, then no read or writes will be attempted until all stations are successfully initialized.
Write Operations For write operations, the following entries are valid for the Attribute field in both the OPTOMUX Initialization Information table and in the OPTOMUX Read/Write Information table for tables configured for write operations. The table lists the configuration table Attribute entries along with the actual OPTOMUX command letter issued by the driver and whether the command is for analog, digital or both types of boards. It is highly recommended that before configuring the OPTOMUX driver that you obtain the Brain Board operations manual for the appropriate device. Consult this manual to determine the function for each of the issued commands.
Valid Entry
ANAOUT
Command Type analog analog digital analog both digital digital analog both analog digital digital
Description Read/write analog output (can be used in read table as well) Configure analog watchdog, delay Configure digital watchdog, delay Set gain coefficients Configure input Configure latch to off Configure latch off to on Set offset Configure output Configure temperature probe Deactivate output Clear pulse counter
CFGAWDOG CFGDWDOG CFGGAIN CFGINP CFGLCHOF CFGLCHON CFGOFFST CFGOUT CFGTMPRB CLEAR CLRCOUNT
Valid Entry
CLRDURAT CLRLATCH DELAYOFF DELAY1 DELAY2 DELAY3 DELAY4 DIGITAL
OPTOMUX Command Letter Issued g S Z/G Z/H Z/I Z/J Z/K K or L Z/M Z/L c b A B K or L U V n
Command Type digital digital digital digital digital digital digital digital digital digital digital digital both both digital digital digital digital
Description Clear pulse duration counter Clear latch Set Time Delay with G modifier Set Time Delay with H modifier Set Time Delay with I modifier Set Time Delay with J modifier Set Time Delay with K modifier K sent if digital tag data = 1 L sent if digital tag data = 0 Set Time Delay with M modifier Set Time Delay with L modifier Trigger on negative pulse (configure duration measurement for negative pulses) Trigger on positive pulse (configure duration measurement for positive pulses) Power up clear Reset K sent if digital tag data = 1 L sent if digital tag data = 0 Start pulse counter Stop pulse counter Set timer resolution
POSITRIG
Note: * Write value is split into two components: * Upper nibble used for On time * Lower nibble used Off time Examples: Low Resolution (LRESSQWV) value of 256 decimal = 0102 hexadecimal (upper nibble value 1, lower 2) which sets an On time of (1 * TRS * 2.56 sec) and an Off time of (2 * TRS * 2.56 sec). High Resolution (HRESSQWV) value of 12875 decimal = 324B hexadecimal (upper nibble value 50, lower 75) which sets an On time of (50 * TRS * 10 msec) and an Off time of (75 * TRS * 10 msec). Read Operations For read operations, the following entries are valid for the Attribute field in the OPTOMUX Read/Write Information table for tables configured for write operations. The table lists the configuration table Attribute entries along with the actual OPTOMUX command letter issued by the driver and whether the command is for analog, digital or both types of boards. It is highly recommended that before configuring the OPTOMUX driver that you obtain the Brain Board operations manual for the appropriate device. Consult this manual to determine the function for each of the issued commands.
Valid Entry
ANAIN ANAOUT
Description Read analog input Read/write analog output (can be used in write table as well) Read pulse measurement complete bit Read counter
CMPLTBIT COUNTER
Valid Entry
COUNTCLR DIGTIAL
Description Read and clear counter Read/write digital output (Can be used in write table as well. See DIGITAL in the Write Operations table.) Read and clear pulse duration measurement Read pulse duration counter Calculate Gain Coefficient Read latch Read and clear latch Instructs Opto 22 OPTOMUX to deactivate the selected modules for a specified period of time and then reactivate the modules Calculate offset Instructs Opto 22 OPTOMUX to activate selected modules for a specified period of time Reads and averages the analog value of a single position over a specified number of samples Calculate and set gain Calculate and set offset Read temperature probe input
DURATCLR
f e X Q R l
OFFSET ONPULSE
g k
analog digital
RDAVERAG
analog
Z h l
E RROR M ESSAGES
During EDI run time, FactoryLink generates and displays messages for the Opto 22 OPTOMUX protocol module on the Run-Time Manager screen. These messages are stored in FactoryLink tags. You define the tag names for these tags in the Logical Station table. See Messages and Codes on page 147 for information about the messages displayed for the EDI task and the format in which protocol module messages are generated and for a list of the error messages generated by the FactoryLink EDI task. Opto 22 OPTOMUX Error Message Format Opto 22 OPTOMUX run-time error messages appear on the Run-Time Manager screen in the following format: DEV:XXX LSTA:XXX ER:XXX TBL:XXX PKT:XXX where
DEV:XXX LSTA:XXX ER:XXX The device The logical station number The error code that identifies the communication error. These error codes come from the EDI task or the Opto 22 OPTOMUX external devices. The Read/Write Table experiencing the error The number of the packet experiencing the error
TBL:XXX PKT:XXX
EDI Error Codes The EDI task generates the following error codes.
Error Code Code 06H 07H 08H 0AH 14H 15H 16H 17H 18H 19H Cause Received invalid read length. Received translate error. Received bad data error. Received invalid message ID. Invalid data returned. Turn around error. Buffer overflow error. Checksum error on returned data. Transmit error. Invalid echo. Description Action 1. Verify the device configuration and cabling. 2. Check that FactoryLink configuration tables contain the proper station addresses and parameters. 3. Verify the OPTOMUX Logical Station Control table contains the proper baud rate, parity, and data format parameters. (For Error Code 15H only) 4. Verify the brain boards power supply is set at the proper voltage level.
Opto 22 OPTOMUX Error Codes Opto 22 OPTOMUX devices generate the following error codes.
Error Code 1EH Description Cause: Unexpected power up clear. Action: Refer to the brain board operations manual for the appropriate Opto 22 OPTOMUX device. 1FH Cause: Undefined command. Action: Refer to the brain board operations manual for the appropriate Opto 22 OPTOMUX device. 20H Cause: Checksum error. Action: Refer to the brain board operations manual for the appropriate Opto 22 OPTOMUX device. 21H Cause: Input buffer overrun. Action: Refer to the brain board operations manual for the appropriate Opto 22 OPTOMUX device. 22H Cause: Non-printable ASCII character. Action: Refer to the brain board operations manual for the appropriate Opto 22 OPTOMUX device. 23H Cause: Data field error (not enough characters). Action: Refer to the brain board operations manual for the appropriate Opto 22 OPTOMUX device. 24H Cause: Communications link watchdog timeout. Action: Refer to the brain board operations manual for the appropriate Opto 22 OPTOMUX device. 25H Cause: Specified limits invalid. Action: Refer to the brain board operations manual for the appropriate Opto 22 OPTOMUX device.
Chapter 18
Siemens CP525
This chapter contains information to set up and configure bidirectional communications between the FactoryLink real-time database and the Siemens CP525 using RK512 with either 3964 or 3964R protocol.
Note
Before completing the protocol-specific Siemens CP525 configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58for details. In your server application, open Device Interfaces > Siemens CP525.
C ONFIGURING
THE
Open the Logical Station Control Table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a device.
Valid Entry: previously defined logical port number
Baud Rate
Enter the speed at which the protocol module communicates with the devices linked to FactoryLink via this logical port. This entry must match the baud rate configuration of the devices. Refer to the device manufacturers documentation for details.
Valid Entry: 110 - 115200 (default=9600)
Parity
Enter the parity error correction during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: none, even, odd (default=even)
Data Bits
Enter the number of data bits used during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 7, 8 (default=8)
Stop Bits
Enter the number of bits sent after a character to create a pause before the start of the next character. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 1, 2 (default=1)
Enter the length of time, in tenths of a second, the protocol module will wait to receive a response to a read or write command before timing out. You must enter a value greater than 0 for the protocol module to timeout.
Valid Entry: standard Siemens timeouts, based on the baud rate
(default=0)
Enter the type of error detection protocol. None Siemens Procedure 3964 BCC (Default) Siemens Procedure 3964R
Retry Request
Enter the maximum number of times the protocol module will retry a read or write command to a device communicating through this logical port if the command response is invalid or is not received.
Valid Entry: 0 - 65535 (default=3)
Master/Slave
Indicate whether the FactoryLink station is the Master or the Slave of the communications channel. M (Default) Master S Slave
(Optional) Enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the Siemens 525 Logical Station Control table:
Field
Logical Port
Entry
Description
Specifies the logical communication path configured by this table. Specifies the communication rate. Adds a parity bit to the sum of the transmitted bits to make it even. Specifies 8 data bits in the transmission. Specifies 1 stop bit in the transmission. The response timeout is 10 seconds. Specifies the error checking method. Attempt the request three times before generating a timeout. Master (default). Message tag containing Siemens error messages.
Baud Rate Parity Data Bits Stop Bits Response Timeout (0.1 Sec) LRC Error Detection Retry Request Master/Slave Status Msg Tag
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open Logical Station Information table Complete a row for each device to communicate through this logical port.
Error /Status Tag Name
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station). You can animate output-text objects to display the codes stored in an Error/Status Tag Name tag on a graphics screen.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. You will later enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry: 0 - 999
Define the maximum number of bytes the device defined in this row can transmit in one message. Most devices can transmit 256 bytes, or 128 registers of data. The protocol being used (point-to-point or IEEE 802.3) does not affect the maximum packet size.
Valid Entry: 32, 64
Comment
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the Siemens 525 Logical Station Information table:
Field
Error/Status Tag Name Logical Station Max Packet Length
Entry
Description
SIEM_STATION0_ STATUS 0 64
Contains information about communication errors. Specifies the logical communication path. Maximum packet length is 64.
C ONFIGURING
THE
Open the Read/Write Control table. Complete a row for each read or write table.
Tip
See Application Design Tips and Techniques on page 127 for information about triggering schemes using tags defined in this table.
Table Name
Assign a name to this read or write request. Define one request (table) per line and do not include spaces in the name. You can define as many tables as available memory allows. Try to make the table name reflective of the operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Unsolicited Read
For EDI to interpret this operation as a triggered block read or as a write operation, accept the default of NO.
If this is an unsolicited read operation, enter YES or FORCE. EDI will interpret this operation as an unsolicited read and emulate the devices addressing structure based on entries you make in the Read/Write Information table. The incoming data will be stored in the real-time database as specified in this field. If you enter YES, the incoming data will be stored in the tag represented by the tag name specified in the Read/Write Information table. If the current value of the tag is equal to the new value, the change-status indicator is unaffected. If a different value is being stored the tag, however, it will overwrite the current value and the tags change-status indicator will be set to 1 (ON). If you enter FORCE, the data is stored in the specified tag and the change-status indicator is automatically set to 1, regardless of whether the current value matches the new value.
Valid Entry: yes, no, force (default=no)
Exception Write
For EDI to interpret this operation as a triggered block write or as a read operation, accept the default of NO. For EDI to interpret this operation as an exception write and write tag values to the device only when those values change, enter YES. Do not specify tags expected to change at frequent and unpredictable intervals in an exception write table. Any tag specified will be written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communications or result in an error message. In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Valid Entry: yes, no (default=no)
If this is a block read operation, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is an unsolicited read or a write operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block read.
Valid Entry: 1 - 4 (default=1)
Note
The Block Read Trigger, Block Read Disable, Block Read Complete, and Block Read State tags apply only to triggered read operations. Do not define these tags for unsolicited read operations or for write operations.
Block Read Trigger
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is required. Enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When this tags value is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
Tip
The Block Read Disable tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for details.
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1. To reenable a block read table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
If this is a block or exception write operation, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1.
If this is a read operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block or exception write.
Valid Entry: 1 - 4 (default=1)
Note
The Block Write Trigger, Block Write Disable, Block Write Complete, and Block Write State tags apply only to write operations. Do not define these tags for read operations.
Block Write Trigger
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is required. Enter a tag name for a digital tag to initiate a block write of the tag values specified in the Read/Write Information table to the addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values.
Valid Entry: tag name Valid Data Type: digital
Tip
The Block Write Disable tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Block Write Disable
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable a block write to the addresses specified in this table. When this tags value is forced to 1 (ON), the write operation is not executed, even when the block write trigger is set to 1.
To reenable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write table, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this tables Read/Write Information table is written to the device, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the data defined in this tables Read/Write Information table is written to the device, the state tag is forced back to 1. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click the Save icon to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the Siemens 525 Read/Write Control table:
Field
Table Name Unsolicited Read Exception Write Block Read Priority Block Read Trigger
Entry
Description
Specifies the table name. Table will not perform unsolicited reads. Table will not perform exception writes. Priority for tables set to 1. When the value of SIEM_READ_ TRIGGER is 1 or (on), a block read of values specified by the Read/Write Information table associated with SIEMBRD occurs. The write priority for this table is set to 1 by default. Since this is a read table, the tags specific to write requests are not defined.
Block Write Priority Block Write Trigger Block Write Complete Block Write Disable Block Write State
C ONFIGURING
THE
From the Read/Write Control table, select the row for the table you are configuring and open the Read/Write Information table. For a Read Table add a table entry for each FactoryLink tag in which data read from the device will be stored when the operation executes. For a Write Table add a table entry for each tag to be written when the operation executes.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, longana, float, message
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
PLC Region
Enter the data area of the PLC to be read/written. For read operations: CB DB DX FB IB OB PB TB Counters Data block Extended data block Flag bytes Input bytes Output bytes Peripheral blocks Timers
Enter the address of word in word regions or address of byte in byte regions that is read or written. 0-255 CB, DB, DX, FB, PB, TB 0-127 IB, OB
Bit/Length
(For digital tags) Bit in the word or byte that is read or written. 0 (LSB) - 15 (MSB): For word regions 0 (LSB) - 7 (MSB): For byte regions (For message tags) Length in word or byte that is read or written. Length in words: (For word regions) Limited to the packet size for the station: 64 = 64 words; 32 = 32 words Length in bytes: (For byte regions) Limited to the packet size for the station: 64 = 128 bytes; 32 = 64 bytes
Data Type
Specify the type of data being read from or written to the device for each tag defined in the Tag Name field.
Valid Entry: See Siemens CP525 Data Types on page 395.
Specify the number of the CPU that is to process the read or write operation or enter NONE for no CPU.
Valid Entry: NONE, 0 - 4 (default=NONE)
Specify the byte number of the coordination flag or enter NONE if no coordination flag is set.
Valid Entry: NONE, 0 - 254 (default=NONE)
Specify the bit number of the coordination flag or enter NONE if no coordination flag is set.
Valid Entry: NONE, 0 - 7 (default=NONE)
When the table is complete, click the Save icon to validate the information. Define the data type (digital, analog, long analog, or floating-point) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the Siemens 525 Read/Write Information table.
Field
Table Name Tag Name Logical Station PLC Region Data Block Word/Byte Bit/Length Data Type Coordination Flag CPU Coordination Flag Byte Coordination Flag Bit
Entry
Description
Specifies the Read/Write table name. The value read from the device will be stored in SIEMDIG1. Specifies the path to send the request. Data block. Data block in the PLC to write the value of SIEMDIG1. Word/byte in the PLC to write the value of SIEMDIG1. Bit/length of the value written. Defaults to Siemens data type BIN.
Each FactoryLink data type also has a range of valid Siemens PLC data types. You may choose to specify a Siemens PLC data type. The following tables show the FactoryLink data types and the corresponding Siemens PLC data types
Digital Conversion
PLC Type
Conversion
DIG
Analog Conversion
PLC Type
Conversion
Converts the FactoryLink value to or from a 2-byte, signed integer Converts the FactoryLink value to or from a 4-byte, signed integer Converts the FactoryLink value to or from a 2-byte, unsigned, three-digit, binary-coded decimal Converts the FactoryLink value to or from a 4-byte, unsigned, seven-digit, binary-coded decimal Converts the FactoryLink value to or from a 4-byte, Siemens PLC floating-point (Valid only in byte PLC regions) Converts the FactoryLink value to or from a single unsigned byte (0 - 255)
Longana Conversion
PLC Type
Conversion
Converts the FactoryLink value to or from a 2-byte, signed integer Converts the FactoryLink value to or from a 4-byte signed integer Converts the FactoryLink value to or from a 2-byte, unsigned, three-digit, binary-coded decimal Converts the FactoryLink value to or from a four-digit, unsigned, seven-digit, binary-coded decimal
PLC Type
Conversion
FLT BYTE
Converts the FactoryLink value to or from a 4-byte Siemens PLC floating-point (Valid only in byte PLC regions) Converts the FactoryLink value to or from a single unsigned byte (0 - 255)
Floating-Point Conversion
PLC Type
Conversion
Converts the FactoryLink value to or from a 2-byte, signed integer Converts the FactoryLink value to or from a 4-byte, signed integer Converts the FactoryLink value to or from a 2-byte, unsigned three-digit, binary-coded decimal Converts the FactoryLink value to or from a 4-byte, unsigned, seven-digit, binary-coded decimal Converts the FactoryLink value to or from a 4-byte, Siemens PLC Floating-point (Valid only in byte PLC regions) Converts the FactoryLink value to or from a single, unsigned byte (0 - 255)
Message Conversion
PLC Type
Conversion
HILO
Consecutive bytes in the FactoryLink message tag are read or written to the PLC as a high-order (HI) byte followed by a low-order (LO) byte. Consecutive bytes in the FactoryLink message tag are read or written to the PLC as a low-order (LO) byte followed by a high-order (HI) byte.
LOHI
Cause:
Internal error.
Cause:
Action: Check line parameters (baud rate, data bits, etc.), cable, CP525 programming.
0003h
Cause:
Cause:
Internal error.
XX05h
Cause:
Cause:
After retry count, received more or fewer bytes than requested in read request packet.
Cause:
Internal error.
Chapter 19
Siemens Sinec H1
This chapter contains information needed to set up and configure bidirectional communications between the FactoryLink real-time database and any Siemens Simatic S5 or S505 PLC, using one of the following interfaces: CP-535, CP-143 card CP-1433, CP-1434 Ethernet interface card over an Ethernet network Note: The Siemens Since H1 driver does not work on Microsoft Windows XP platforms, because Microsoft removed the DLC protocol stack from XP. However, this driver can be used on Windows 2000 platforms.
S IEMENS H1 C OMMUNICATIONS
Communication in the Siemens H1 protocol module occurs between the Siemens Ethernet Interface and the Device Control Module (DCM) using logical entities called Transport Service Access Points (TSAPs). TSAPs are communication points that link the Siemens Ethernet Interface and the DCM. TSAPs work in pairs. A DCM TSAP works with a Siemens Ethernet Interface TSAP, with one TSAP on each side of the communication link. Types of Communication On one side of the communication link, the DCM performs three types of communication. Each type of communication has an associated TSAP pair. The DCM performs the following types of communication: Solicited Reads Block reads of data from the Siemens PLC to the real-time database. S5 the Read Active/Passive TSAP pair consists of a Fetch active TSAP in the DCM and a Fetch passive TSAP in the Siemens Ethernet Interface card. S505 the Read Active/Passive TSAP pair consists of a Read active TSAP in the DCM and a Read passive TSAP in the Siemens Ethernet Interface card.
Solicited Writes Block and exception writes of data from the real-time database to the Siemens PLC. S5 the Write Active/Passive TSAP pair consists of a Send active TSAP in the DCM and a Receive passive TSAP in the Siemens Ethernet Interface card. S505 the Write Active/Passive TSAP pair consists of a Write active TSAP in the DCM and a Write passive TSAP in the Siemens Ethernet Interface card. Unsolicited Reads S5 Siemens PLC-generated writes sending data from the Siemens PLC to the real-time database. The Write Active/Passive TSAP pair consists of a Receive passive in the DCM and a Send active in the Siemens Ethernet Interface card. S505 Siemens PLC-generated writes sending data from the Siemens PLC to the real-time database. The Write Active/Passive TSAP pair consists of a Write passive in the DCM and a Write active in the Siemens Ethernet Interface card. The following table describes the relationships between the three types of communication performed by the DCM and the TSAP pairs.
TSAP Pair Type of Communication Initiator of the Communication Siemens PLC Ethernet Interface DCM Type of Data Exchanged
Solicited Reads/ Siemens Read Active/Passive Solicited Writes/ Siemens Write Active/Passive Unsolicited Reads/ Siemens Write Active/Passive
FactoryLink
Fetch passive (S5) Read passive (S505) Receive passive (S5) Write passive (S505) Send active
Fetch active (S5) Block reads Read active (S505) Send active (S5) Write active (S505) Receive passive Block and exception writes Siemens PLCgenerated writes
FactoryLink
External Device
where:
Active Passive Fetch
Describes the Siemens Interface coprocessor jobs and denotes the initiator or master of the link. Describes the Siemens Interface coprocessor jobs and denotes the receiver or slave of the link. Describes the Siemens Interface coprocessor jobs that request information from an external device. These are either Active or Passive. Describes the Siemens Interface coprocessor jobs that transmit information to an external device. These are Active only. Describes the Siemens Interface coprocessor jobs that receive information from an external device. These are Passive only.
Send Receive
Defining a TSAP Pair Each line you configure in the Siemens H1 Logical Station Information table corresponds to a specific Siemens Ethernet Interface on the LAN. The information you configure in each line enables the Device Control Module to allocate TSAPs and to connect each DCM TSAP with its corresponding Siemens Ethernet Interface TSAP. To define a TSAP pair, you must first obtain the following information: The DCM FactoryLink platform Ethernet adapter address The Siemens PLC Ethernet adapter address The Remote TSAP ID The Local TSAP ID
Note
The terms local and remote are relative to your configuration. When you configure the Siemens H1 tables, designate the FactoryLink side of the communications link as local and the Siemens Ethernet Interface side as remote. You must program the Ethernet adapter address of the FactoryLink platform in the Siemens Ethernet Interface. For further information about the Ethernet address of the FactoryLink platform, see Siemens H1 Adapter Display Utility (H1MPDISP) on page 445.
The TSAP ID is an eight-character, fixed-length ASCII string. As long as the Device Control Module and the Siemens Ethernet Interface are programmed with corresponding values, these fields can be any eight-character ASCII string. The Siemens Ethernet Interface programming software defaults the TSAP ID based on the Ethernet Interface's SSNR (CP board number) and ANR (CP job number). Depending on the version of Siemens programming software used, the TSAP ID defaults to either: ____SSAA (COM535) or ____SS_AA (COM143) where
_ SS _S AA _A
Is a space character in Siemens software programming displays Is the SSNR (card) number if two-digits Is the SSNR (card) number if one-digit Is the ANR (job) number if two-digits Is the ANR (card) number if one-digit
TSAP IDs and ASCII Equivalents The EDI task processes the TSAP ID fields by space-padding-right-justifying the 8-byte string to the right-most non-space character. The following examples illustrate the TSAP IDs and their eight-character ASCII equivalents:
TSAP ID 8-Character ASCII
A CCESSING
THE
S IEMENS H1 TABLES
Note
Before completing the protocol-specific Siemens H1 configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58 for details. In your server application, open Device Interfaces > Siemens Sinec H1.
C ONFIGURING
THE
Open the Logical Station Control table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a device.
Valid Entry: previously defined logical port number (default=0)
Enter the Ethernet adapter installed in the FactoryLink system for use with this logical port.
Valid Entry: 0 or 1 (default=0)
At run time, the remaining fields of the Siemens H1 Logical Station Control table (except for the Status Message Tag field) control the system resources used by the Device Control Module (DCM) task. (The DCM task runs outside FactoryLink and provides the interface between the FactoryLink EDI task and the external device. For more information about the DCM task, see Siemens H1 Communications on page 401.)
Enter the number of tables configured to perform reads/writes on which the DCM task can operate simultaneously. A table can be a block read table, a block write table, or an exception write entry in a Read/Write Control table. Enter a number that is equal to or smaller than the Maximum Concurrent Requests. At startup, the DCM task allocates memory
for the number of solicited tables specified in this field. Each of these solicited tables contains one or more solicited requests. If you enter a number larger than the number specified in the Maximum Concurrent Requests field, you are using memory inefficiently.
Valid Entry: 5 - 100 (default=10)
Enter the number of solicited requests (individual read or write transactions) on which the DCM task can operate simultaneously. Each request requires slightly over 4 kilobytes of memory.
Valid Entry: 5 - 100 (default=10)
Enter the shared pool of memory available for all logical stations with configured unsolicited operations. The DCM has a structure similar to the solicited request for each concurrently active unsolicited write command received from the PLC transaction. Each buffer contains slightly over 4 kilobytes of memory.
Valid Entry: 5 - 100 (default=10)
Enter the internal queue size of unsolicited write commands (number of tags on queue) received from the PLC awaiting formatting for the FactoryLink database.
Valid Entry: 5 - 100 (default=10)
Enter the shared pool of DCM allocated buffers used by all logical stations to transmit or receive Ethernet packets. Each buffer is slightly over 1500 bytes in length.
Valid Entry: 5 - 250 (default=30)
Enter the amount of time in seconds a logical stations solicited connections remain active without solicited transactions occurring. In the DCM, each connected logical station requires periodic processing to maintain the connection while no actual solicited transactions take place with the PLC. Solicited operations to disconnected stations require additional overhead to reconnect
before a transaction can take place. Therefore, set this time according to the application. For example, when reading from a station on a 10to 11-second trigger, set this field to 12 seconds or more (to keep the connection active) or less than 10 seconds (to disconnect).
Valid Entry: 0 (never) - 32767 (default=120)
Enter the amount of time in seconds a logical station's unsolicited connections remain active without unsolicited transactions occurring. In the DCM, each connected logical station requires periodic processing to maintain the connection while no actual unsolicited transactions are taking place with the PLC. Unsolicited operations to disconnected stations require additional overhead to reconnect before a transaction can take place. Therefore, set this time according to the needs of your application. For example, when reading from a station on a 10- to 11-second trigger (that is, if the PLC sends messages every 10 to 11 seconds), set the unsolicited idle disconnect timeout to 12 seconds or more (to keep the connection active) or less than 10 seconds (to disconnect).
Valid Entry: 0 (never) - 32767 (default=300)
(Optional) Enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the Siemens H1 Logical Station Control table:
Field
Logical Port Ethernet Adapter Number
Entry
Description
0 0
Communications path specified for this configuration. Number of the Ethernet adapter used in this configuration.
Field
Maximum Concurrent Tables Maximum Concurrent Requests Number Unsolicited Buffers Unsolicited Queue Size
Entry
Description
10 10 10
Number Ethernet Buffers Solicited Idle Disconnect Timeout (Seconds) Unsolicited Idle Disconnect Timeout (Seconds) Status Msg Tag
30
120
300
H1MP_LPORT0_ MSG
The DCM can operate 10 solicited tables at the same time. The DCM can operate 10 solicited requests at the same time. Ten buffers will be used for storage of data from unsolicited requests for all the logical stations. Ten tags will be on queue from unsolicited requests awaiting formatting in the FactoryLink real-time database. Thirty DCM allocated buffers are configured for use by all logical stations for Ethernet packets. The logical stations solicited connection remains active for 120 seconds without solicited transactions occurring. The logical stations unsolicited connections remain active for 300 seconds without unsolicited transactions occurring. The EDI task writes errors for this logical port 0 to this message tag.
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. Complete a row for each device to communicate through this logical port.
Error/Status Tag Name
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station). You can animate output-text objects to display the codes stored in an Error/Status Tag Name tag on a graphics screen.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. Later, you will enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry: previously defined logical station number
PLC Type
Type of Siemens device associated with this logical station. S5 (Default) Siemens S5 series PLC with either CP-535 or CP-143 S505 Siemens 505 family stations with the following Ethernet cards installed: CP-1433 CP-1434
Enter the 6-byte (12-nibble) Ethernet address of the Siemens H1 Ethernet defined on this line.
Enter the TSAP ID for the Fetch Passive TSAP on the Siemens Interface Card with which the Device Control Module communicates for solicited read operations on this logical station.
Valid Entry: any 8-character ASCII string
Enter the TSAP ID for the Fetch Active TSAP provided by the Device Control Module with which the DCM communicates for solicited read operations on this logical station.
Valid Entry: any 8-character ASCII string
(Optional) Enter the name of a tag that reports the connection status of the two TSAPs for solicited (block) reads. A value of 0 (OFF) indicates no connection. A value of 1 (ON) indicates connection.
Valid Entry: tag name Valid Data Type: digital
Enter the TSAP ID for the receive passive TSAP on the Siemens Interface Card with which the DCM communicates for solicited write operations on this logical station.
Valid Entry: any 8-character ASCII string
Enter the TSAP ID for the send active TSAP provided by the Device Control Module with which the DCM communicates for solicited write operations on this logical station.
Valid Entry: any 8-character ASCII string
(Optional) Enter the name of a tag that reports the connection status of the two TSAPs for solicited (block and exception) writes. A value of 0 (OFF) indicates no connection. A value of 1 (ON) indicates connection.
Valid Entry: tag name Valid Data Type: digital
Enter the TSAP ID for the Send Active TSAP on the Siemens Interface Card with which the DCM communicates for unsolicited read operations on this logical station.
Valid Entry: any 8-character ASCII string
Enter the TSAP ID for the Receive Passive TSAP provided by the DCM with which the DCM communicates for unsolicited read operations on this logical station.
Valid Entry: any 8-character ASCII string
(Optional) Enter the name of a tag that reports the connection status of the two TSAPs for unsolicited reads. A value of 0 (OFF) indicates no connection. A value of 1 (ON) indicates connection.
Valid Entry: tag name Valid Data Type: digital
Comment
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the Siemens H1 Logical Station Information table:
Field
Error Status Tag Name Logical Station
Entry
Description
H1MP_STATION0_ STATUS 0
(Optional) Errors for this logical station are written to this analog tag. Communications path for the communication.
Field
Remote Adapter Address (hexadecimal) Solicited Rd Remote FCHP TSAP ID Solicited Rd Local FCHA TSAP ID Solicited Rd Station Status Tag Name
Entry
Description
0800006010001 85 81 H1MP_LS0_R
Remote Ethernet address (in hexadecimal). Fetch Passive TSAP SSNR 8, ANR 5. Fetch Active TSAP SSNR 8, ANR 1. (Optional) Digital tag containing the status of the TSAP for solicited read operations for logical station 1. Has a value of 0 (OFF) when disconnected and 1 (ON) when connected. Receive Passive TSAP SSNR 8, ANR 4. Send Active TSAP SSNR 8, ANR 2. (Optional) Digital tag containing the status of the TSAP for solicited write operations for logical station 1. Has a value of 0 (OFF) when disconnected and 1 (ON) when connected. Send Active TSAP SSNR 8, ANR 7. Receive Passive SSNR 8, ANR 10. (Optional) Digital tag containing the status of the TSAP for unsolicited read operations for logical station 1. Has a value of 0 (OFF) when disconnected and 1 (ON) when connected. (Optional) Information about this logical station.
Solicited Wr Remote RECV TSAP ID Solicited Wr Local SEND TSAP ID Solicited Wr Station Status Tag Name
84 82 H1MP_LS0_W
Unsolicited Rd Remote SEND TSAP ID Unsolicited Rd Local SEND TSAP ID Unsolicited Rd Station Status Tag Name
87 8 10 H1MP_LS0_U
Comment
C ONFIGURING
THE
Open the Read/Write Control table. Complete a row for each read or write table.
Tip
See Application Design Tips and Techniques on page 127 for information about triggering schemes using tags defined in this table.
Table Name
Assign a name to this read or write request. Define one request (table) per line and do not include spaces in the name. You can define as many tables as available memory allows. Try to make the table name reflective of the operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Unsolicited Read
For EDI to interpret this operation as a triggered block read or as a write operation, accept the default of NO. If this is an unsolicited read operation, enter YES or FORCE. EDI will interpret this operation as an unsolicited read and emulate the devices addressing structure based on entries you make in the Read/Write Information table. The incoming data will be stored in the real-time database as specified in this field. If you enter YES, the incoming data will be stored in the tag represented by the tag name specified in the Read/Write Information table. If the current value of the tag is equal to the new value, the change-status indicator is unaffected. If a different value is being stored the tag, however, it will overwrite the current value and the tags change-status indicator will be set to 1 (ON). If you enter FORCE, the data is stored in the specified tag and the change-status indicator is automatically set to 1, regardless of whether the current value matches the new value.
Valid Entry: no, yes, force (default=no)
Exception Write
For EDI to interpret this operation as a triggered block write or as a read operation, accept the default of NO. For EDI to interpret this operation as an exception write and write tag values to the device only when those values change, enter YES. In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Valid Entry: no, yes (default=no)
Tip
Do not specify tags expected to change at frequent and unpredictable intervals in an exception write table. Any tag specified will be written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communications or result in an error message.
Block Read Priority
If this is a block read operation, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is an unsolicited read or a write operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block read.
Valid Entry: 1 - 4 (default=1)
Note
The Block Read Trigger, Block Read Disable, Block Read Complete, and Block Read State tags apply only to triggered read operations. Do not define these tags
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is required. Enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When this tags value is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
Tip
The Block Read Disable tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for details.
Block Read Disable
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1. To reenable a block read table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
If this is a block or exception write operation, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a read operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block or exception write.
Valid Entry: 1 - 4 (default=1)
Note
The Block Write Trigger, Block Write Disable, Block Write Complete, and Block Write State tags apply only to write operations. Do not define these tags for read operations.
Block Write Trigger
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is required. Enter a tag name for a digital tag to initiate a block write of the tag values specified in the Read/Write Information table to the addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values.
Valid Entry: tag name Valid Data Type: digital
Tip
The Block Write Disable tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Block Write Disable
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable a block write to the addresses specified in this table. When this tags value is forced to 1 (ON), the write operation is not executed, even when the block write trigger is set to 1. To reenable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write table, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this tables Read/Write Information table is written to the device, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup.
While the table is being processed, the tag is set to 0 (OFF). After the data defined in this tables Read/Write Information table is written to the device, the state tag is forced back to 1. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click the Save icon to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the Siemens H1 Read/Write Control table:
Column
Table Name Unsolicited Read Exception Write Block Read Priority
Entry
Description
READ NO NO 1
The name of this table is READ. This is not an unsolicited read table. This is not an exception write table. The block read priority, which is set automatically if you do not enter a value, is set to the default of 1, the highest priority. When the value of H1MP_READ_TRIGGER is 1, FactoryLink reads the configured address and writes its value to the tag configured for this table (in the Read/Write Information table). When the value of H1MP_READ_DISABLE is 1, FactoryLink disregards the trigger tag, H1MP_READ_TRIGGER, and does not process the READ table.
H1MP_READ_TRIGGER
H1MP_READ_DISABLE
Column
Block Read Complete
Entry
Description
H1MP_READ_COMPLETE Once the data is read and stored in the tag defined (in the Read/Write Information table) to receive it, FactoryLink forces a value of 1 to H1MP_READ_COMPLETE. H1MP_READ_STATE Once the data is read and stored in the tag defined to receive it, FactoryLink forces a value of 1 to H1MP_READ_STATE. During the read operation, H1MP_READ_STATE is set to 0. The write priority for this table is set to 1 by default. Since this is a read table, the tags specific to write requests are not defined.
Block Write Priority Block Write Trigger Block Write Complete Block Write Disable Block Write State
C ONFIGURING
THE
From the Read/Write Control table, select the row for the table you are configuring and open the Read/Write Information table. For a Read Table add a table entry for each FactoryLink tag in which data read from the device will be stored when the operation executes. For a Write Table add a table entry for each tag to be written when the operation executes.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, longana, float, message
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Data Region
Enter the PLC region to be read or written. For valid data regions, see the Data Region tables listed under the Region Index field. For special DCM commands for a specific logical station, enter LSCMD. Data regions that accept LSCMD and logical station variables are marked with an asterisk (*) in the data regions tables listed under the Region Index field. For further information, see Logical Station Commands on page 429.
Region Index
For DB, DX, or DE regions, enter the region index number. For S505 stations, enter the first index number. For valid entries, see the S5 and S505 Data Regions tables below.
For regions that specify a logical station variable which you can modify at run time using a logical station command, enter a nonzero negative number from -1 to -8. See Logical Station Commands on page 429 for more information. The S5 and S05 Data Regions tables (below) describe the data regions supported by the Siemens H1 protocol module.
S5 Data Regions:
Key
Description
Default Type
Read Only
CB DB DE DX EB FB IB OB QB PB TB RS
Counters Data Block External Data Block Expanded Data Block Expanded Peripheral Flags Input Image Output Image Output Image Peripheral Timers System Data Area
2 2 2 2 1 1 1 1 1 1 2 2
255 2047 2047 2047 255 255 127 127 127 255 255 511
BIN BIN BIN BIN BYTE BYTE BYTE BYTE BYTE BYTE BIN BIN
No No No No No No No No No No No No
Note: Max Region Index values with an asterisk (*) indicate data regions that accept logical station variables.
Key
Description
Default Type
Read Only
Analog Alarm Ack Flags 2 0 65535* INT2 No Alarm Deadband 4 0 65535* FLT No High Word Alarm C-Flag 2 0 65535* INT2 No Low Word Alarm C-Flag 2 0 65535* INT2 No Error 4 0 65535* FLT Yes High Alarm Limit 4 0 65535* FLT No High-High Alarm Limit 4 0 65535* FLT No Low Alarm Limit 4 0 65535* FLT No Low-Low Alarm Limit 4 0 65535* FLT No Orange Deviation Alarm 4 0 65535* FLT No Limit APV Process Variable 4 0 65535* FLT No APVH PV High Limit 4 0 65535* FLT No APVL PV Low Limit 4 0 65535* FLT No ARCA Rate of Change Alarm Limit 4 0 65535* FLT No ASP Setpoint 4 0 65535* FLT No ASPH Setpoint High Limit 4 0 65535* FLT No ASPL Setpoint Low Limit 4 0 65535* FLT No ATS Sample Rate in Seconds 4 0 65535* FLT No AVF V-Flags 2 0 65535* BIN Yes AYDA Yellow Deviation Alarm 4 0 65535* FLT No Limit C Control Register Boo1 0 16383 BIN No DCC Drum Current Count 4 255* 255 BIN Yes DCP Drum Count Preset 2 255* 255 INT2 No Note: Max Region Index values and Max Tag Numbers with an asterisk (*) indicate data regions that accept logical station variables.
AACK AADB ACFH ACFL AERR AHA AHHA ALA ALLA AODA
Key
Description
Default Type
Read Only
Drum Step Current 2 255* 255 INT2 No Drum Step Preset 2 255* 255 INT2 No G (Local App global 2 0 65535 INT2 No Variables) GA G (App A global Variables) 2 0 65535 INT2 No GB B (App B global Variables) 2 0 65535 INT2 No GC G (App C global Variables) 2 0 65535 INT2 No GD G (App D global Variables) 2 0 65535 INT2 No GE G (App E global Variables) 2 0 65535 INT2 No GF G (App F global Variables) 2 0 65535 INT2 No GG G (App G global Variables) 2 0 65535 INT2 No GH G (App H global Variables) 2 0 65535 INT2 No GI G (App I global Variables) 2 0 65535 INT2 No GJ G (App J global Variables) 2 0 65535 INT2 No GK G (App K global Variables) 2 0 65535 INT2 No GL G (App L global Variables) 2 0 65535 INT2 No GM G (App M global Variables) 2 0 65535 INT2 No GN G (App N global Variables) 2 0 65535 INT2 No GO G (App O global Variables) 2 0 65535 INT2 No GP G (App P global Variables) 2 0 65535 INT2 No GQ G (App Q global Variables) 2 0 65535 INT2 No GR G (App R global Variables) 2 0 65535 INT2 No GS G (App S global Variables) 2 0 65535 INT2 No GT G (App T global Variables) 2 0 65535 INT2 No GU G (App U global Variables) 2 0 65535 INT2 No GV G (App V global Variables) 2 0 65535 INT2 No Note: Max Region Index values and Max Tag Numbers with an asterisk (*) indicate data regions that accept logical station variables.
DSC DSP G
Key
Description
Default Type
Read Only
G (App W global Variables) 2 0 65535 INT2 No G (App X global Variables) 2 0 65535 INT2 No G (App Y global Variables) 2 0 65535 INT2 No G (App Z global Variables) 2 0 65535 INT2 No Constant 2 0 16777215 INT2 No 2 0 65535* INT2 No Loop Alarm Acknowledge Flags LADB Alarm Deadband 4 0 65535* FLT No LCFH High Word Loop C-Flags 2 0 65535* INT2 No LCFL Low Word Loop C-Flags 2 0 65535* INT2 No LERR Error 4 0 65535* FLT Yes LHA High Alarm Limit 4 0 65535* FLT No LHHA High-High Alarm Limit 4 0 65535* FLT No LKC Gain 4 0 65535* FLT No LKD Derivative Gain Limiting 4 0 65535* FLT No Coefficient LLA Low Alarm Limit 4 0 65535* FLT No LLLA Low-Low Alarm Limit 4 0 65535* FLT No LMN Output (percent) 4 0 65535* FLT No LMX Bias 4 0 65535* FLT No LODA Orange Deviation Alarm 4 0 65535* FLT No Limit LPV Process Variable 4 0 65535* FLT No LPVH PV High Limit 4 0 65535* FLT No LPVL PV Low Limit 4 0 65535* FLT No LRCA Rate of Change Alarm Limit 4 0 65535* FLT No Note: Max Region Index values and Max Tag Numbers with an asterisk (*) indicate data regions that accept logical station variables.
GW GX GY GZ K LACK
Key
Description
Default Type
Read Only
RAMP/SOAK Status Flags 2 0 65535* BIN Yes RAMP/SOAK Step Number 2 0 65535* INT2 No Setpoint 4 0 65535* FLT No Setpoint High Limit 4 0 65535* FLT No Setpoint Low Limit 4 0 65535* FLT No Rate Time (minutes) 4 0 65535* FLT No Reset Time (minutes) 4 0 65535* FLT No Sample Rate (seconds) 4 0 65535* FLT No V-Flags 2 0 65535* BIN No Yellow Deviation Alarm 4 0 65535* FLT No Limit STW System Status Words 2 0 65535 BIN No TCC Timer/Counter Current 2 0 65535 BCD4 No TCP Timer/Counter Preset 2 0 65535 BCD4 No V Variable Memory 2 0 16777215 INT2 No WX Word Input 2 0 65535 INT2 No WY Word Output 2 0 65535 INT2 No X Discrete Input Boo1 0 16383 BIN No Y Discrete Output Boo1 0 16383 BIN No Note: Max Region Index values and Max Tag Numbers with an asterisk (*) indicate data regions that accept logical station variables.
Tag
LRSF LRSN LSP LSPH LSPL LTD LTI LTS LVF LYDA
Enter the tag in the data region to be read or written: a bit-number in bit-regions, a byte-number in byte-regions, a word-number in word-regions, or a floating-point-number in floating-point-regions.
Valid Entry: For valid data regions, see the data region tables in the description for the previous field, Region Index.
Bit or Length
(Use with digital or message tags only) Enter the bit or length in the PLC the Siemens H1 protocol module reads. For digital tags the bit to be read or written. For message tags the message length to be read or written. The bit or length denotes the number of PLC tags to place in the message. 0 - 15 (S5) Word regions: data block, counters, timers 1 - 16 (S505) Word regions: data block, counters, timers 1 - 32 (S505) Double word (4 byte) tag regions 0 - 7 (S5) Byte regions: flags, input, output, peripheral 1 - 8 (S505) Byte regions 1 - 127 Word regions: message length in words 1 - 255 Byte regions: message length in bytes 1 - 63 (S505) Double word region message length
Specify the type of data being read from or written to the device for each tag defined in the Tag Name field. For more information about valid combinations of FactoryLink data types, PLC regions, and PLC data types, see Siemens H1 Data Types on page 441. BIN Default conversion based on the type of FactoryLink tag. BYTE (Use with PLC byte-regions only) 1-byte unsigned integer. INT2 2-byte signed integer. INT4 4-byte signed integer. BCD3 2-byte, 3-digit signed Binary Coded Decimal in the high-order nibble. BCD7 4-byte, 7-digit signed Binary Coded Decimal in the high-order nibble. FLT 4-byte Siemens Floating Point Representation. DIG The bit specified to be read or written to or from a FactoryLink tag.
HILO A character-string high-order byte followed by a low-order byte. LOHI A character string low-order byte followed by a high-order byte. DEF The default PLC data type for the data region. For definitions of the default types by data region, see Siemens H1 Data Types on page 441. BCD4 Two bytes containing four Binary Coded Decimal (BCD) digits. UINT2 2-byte unsigned integer. UINT4 4-byte unsigned integer. TRNS2 Transparent 2-byte entity. Two-bytes to or from the communication packet will be transferred to or from the highest 2-bytes (in memory) of the FactoryLink tag. Any additional space in the tag will be zeroed on reads and ignored on writes. TRNS4 Transparent 4-byte entity. Four-bytes to or from the communication packet will be transferred to or from the highest 4-bytes (in memory) of the FactoryLink tag. Any additional space in the tag will be zeroed on reads and ignored on writes. When the table is complete, click the Save icon to validate the information. Define the data type (digital, analog, long analog, or floating-point) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the Siemens H1 Read/Write Information table:
Field
Table Name Tag Name
Entry
Description
READ
H1MPDIG1 When the READ table is triggered by H1MP_READ_TRIGGER (defined in the Read/Write Control table), FactoryLink processes the table. The value read from the device is stored in H1MPDIG1. 0 The value stored in this tag is read from the General Electric device configured as logical station 0. PLC region that is being read.
Logical Station
PLC Region Region Index Tag Bit or Length PLC Data Type
FB
100 3 DIG The data being read from the device is digital.
Entry
Logical Station PLC Region Data Block Word or Byte Bit or Length PLC Data Type
Digital tag containing the desired station state, either: Activate (set, 1, true) Deactivate (reset, 0, false) 0 - 999 (station to activate or deactivate) LSCMD 1 Not applicable Not applicable Not applicable
Active/inactive Status
At runtime, the status of each logical station is either active or inactive. The following conditions define the status of each logical station: Active logical stations (set at program initiation) respond to solicited or remote station requests. Inactive logical stations abort solicited operations and reject any attempts by a remote station to connect. During the transition between active and inactive, the logical station aborts any new or pending solicited request, disconnects all TSAPs for that logical station, and handles the transition from inactive to active in the same way as it handles recovery from a disconnected station. Set Remote Parameters Command To allow a single logical station access to multiple remote stations, configure information in the Siemens H1 Logical Station Information table using the Set Remote Parameters command. While processing a Set Remote Parameters command, the Siemens H1 protocol module deactivates the logical station. Once the command is complete, the Siemens H1 protocol module reactivates the logical station.
Note
Use the Set Remote Parameters command only when changing the parameters of remote physical stations of the same device type. If you change remote physical stations of different device types (such as redefining an S5 logical station as an S505 physical station or an S505 logical station as an S5 physical station), undesirable results may occur in your server application. The EDI task does support nor check for dissimilar device-type changes.
To set the logical station remote parameters, enter the following information in the Siemens H1 Read/Write Information table:
Field Name
Tag Name Logical Station PLC Region Region Index Tag Bit or Length PLC Data Type
Entry
Message tag 0 - 999 (logical station to reconfigure set parameters) LSCMD 2 Not applicable Not applicable Not applicable
If a block write table with the Set Remote Parameters command contains any other commands, a row error may occur. For information about row errors, see Set Logical Station Commands and Row Errors on page 439.
Format
The message tag you configured as a Set Remote Parameters command in the Siemens H1 Read/Write Information table contains an ASCII representation of the Siemens Logical Station Information table. This message tag is used to reconfigure the logical station at run time. Each field in the Logical Station Information table is represented in the message tag by an ASCII string. Each ASCII string in the message tag is separated by a semicolon. When reconfiguring the Logical Station Information table using the Set Remote Parameters command, you only specify the fields you want to change. If one of the Logical Station Information fields is unchanged, a semicolon place holder must be used in the Set Remote Parameters command message tag. When reconfiguring the Logical Station Information table using this message tag, see Siemens H1 Communications on page 401.
Always construct the message tag to be the following ASCII representation of the Siemens H1 Logical Station Information table fields.
Field Name
Remote Adapter Address Solicited Rd Remote FCHP TSAP ID Solicited Rd Local FCHA TSAP ID Solicited Wr Remote RECV TSAP ID Solicited Wr Local SEND TSAP ID Unsolicited Rd Remote SEND TSAP ID Unsolicited Rd Local RECV TSAP ID
Description
Enter 12-hexadecimal digits Any 8-character ASCII string Any 8-character ASCII string Any 8-character ASCII string Any 8-character ASCII string Any 8-character ASCII string Any 8-character ASCII string
where
080006010005; RMT_FCHP; LCL_FCH; RMT_RECV; LCL_SEND; RMT_SEND; LCL_REC ;
Is the hexadecimal remote adapter address of the Siemens H1 Ethernet Is the Solicited Rd Remote FCHP TSAP ID Is the Solicited Rd Local FCHA ID TSAP ID Is the Solicited Wr Remote RECV TSAP ID Is the Solicited Wr Local SEND TSAP ID Is the Unsolicited Rd Remote SEND TSAP ID Is the Unsolicited Rd Local RECV TSAP ID (Semicolon) Terminates the message string
The Set Remote Parameters command is configured as a message tag. Change this tag at runtime to represent the new field values for the Siemens Logical Station Information table. The value of each field is separated by a semicolon. When reconfiguring the Siemens Logical Station Information table using the Set Remote Parameters command, you only need to specify the fields that change. If one of the Siemens Logical Station Information table fields remains unchanged, a semicolon place holder must be used in the Set Remote Parameters command message tag. You must always construct the message tag to be an ASCII representation of the Siemens Logical Station Information table. For example, the following message tag changes the Ethernet address of a logical station but keeps the current TSAP ID (does not change the TSAP IDs):
80006010005;;;;;;;
where
080006010005
;;;;;; ;
Is the hexadecimal remote adapter address of the Siemens H1 Ethernet (Six semicolons) Are placeholders for the unchanged fields in the Siemens Logical Station Information table (Semicolon) Terminates the message string
The Siemens H1MP allows you to use logical station commands to change the physical station address within the logical station at runtime using the Set Remote Parameters command. In this example, read/write table 2 is configured to read ten 2-byte integers from an external PLC. The logical station number is configured as 1. In Siemens read/write table 1, the message tag set_param_msg is configured to be logical station command, Set Remote Parameters. This means you can construct set_param_msg to alter the physical station address inside logical station 1. Then, before table 1 is triggered, you can trigger table 1 which will override the Siemens Logical Station Information table fields, allowing you access to different PLCs at runtime without configuring separate Read/Write and Logical Station tables.
CML
To take advantage of the H1MP protocol modules Set Remote Parameters command, you must configure at least two read/write tables. In this example, table 1 declares the tag set_param_msg as a Set Remote Parameters command (LSCMD 2) .
Table 2 defines a read/write table to access ten 2-byte integers in logical station 1. The set_param_msg tag in table 1 is configured to change the physical station configured as logical station 1 at run time. Therefore, you do not need to configure any more read/write tables to read ten 2-byte integers. Table 2 alone can be used to read ten 2-byte integers from any external device by setting set_param_msg and triggering table 1 before you trigger table 2.
Set Logical Station Variables Command The Set Logical Station Variables command provides flexible indexing that allows you to access multiple data areas at run time without having to configure a separate Read/Write table for each one.
Configuring the Set Logical Station Variables Command
To configure a message tag as a Set Logical Station Variables command, enter the following information in the Siemens H1 Read/Write Information table:
Field Name
Tag Name Logical Station PLC Region Region Index Tag, Bit or Length, PLC Data Type
Entry
Rather than hard-coding the index values into a line of the Siemens H1 Read/Write Information table, the Set Logical Station Variables command allows each logical station to have eight variable index values called logical station variables. These variables have the following characteristics: For both the S5 and S505 logical stations, they are unsigned-bytes with values ranging from 0 - 255. For S5 logical stations with zero-based addressing (addresses begin with zero) on the communications line, the variable index values equal the value specified. (For example, for a specified value of 3, the variable value is 3.) For S505 stations with zero-based addressing on the communications line and one-based addressing (addresses begin with one) in the address description, the variable index values equal the specified value decremented by one. (For example, for a specified value of 3, the variable value is 2.) At DCM startup, the S5 variable index values default to 0. The S505 variable index values default to 1.
Format
The Set Logical Station Variables command is configured as a message tag. You change this tag at run time to represent the new values for the logical station variables. The value of each variable is separated by a semicolon. When reconfiguring the logical station variables using the Set Logical Station Variables command, you only need to specify the variables that change. If one of the logical station variables is unchanged, a semicolon place holder must be used in the Set Logical Station Variables command message tag. You must always construct the message tag to be an ASCII representation of the logical station variables. For example, to set the logical station variables for an S5 logical station at startup to:
1 2 3 4 5 6 7 8
5 0 0 0 0 12 0 15
Create the following message tag string:
Set_Station_Msg =5;;;;;12;;15;
You can use these variables for the tag number in S505 Loop and Alarm variables, or as the first index in double index regions in either S5 or S505 logical stations.
Note
The Siemens H1MP allows you to use logical station variables to control the Region Index in the Read/Write Information table at run time. This provides the flexibility to change the data blocks you access within the PLC at run time using a Math and Logic procedure without having to configure a new read/write table. In this example, read/write table 2 is configured to read ten 2-byte integers from an external PLC. The Region Index value is configured to be logical station variable number 3. This means when table 2 is triggered, it will look in the third logical station variable for the Region Index value. A message tag, set_sta_msg, is configured as a Set Logical Station Variable command 3 in read/write table 1. In this example, set_sta_msg is used in the Math and Logic procedure to change the value of the logical station variables. Before read/write table is 2 is triggered to read the ten 2-byte integers, table 1 is triggered to set the logical station variable 3. This allows you to access a different data region in the PLC with each triggered read because you have the power to change the value of logical station variable 3 where the read/write table Region Index field is pointing to get its value.
PLC
CML
To take advantage of the H1MP protocol modules Logical Station Variables command, you must configure at least two read/write tables. In this example, table 1 declares the tag set_sta_msg as a Set Logical Station Variables (LSCMD) 3.
You can use this tag at runtime to dynamically set Region Index 3 for table 2. Once you set the value of set_sta_msg in an IML procedure and trigger the table, the logical station variables take on the values as specified in the tag set_sta_msg. You then trigger table 2 and read the ten 2-byte integers. Notice in table 2 the Region Index starts with a negative number. This indicates that logical station variable 3 contains the actual Region Index table 2 will read.
A block write table which contains logical station commands can only contain logical station commands; otherwise row errors occur. Row errors may result from any of the following conditions: If a table has a Set Parameters command as its first entry (by logical port), for example, and a command other than a Set Parameters command is given. If a table does not contain a logical station command as its first entry (by logical port) and a logical station command is given. A row error is a line in the Siemens H1 Read/Write Information table containing an invalid entry. If a row error is detected during start up, an error message is displayed on the screen and the entry is ignored. For further information about logical station command error codes that can be generated and displayed at startup, see Run-Time Application Messages on page 446. In a single block write table, the Siemens H1 protocol module can define multiple logical station Set Parameters commands (instead of defining multiple logical stations in multiple block write tables). However, no provisions are made in the Siemens H1 to check for multiple commands to the same logical station. Therefore, if multiple commands are made to the same logical station, the last command processed defines the values for the logical station. Note: The last command entered may not be the last command processed. To avoid row errors, ensure you enter only Set Parameters commands in block write tables containing Set Parameters commands.
C ABLE D IAGRAMS
This section contains information about connecting the Siemens H1 Ethernet system using a thick net or thin net bus. Thick Net Bus The example below illustrates two PCs running FactoryLink, using a thick net bus. The first PC uses a transceiver cable through a transceiver to connect to the Ethernet bus. The second PC uses a thin net coax cable through a thick-to-thin transceiver to connect with the Ethernet bus. A transceiver cable through a transceiver to the Ethernet bus connects the Siemens S5 PLC with a CP535 or CP143 card.
PC with FactoryLink CP535/CP143 Siemens S5 PLC
Bus Cable
Thin Net Bus The example below illustrates a PC running FactoryLink using a cable connected to an Ethernet thin net coax cable. A second part of the diagram illustrates a Siemens S5 PLC with a CP535 or CP143 card connected using a transceiver cable through a transceiver to the Ethernet thin net coax cable.
Coax Cable (Thin Net)
Siemens S5 PLC
Digital Conversion
PLC Type
Conversion
BIN BCD3 BCD7 BYTE DIG FLT INT2 INT4 HILO LOHI
Same as DIG Invalid PLC type for digital Invalid PLC type for digital Invalid PLC type for digital Specified bit read or write to or from the FactoryLink tag Invalid PLC type for digital Invalid PLC type for digital Invalid PLC type for digital Invalid PLC type for digital Invalid PLC type for digital
Analog Conversion
PLC Type
Conversion
Same as INT2 2-byte 3-digit Binary Coded Decimal with sign maximum: 999; minimum: -999 4-byte 7-digit Binary Coded Decimal with sign maximum: 32767; minimum: -32768 Valid only in byte regions, unsigned byte maximum: 0; minimum: 255 Invalid PLC type for analog 4-byte signed Siemens floating-point maximum: 32767; minimum: -32768 2-byte signed integer maximum: 32767; minimum: -32768 4-byte signed integer maximum: 32767; minimum: -32768
PLC Type
Conversion
HILO LOHI
Invalid PLC type for analog Invalid PLC type for analog
PLC Type
Conversion
BIN BCD3 BCD7 BYTE DIG FLT INT2 INT4 HILO LOHI
Same as FLT 2-byte 3-digit Binary Coded Decimal with sign maximum: 999; minimum: -999 4-byte 7-digit Binary Coded Decimal with sign maximum: 9999999; minimum: -9999999 Valid only in byte regions, unsigned byte maximum: 0; minimum: 255 Invalid PLC type for float 4-byte Siemens floating-point 2-byte signed integer maximum: 32767; minimum: -32768 4-byte signed integer maximum: 2147483647; minimum: -2147483648 Invalid PLC type for float Invalid PLC type for float
PLC Type
Conversion
Same as INT4 2-byte 3-digit Binary Coded Decimal with sign maximum: 999; minimum: -999 4-byte 7-digit Binary Coded Decimal with sign maximum: 9999999; minimum: -9999999 Valid only in byte regions, unsigned byte maximum: 0; minimum: 255 4-byte signed Siemens floating-point maximum: 2147483647; minimum: -2147483648 2-byte signed integer maximum: 32767; minimum: -32768 4-byte signed integer maximum: 2147483647; minimum: -2147483648 Invalid PLC type for long analog Invalid PLC type for long analog
Message Conversion
PLC Type
Conversion
BIN BCD3 BCD7 BYTE DIG FLT INT2 INT4 HILO LOHI
Same as HILO Invalid PLC type for message Invalid PLC type for message Invalid PLC type for message Invalid PLC type for message Invalid PLC type for message Invalid PLC type for message Invalid PLC type for message Character string high-order byte followed by low-order byte Character string low-order byte followed by high-order byte
where:
Adapter# Accessible
Is the LAN adapter number of the LAN adapter described in the remainder of the line. Indicates whether the adapter is properly configured and accessible to the DCM task: If YES, then the adapter can be accessed and is valid for the Siemens H1. If NO, then the adapter cannot be accessed and is either not installed or improperly configured.
CP Address
Is a 12-character hexadecimal address you must program into the Siemens CP535/CP143 Ethernet Interface card. It is the remote adapter address for each job (ANR) that communicates with this adapter.
Cause:
Cause:
Communication error.
Action: Verify you have properly configured the External Device Definitions and Logical Station Information tables and the Ethernet installation and the Siemens CP535 programming parameters are correct.
0003h
Cause:
Communication error.
Action: Verify the Siemens CP535 and the PLC programming parameters are correct.
0004h
Cause:
XX05h
Cause:
Action: For a list of error codes that correspond to the XX values in this error message, consult the Siemens Communication Processor CP535 with COM 535 Programming Package (S5 DOS Version), Chapter 8, Order No. 6ES5998-6SA21, Release 04.
0006h
Cause:
0007h
Action: Verify the value being read is an FLT. Cause: Inactive station. A solicited (read or write) operation was requested to an inactive station. This may occur at start up of the protocol module.
Action: Allow sufficient time to establish communication before initiating a solicited operation. If the error persists, ensure the Siemens H1 Logical Station Information table and Siemens CP programming parameters match. Verify the station has not been disabled through a logical station activate/deactivate command.
AXXXh
Cause:
Invalid value was entered for the logical station commands (set parameters or activate/deactivate station).
Action: For a list of the logical station command error codes, see Run-Time Logical Station Command Error Codes on page 448. Correct the value in the field that is specified by the error code.
Run-Time Logical Station Command Error Codes For the Siemens H1 Ethernet, the only errors possible for the logical station commands come from invalid tag values for the set parameters and activate/deactivate station commands at run time. The logical station generates two commands: 0xAyXX 0xA101 For an invalid tag value, the logical station generates the error code 0xAyXX where
A y
Is an error from a logical station command Is the specific command y = 1 is the Activate/Deactivate Station command y = 2 is the Set Remote Parameters command y = 3 is the Set Logical Station Variables command
XX
When the protocol module detects an error, it puts the logical station in an unknown configuration state, and the logical station becomes inactive. To free the station from this unknown state, issue a set parameters command for that logical station or restart the logical port. For the Activate/Deactivate Station command, the logical station generates error code 0xA101. Theoretically, the Activate/Deactivate command cannot produce errors since it uses only digital tags whose values, set and reset, are both valid. However, for consistency in error reporting, the logical station generates this error code. The logical station generates error code 0xA2XX for the Set Parameters command.
The following list defines the codes for both the Activate/Deactivate and Set Parameters commands:
Code Description
0xA101 0xA2XX 0xA200 0xA201 0xA202 0xA203 0xA204 0xA205 0xA206 0xA207
Activate/Deactivate command Set Logical Station parameters Invalid number of fields Invalid field 1, adapter address Invalid field 2, rmt sol read TSA ID Invalid field 3, lcl sol read TSA ID Invalid field 4, rmt sol write TSA ID Invalid field 5, lcl sol write TSA ID Invalid field 6, rmt usl read TSA ID Invalid field 7, lcl usl read TSA ID
For further information about activate/deactivate station commands, set parameters commands, and row errors, see Siemens H1 Adapter Display Utility (H1MPDISP) on page 445.
Chapter 20
Before completing the protocol-specific Square D configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58 for details. In your server application, open Device Interfaces > Square D.
C ONFIGURING
THE
Open the Logical Station Control table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Note
In this table, source refers to the FactoryLink station and destination refers to the Square D device.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a device.
Valid Entry: previously defined logical port number
Enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
Number of Retries
Define the maximum number of consecutive times a read or write command will be sent to a logical station after an unsuccessful first transmission attempt.
Valid Entry: 0 - 99 (default=3)
A text string that identifies the source route address defined in the SR1 column is displayed.
Valid Entry: leave blank (display only)
Enter the source route address or drop number of a network interface module not being used on the Sylink network. For serial communications, enter the source route address. If you do not need additional routing, accept the system default of 255. For Ethernet communications, enter the source drop number (see the description for Source Drop Number).
Valid Entry: 0 - 255 (default=255)
For Ethernet communications, enter the source drop number on the Ethernet network. If you enter a number in this column, enter the same number in the previous column, SR1. For serial communications, accept the system default of 255.
Valid Entry: 0 - 255 (default=0)
Note
For the fields Baud Rate through Stop Bits, be sure to enter values that correspond to the device hardware configuration for all devices communicating through the specified logical port. To determine the proper settings, refer to the device manufacturers documentation.
Baud Rate
Enter the speed at which the protocol module communicates with the devices linked to FactoryLink via this logical port. This entry must match the baud rate configuration of the devices. Refer to the device manufacturers documentation for details.
Valid Entry: 110 - 115200 (default=9600)
Parity
Enter the parity error correction during transmission via this logical port.
Valid Entry: even
Data Bits
Enter the number of data bits used during transmission via this logical port.
Valid Entry: 8
Stop Bits
Enter the stop bit interval that provides the destination a pause before the start of the next character.
Valid Entry: 1
Comment
When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for a row defining an Ethernet logical port (the entry in the Function column in the External Device Definition table is ETHERNET):
Column
Logical Port
Entry
Description
The communication path to be used for read and write operations between FactoryLink and devices communicating via this port is represented as 0. Device SQRD_LPORT0_MSG The EDI task will write communications Message Tag error messages associated with this logical port to a message tag, SQRD_LPORT0_MSG. Number of 3 A read or write command to any device Retries communicating via this port will be retried three times before an error message is generated. SR1 126 The network source route address for the device is 126. Source Drop 126 The source drop number on the network is Number 126. Baud Rate 9600 This baud rate entry (the speed at which the FactoryLink station communicates with the device) of 9600 must match the baud rate configuration of the Square D devices communicating with FactoryLink via logical port 0. Parity EVEN The parity error correction for transmission via logical port 0 is even and must match the parity configuration of the devices using this port. Data Bits 8 The devices configured for communications via logical port 0 require 8 data bits. Stop Bits 1 The devices configured for communications via logical port 0 require a stop bit of 1.
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. Complete a row for each device to communicate through this logical port.
Error/Status Tag Name
A tag name for an analog tag in which to store communications error codes associated with this device (logical station).
Valid Entry: tag name Valid Data Type: analog
Logical Station
A number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. Later, you will enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry: 0 - 999
Timeout m sec
The maximum amount of time, in milliseconds, the protocol module will wait to receive a response to a read or write command before timing out. For the protocol module to time out, you must enter a value greater than 0.
Valid Entry: 0 - 9999 (default=100 or 0.1 second)
A text string that identifies the destination route address defined in the DRn column for this row is displayed.
Valid Entry: leave blank (display only)
Enter the destination route address or drop number of a network interface module connecting to a separate Sylink network. For serial communications, enter the destination route address. If you do not need additional routing, accept the system default of 255. For Ethernet communications, enter the destination drop number (see the description for Destination Drop Number).
Valid Entry: 0 - 255 (default=255)
If needed, define up to six additional destination route addresses. If not needed, accept each fields default of 255.
Valid Entry: 0 - 255 (default=255)
For Ethernet communications, enter the destination drop number on the Ethernet network. If you enter a number in this column, enter the same number in the DRn column for this row. For serial communications, accept the system default of 255.
Valid Entry: 0 - 255 (default=255)
Define the maximum number of bytes the device defined in this row can transmit in one message. Most Square D devices can transmit 256 bytes, or 128 registers of data. The protocol being used (point-to-point or IEEE 802.3) does not affect the maximum packet size.
Valid Entry: 0 - 256 (default=256)
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for a row defining a logical station communicating via the logical port specified on the Logical Station Control table.
Column
Logical Port
Entry
Description
The logical port number defined in the Logical Station Control table is displayed. Error/Status SQRD_STATION0_ Communications error codes generated for Tag Name STATUS this logical station will be stored in an analog tag, SQRD_STATION0_STATUS. Logical 0 A device communicating with FactoryLink Station via logical port 0 is assigned a logical number of 0. Timeout m 100 Each of the retries (3) specified in the sec Logical Station Control table will time out after 100 milliseconds if the device does not respond. DR1 54 Destination route address of the device is 54.
Column
DR2
Entry
Description
255
This configuration only requires one destination route address so the additional DRn fields default to 255.
DR3 DR4 DR5 DR6 DR7 Destination Drop Number Maximum Packet Size
Drop location of the device on the network path is 54. The device defined as logical station 0 can transmit up to 256 bytes in one message.
C ONFIGURING
THE
Open the Read/Write Control table. Complete a row for each read or write table.
Tip
See Application Design Tips and Techniques on page 127 for information about triggering schemes using tags defined in this table.
Table Name
Assign a name to this read or write request. Define one request (table) per line and do not include spaces in the name. You can define as many tables as available memory allows. Try to make the table name reflective of the operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Unsolicited Read
If this is a triggered block read or as a write operation, accept the default of NO. If this is an unsolicited read operation, enter YES. EDI will emulate the device's addressing structure based on entries you make in the Read/Write Information table. The incoming data will be stored in the tag represented by the tag name specified in the Read/Write Information table. If the current value of the tag is equal to the new value, the change-status indicator is unaffected. If a different value is being stored the tag, however, it will overwrite the current value and the tags change-status indicator will be set to 1 (ON).
Valid Entry: yes, no (default=no)
Exception Write
For EDI to interpret this operation as a triggered block write or as a read operation, accept the default of NO. For EDI to interpret this operation as an exception write and write tag values to the device only when those values change, enter YES.
In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Valid Entry: yes, no (default=no)
Tip
Do not specify tags expected to change at frequent and unpredictable intervals in an exception write table. Any tag specified will be written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communications or result in an error message.
Block Read Priority
If this is a block read operation, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queueing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is an unsolicited read or a write operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block read.
Valid Entry: 1 - 4 (default=1)
Note
The Block Read Trigger, Block Read Disable, Block Read Complete, and Block Read State tags apply only to triggered read operations. Do not define these tags for unsolicited read operations or for write operations.
Block Read Trigger
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is required. Enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When this tags value is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1. To reenable a block read table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
Tip
This tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Block Read Complete
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is an unsolicited read or a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup.
While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
If this is a block or exception write operation, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a read operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block or exception write.
Valid Entry: 1 - 4 (default=1)
Note
The Block Write Trigger, Block Write Disable, Block Write Complete, and Block Write State tags apply only to write operations. Do not define these tags for read operations.
Block Write Trigger
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is required. Enter a tag name for a digital tag to initiate a block write of the tag values specified in the Read/Write Information table to the addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values.
Valid Entry: tag name Valid Data Type: digital
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field.
If this is a block write table or an exception write table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable a block write to the addresses specified in this table. When this tags value is forced to 1 (ON), the write operation is not executed, even when the block write trigger is set to 1. To reenable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
Tip
This tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for further details.
Block Write Complete
If this is a read or exception write operation, ignore this field. If this is a block write table, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this tables Read/Write Information table is written to the device, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the data defined in this tables Read/Write Information table is written to the device, the state tag is forced back to 1.
Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click the Save icon to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for a row defining a triggered read table:
Column
Table Name Unsolicited Read Exception Write Block Read Priority
Entry
Description
READ NO NO 1
SQRD_READ_TRIGGER
SQRD_READ_DISABLE
The name of this table is READ. This is not an unsolicited read table. This is not an exception write table. The block read priority, which is set automatically if you do not enter a value, is set to the default of 1, the highest priority. When the value of SQRD_READ_TRIGGER is 1, FactoryLink reads the configured address and writes its value to the tag configured for this table (in the Read/Write Information table). When the value of SQRD_READ_DISABLE is 1, FactoryLink disregards the trigger tag, SQRD_READ_TRIGGER, and does not process the READ table.
Column
Block Read Complete
Entry
Description
SQRD_READ_COMPLETE Once the data is read and stored in the tag defined (in the Read/Write Information table) to receive it, FactoryLink forces a value of 1 to SQRD_READ_COMPLETE. Block Read State SQRD_READ_STATE Once the data is read and stored in the tag defined to receive it, FactoryLink forces a value of 1 to SQRD_READ_STATE. During the read operation, SQRD_READ_STATE is set to 0. Block Write Priority 1 The write priority for this table is set to 1 by default. Block Write Trigger Since this is a read table, the Block Write tags specific to write requests Complete are not defined.
Block Write Disable Block Write State
C ONFIGURING
THE
From the Read/Write Control table, select the row for the table you are configuring and open the Read/Write Information table. For a Read Table add a table entry for each FactoryLink tag in which data read from the device will be stored when the operation executes. For a Write Table add a table entry for each tag to be written when the operation executes.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, longana, float
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Data Type
For each tag defined in the Tag Name field, specify the type of data being read from or written to the device.
Valid Entry: register, status (default=register)
Address
For a read table, enter the address in the device's memory where the value to be stored in this tag is located. For a write table, enter the address in the device's memory to which the tag value will be written.
Valid Entry: 1 - 8192
Bit Offset
If the tag (entry in the Tag Name column) associated with this entry is digital, enter the bit offset within the word that contains the value to be read or to which the tag value is to be written. Bit 1 is the most significant bit (MSB) and bit 16 is the least significant bit. For all other FactoryLink data types, leave this field blank.
Valid Entry: 1 - 16 if data type is digital
Priority
If this is an unsolicited read operation (that is, you entered YES in the Unsolicited Read field on the Read/Write Control table), enter PRIORITY. Otherwise, accept the default of NORMAL.
Valid Entry: priority, normal (default=normal)
When the table is complete, click the Save icon to validate the information. Define the data type (digital, analog, long analog, or floating-point) for any tag names displayed in the Tag Definition dialog box. The following table provides sample Read/Write Information table entries for the triggered read table.
Field
Table Name Tag Name
Entry
Description
READ REG_DIG1
The table name defined in the Read/Write Control table is displayed. When the READ table is triggered by SQRD_READ_TRIGGER (defined in the Read/Write Control table), FactoryLink processes the table. The value read from the device is stored in REG_DIG1. The value stored in this tag is read from the Square D device configured as logical station 0. A register address is being read. The address of the register is 426. The bit offset containing the value being read is 12. This read operation will be processed according to the priority specified in the Read/Write Control table.
C ABLE D IAGRAM
The following figure illustrates how to connect the computer running FactoryLink to a Square D device. This connection occurs from the host through an RS-232 25-pin ribbon cable to a 25-pin converter, through the converters four-wire RW-422 cable to the Square Ds 9-pin port.
Host RS-232 25-pin RS-232 to RS-422 converter Square D 9-pin Pin 1 is TXPin 2 is TX+ Pin 3 is RXPin 4 is RX+ Pins 5 and 6 are jumped together. Pins 7 and 8 are jumped together.
FactoryLink
RDRD+ SDSD+
Cause:
Task was unsuccessful in closing the SAP address. This error may occur when stopping the task.
Cause:
Task was unsuccessful in sending the connect command. This command is part of initialization and terminates with this error.
Cause:
Action: Change the format of the message sent from the PLC.
SQRD8023: Protection bit failure
Cause:
Task has attempted to start, but the FactoryLink protection bit 51 could not be located.
SQRDRCOM and SQRDSCOM Messages If using SY/MAX point-to-point serial communications, the following messages can appear:
SQRDCPT: PPORT-%d port setup failed
Cause:
Task has unsuccessfully attempted to configure the physical port indicated by the %d. This error indicates that a physical problem has occurred.
Cause:
Task has attempted to start, but the FactoryLink protection bit 51 could not be located.
Cause:
Task has unsuccessfully attempted to configure the physical port indicated by the %d. This error indicates that a physical problem has occurred.
Action: Verify that the physical port is correctly defined. SQRDRCOM, SQRDSCOM and SQRDENET Messages Error messages in the following format can occur with the SY/MAX point-to-point serial communication or with the 802.3 Ethernet communication protocol module:
SQRDDSF: LSTA - yyy Error - xxx: sss
These errors are associated with return data to the FactoryLink EDI task and the logical port error message tag. They appear in the format described in EDI Run-Time Manager Line Format on page 148. The following information is also returned to the Device Message Tag tag defined in the Logical Station Control table:
SQRDDST: LSTA - yyy Error - xxx:sss
where:
yyy zzz sss
Is the logical station where the error occurred Is the error number Is the ASCII string describing the error message. See the following table. .
If xxx is:
Description
1 2 3 4 5 6 7 8
Receive error Timeout Invalid error code Invalid FactoryLink type for conversion SY/MAX error XXX Received too many NAKs Received unsupported Unsolicited Opcode-YYY Transmit error
An error occurred while the packet was being received. Did not receive a response from the request. Invalid error code. Invalid FactoryLink tag type. XXX-SY/MAX error (see Bulletin 30598-713-01). Resent the packet the retry number without receiving ACK. Received an unsupported Unsolicited Opcode-YYY. An error occurred during the transmission of the packet.
Chapter 21
Telemecanique
Read
When a read operation is requested, the PLC interface task sends a command to the device driver for it to read the objects specified by the user in a Read/Write Configuration table. There can be two types of read operations: Read block (triggered): Reads the values of all PLC objects specified in the Read/Write Configuration table and writes them to the real-time database. For a triggered read block, the user specifies a trigger tag in the real-time database that will be used to initiate read operations. When the trigger value is 1 (ON) and has changed state since it was last sampled, the PLC interface task reads the addresses specified in the read/write table. The block read operations ensure maximum performance levels for the PLC interface task. This type of operation means a minimum number of block read requests lets the user collect the data specified in the configuration table. The PLC interface task sends these requests as packets separated by type of data and groups of packets separated by logical station. The packet size depends on the protocol used by the peripheral. The read process continues until the last block read activated by the current trigger is performed. Unsolicited read (unsolicited data): The PLC interface task can await data sent by an external device for better operation with some external devices. In this case the exchange is initiated by the external device, independently of FactoryLink, so it can write data to the real-time database. These write commands are treated as read actions as the data is received by the FactoryLink real-time database in the same way as when objects are read from a PLC. In order to receive unsolicited data, the PLC interface task emulates the addressing structure of PLC objects to write to the real-time database. For this reason, the write command from the PLC must apply to a specified type of data object; otherwise, the task will not write its contents to the FactoryLink real-time database.
Write
When a write operation is requested, the PLC interface task sends a command for the driver program to write the data objects specified by the user in a Read/Write Configuration table to the appropriate peripheral. Two write operations are possible: Block writes (triggered): Writes the values of all of the tags in the database specified in a Read/Write Configuration table to a PLC. When a block write is performed, the user specifies a trigger tag taken from the FactoryLink real-time database. The trigger starts the write operations. When the trigger value is 1 (ON) and has changed state since it was last sampled, the PLC interface task sends a command to the driver program to write to the PLC the data objects specified by the user in the Read/Write Configuration table. The block write operations ensure maximum performance levels for the PLC interface task. This type of operation means a minimum number of block read requests lets the user collect the data specified in the configuration table. The PLC interface task sends these requests as packets separated by type of data and groups of packets separated by logical station. The packet size depends on the protocol used by the peripheral. The read process continues until the last block read activated by the current trigger is performed. Write on change of state (not triggered): Write on change of state is used only to write tags whose value has changed (or tags that have a change of state indicator set) since the last time the database was sampled by the task. Configuration Tables The user configures the FactoryLink PLC interface option by entering the required information in a number of configuration tables that let the system read and write data to/from an external device and initialize the communication parameters. Although various types of external devices may be used, the PLC interface task normally uses five types of configuration tables: External Device Definition table: This table lets the user specify up to 1000 logical port numbers. These numbers simplify the configuration of communication access paths by grouping communication co-processors, their physical interface ports, and the external devices in various combinations.
Logical Station Control and Information tables: These two tables let the user define communication parameters and establish the link between logical stations and physical stations. The user can configure up to 1000 logical station control and information tables (one for each logical port). Read/Write Control and Information tables: These two tables let the user specify the PLC data objects to be read and transferred to the FactoryLink real-time database and the PLC data objects to be written from the FactoryLink real-time database. The number of read/write control information and configuration tables the user can configure is limited by the amount of memory available. The number of read/write tables is limited to 200 tables per type (200 block read tables, 200 block write tables, 200 exception write tables). The number of entries in each read/write table cannot exceed 1309 tags.
Logical port number representing a specific access path used for communication.
Valid Entry: 0 to 999
Physical Port
Physical port number. This number is not significant for XWAY network interface cards or for COM ports.
Device Name
The identification of the driver program loaded for the selected logical port. The number of characters allowed is 1 to 4.
Valid Entry: alphanumeric string of 1-4 characters: TE__ for
Function
The type of communication performed by the application, via the logical port.
Valid Entry: CUSTOM for any Telemecanique XWAY protocol
Memory
Comment
Logical port 1: Comprising the ETHWAY card Logical port 2: Comprising the UNI-TELWAY COM port When the information is entered, click the Save icon to validate the entries.
The logical port number specified in the External Device Definition table corresponding to a specific communication channel.
Valid Entry: 0 to 999
Baud Rate
Use only 4800 or 19200 settings if the TSX SCM module is programmed for these values.
Parity
Use only EVEN or NONE if the TSX SCM module is programmed for these settings.
Data Bits
Use only 7 if the TSX SCM module is programmed for this setting.
Stop Bits
Use only 2 if the TSX SCM module is programmed for this setting.
TYPE
TEMAP1 for the MAPWAY 1 card TEMAP2 for the MAPWAY 2 card TEUTW1 for the UNI-TELWAY and COM port TEETH1 for the ETHWAY 1 card TEETH2 for the ETHWAY 2 card TEFIP1 for the FIPWAY 1 card TEFIP2 for the FIPWAY 2 card TEPCS for the PLC programming port (usually used to communicate with a PCX PLC board. TEISA1 and TEISA2 for ISAWAY1 and ISAWAY2 driver TEIP1 and TEIP2 for tcp/ip1 and tcp/ip2 driver).
First Slave Address
Number of the lowest slave address assigned to FactoryLink communication on a Uni-Telway bus. This slave address is reserved for unsolicited data. The slave addresses used for transmission/reception of other types of messages start with the address defined in this field + 1 and end with the address of the last slave, defined in the next field. Between 1 and 15 slave addresses can be assigned to FactoryLink. For best performance, Telemecanique recommends entering the default value. See Configuring Telemecanique Networks on page 493 for more information.
Valid Entry: 1 to 249 (default=1)
The number of the highest slave address assigned for FactoryLink communication on the UNI-TELWAY bus. Between 1 and 15 slave addresses can be assigned to FactoryLink. For best performance, Telemecanique recommends entering the default value. See Configuring Telemecanique Networks on page 493 for more information.
Valid Entry: 5 to 253 (default=15)
(Optional) Tag of the tag that contains the report on communication status on this logical port.
Valid Entry: tag name Valid Data Type: message
The MAPWAY/ETHWAY/FIPWAY/ISAWAY/XWAYIP interface cards do not use the Baud Rate, Parity, Data Bits, Stop Bits fields. These fields must remain blank or retain their default values. If this table was previously configured for a UNI-TELWAY protocol and if it is now to be configured for a MAPWAY/ETHWAY/FIPWAY/ISAWAY/XWAYIP protocol, it is not necessary to change the initial value set in these fields. When a non UNI-TELWAY protocol is used, First and Last Slave Address fields are used to determine the number of communication sockets. From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. The information entered in this table is assigned to the logical port whose number is displayed in the Logical Port field. If this number is incorrect, return to the Logical Station Control screen, and move the cursor to the logical port to be configured, then once again call-up the display of the Logical Station Information table.
Logical Port Error/Status Tag
Reminds the user of the number of the logical port to which the information displayed in this table is assigned. (Optional) The name of the tag assigned to the tag that contains the error code for logical station communication applications.
Valid Entry: tag name
0 - running 1 - The PLC target is not connected or a request is refused by the PLC configuration to verify its availability 3 - Timeout. The response from the logical station was not received within the configuration timeout period. Increase the timeout value in the Telemecanique Logical Station configuration table. 6 - PLC Object cannot be reached or is not configured. Check to ensure the PLC is configured with the correct range. 7 - Unsolicited message of a non-configured station is received, or a response cant be linked with any solicited requests. Check to ensure the PLC address is a configured logical station. 9 - Internal Error. A response isnt coherent, one request cant be sent, an error occurred during sending, sending buffers are full, or datagram error.
Logical Station
A number entered by the user in a read/write table specifying a logical port/physical station combination. A logical station number can only be used for a single PLC.
Valid Entry: 0 to 999 (default=0)
Comment field to associate the logical station number to the corresponding XTEL station name. The type of PLC (TSX/PMX V3/V4/V5) used for communication.
Valid Entry: 17-20, 67-40, 47-400, 67-420, TSXV3, 37-10,
47-20, 87-10, 47-410, 87-410, TSXV6, 37-21, 47-30, 87-20, 47-411, 87-420, TSXV5, 37-22, 67-20, 87-30, 47-420, 107-410, PMXV4, 67-30, 67-410, 107-420, PMXV5, 57-10, 57-20, 50-30, 50-xx, 37-xx, PCX57, NUM10x0
The next five fields define the five level XWAYaddress. Refer to the corresponding documentation for more information.
Network Number
Station Number
For MAPWAY/ETHWAY/FIPWAY/XWAYIP: 0 to 3F
Gate Number
For an unsolicited data, this number must be 10 + x, where x is the number of the text block which send the request.
Module Number
A hexadecimal value for the module number on the network. For a slave address, the two figures in hexadecimal notation correspond to the rack number and the position of the module in the rack.
Valid Entry: 0 to FF (default=0) depending on the address to
Location in the rack used by a TSX SCM module for a slave address. For example, 07 corresponds to slot 7 in rack 0.
Device Number
enter 0 for a master address H'64' plus the target slave number for a slave address
The time (in seconds) during which the driver waits for a response from the PLC. If this time is exceeded, the driver repeats the message sent or sends an error message.
Valid Entry: 0 to 30 (default=10)
TW7
An indicator that shows if data transits a Telway network betweenFactoryLink and a PLC.
YES The data transits via a Telway network NO (Default) The data does not transit via a Telway network
Drop
The number of a group of stations that are opened via the same network interface. The same drop number must be assigned to all PLCs that are connected to a common lower level network. Each PLC equipped with a MAPWAY/ETHWAY/FIPWAY/XWAYIP/ISAWAY communication module must be assigned a different number. A different drop number has to be assigned to each station configured as receiving unsolicited data. If the same drop number is used for both normal read/write operation and unsolicited data, the performances for read/write operation will be affected.
Valid Entry: 0 to 99 (default=0)
In this example, information is specified for logical port 0 defined in the Telemecanique Logical Station Control table. The error codes for logical station 2 (X-TEL symbolic name: LSTA2) are written to tag te_station2. Logical station 2 communicates with a TSX 17-20 PLC with network number 0, station number FE, gate number 5, module number 7 and device number 74. The driver waits up to 10 seconds for a response to a read or write request before declaring an error condition. The logical station is linked to station group 1 (drop 1) and data exchange does not transit via a Telway network. Telemecanique Read/Write Table These tables allow the user to specify the following information: Exception write, block write, block read, or any combination of these read/write operations Up to 200 tags used as block read triggers (with one read trigger per table) Up to 200 tags used as block write triggers (with one write trigger per table) Telemecanique objects to read and transfer to the FactoryLink real-time database Tags that receive the contents of the PLC objects It is possible to configure up to 200 read/write tables with up to 1309 tags defined in each table.
Note
Different triggers must be used for each table, as well as for reads and writes in the same table.
If message type tags are used for block read or write operations, it is recommended no more than 16 message type tags be entered in the same table.
(Optional) Indicates reading unsolicited data from the logical stations specified in this table must be interpreted by the PLC Interface task. When an unsolicited data read is performed, the PLC Interface task emulates the addressing structure of the PLC objects to write to the real-time database. An unsolicited data table must only contain Message type tags and only read Text type PLC objects. See FactoryLink and TSX/PMX PLC Data Objects on page 500. FactoryLink listens for unsolicited data on the First Slave Address. In addition, the user must define a logical station whose address corresponds to the target address of the text block used by the PLC for this transmission.
Y A normal write to the real-time database F A forced write to the real-time database N Unsolicited data is not interpreted
Exception Write
This indicator shows whether writing is required each time the value of one of the tags specified in the Read/Write Information table changes.
Y A change of state of any tag generates a write request of its value, regardless of the specified triggers or of other values.
N No exception writes. Write operations are only generated when the value of the write trigger and its change of state bit are forced to 1. All of the values are written, regardless of the status of their change of state bit.
It is possible to configure both exception write and block write actions in the same table.
Block Read Priority Block Read Trigger
(Optional) Not used. A FactoryLink real-time database digital tag that, when forced to 1 (ON), triggers a block read of the values specified in the Telemecanique Read/Write Information table. The Read Trigger is normally defined in another FactoryLink task such as the Event and Interval Timer, Math and Logic, or Client Builder.
Valid Entry: tag name Valid Data Type: digital
A digital tag that, when set to 1 (ON), disables the block read action on this table.
Valid Entry: tag name Valid Data Type: digital
A digital tag of the database forced to 1 (ON) by the PLC Interface task once the block read of this table is complete. If this tag is defined when the PLC Interface task is initialized, the value of this tag is forced to 1 (ON). The Read Completed tags are valid only if a different table is used for each logical port.
Valid Entry: tag name Valid Data Type: digital
A digital tag of the database with a value set to 0 (OFF) when a block read operation on the tags specified in the table are in progress. Once the block read operations on this table are complete, the value of this tag is set to 1 (ON). If this tag is defined when the PLC Interface task is initialized, the value of this tag is forced to 1 (ON). The Read State tags are valid only if a different table is used for each logical port.
(Optional) Not used A FactoryLink real-time database digital tag that, when forced to 1 (ON), triggers a block write of the values specified in the Telemecanique Read/Write Information table. The block write trigger is normally defined in another FactoryLink task such as the Event and Interval Timer, Math and Logic, or Client Builder.
Valid Entry: tag name Valid Data Type: digital
A digital tag that, when set to 1 (ON), disables the block write action on the tags specified in this table.
Valid Entry: tag name Valid Data Type: digital
A digital tag of the database forced to 1 (ON) by the PLC Interface task once the block write of this table is complete. If this tag is defined when the PLC Interface task is initialized, the value of this tag is forced to 1 (ON). The Block Write Complete tags are valid only if a different table is used for each logical port.
Valid Entry: tag name Valid Data Type: digital
Write State
A digital tag of the database with a value set to 0 (OFF) when a block write operation on the tags specified in the table are in progress. Once the block write operations on this table are complete, the value of this tag is set to 1 (ON). If this tag is defined when the PLC Interface task is initialized, the value of this tag is forced to 1 (ON). The Block Write State tags are valid only if a different table is used for each logical port.
Valid Entry: tag name Valid Data Type: digital
In this example, table te_rwtable1 is defined. Reading unsolicited data is not interpreted. A change of state by any tag causes the value of this tag to be written, regardless of the status of the triggers or of the other values (Exception Write = Y is set). The block read and write priority levels are set to the highest value, 1. When the value of tag te_read equals 1 (ON), a block read of the values specified in the Read/Write Information table is performed. When the value of tag te_rdisable equals 1 (ON), block reading of table te_rwtable1 is disabled. Once all of the block read operations for this table are complete, the PLC Interface task forces the value of the te_rcomp tag to 1. The value of the te_rstate tag changes to 0 while table te_rwtable1 is being read. When the value of tag te_write equals 1 (ON), a block write of the values specified in the corresponding Read/Write Information table is enabled. When the value of tag te_wdisable equals 1, block writing of the values specified in table te_rwtable1 is disabled. Once all block write operations for this table are complete, the PLC Interface task force the te_wcomp tag to 1. The value of the te_wstate tag is 0 when the table te_rwtable1 is being written. Once all of the information is entered, open the Read/Write Information table.
The values entered in this table identify Telemecanique PLC objects that are: Read and transferred to the real-time database when the block read trigger requests a block read of the table specified in the Table Name field Written from the real-time database when the block write trigger requests a block write of the table specified in the Table Name field. The data entered in this table is assigned to the table whose name is specified in the Table Name field. If this name is incorrect, the user must return to the Read/Write Control screen, and place the cursor on the name of the table to be filled in, then display the Read/Write Information screen once again. Specify the following data for each PLC object to read or write:
Station Name Logical Station
Comment field to associate the logical station number to the corresponding XTEL station name. A number (defined in the Logical Station Configuration table) that identifies the physical attributes required by the read and write operations on the tag.
Valid Entry: 0 to 999 (default=0)
All logical station numbers entered must first be defined in the Logical Station Information table.
Tag Name
The name of the tag whose value is updated when a block read action is performed or which is sent to the PLC when a block write action is performed. Symbolic representation of the PLC object to read or write.
Valid Entry: See FactoryLink and TSX/PMX PLC Data
PLC Object
In this example, the tag te_pl1 is updated when a block read or a block write operation is performed in relation to logical station 2 (the symbolic name of the X-TEL station is LSTA2). The Telemecanique object to read or write is word W0. Once all data is entered, click the Save icon to validate it. Exit to Configuration Explorer.
This field must be filled in with FR to automatically start the task at run time. This field must be filled in according to the type of communications:
Communications Type Valid Entry
Communications Type
Valid Entry
ETHWAY 1 card ETHWAY 2 card FIPWAY 1 card FIPWAY 2 card Programming port (PCX) TCP/IP 1 card TCP/IP 2 card ISAWAY 1 ISAWAY 2 Leave the following fields as previously completed.
Description, Start Trigger, Task Status, Task Message, Display Status, Display Name, Display Description, Start Order, Priority
Executable File
This field must be filled in with BIN/TECOM for the task to start. This field must be filled in according to the type of communications:
Communications Type Valid Entry
Program Arguments
MAPWAY 1 card MAPWAY 2 card FIPWAY 1 card FIPWAY 2 card UNI-TELWAY COM port ETHWAY 1 card ETHWAY 2 card Programming port (PCX) XWAYIP 1 XWAYIP 2 ISAWAY1 ISAWAY2
1 2 3 4 5 6 7 8 11 12 13 14
Note: In case of redundancy where two physical networks are connected to the same PLC, you can start only one FactoryLink task at a specific time.
TELEMECANIQUE | 21 Reference
R EFERENCE
Connecting to XWAY Networks The PC computer and its installed XWAY network interface card connect directly to the appropriate network.
-XWAY Network Interface Cards
FIPWAY network: Use the half-length TSX FPC 10M interface board. Refer to the TSX DM FPC 10M documentation for full instructions on installing this board. ETHWAY network: Use the half-length TSX ETH PC10M interface board. Refer to the TSX DM ETH PC 10M documentation for full instructions on installing this board. MAPWAY network: Use the full-length TSX MAP PC7 42M interface board. Refer to the TSX DM MAP PC7 M documentation for full instructions on installing this board. UNI-TELWAY COM Port network: A specific UNI-TELWAY software driver must be previously installed to use the standard Serial COM port for UNI-TELWAY communication protocol. This software can be ordered using the reference TXT LF UTW V50. ISA-WAY network: Contact your sales representative. XWAY-TCPI network: Contact your sales representative. Configuring Telemecanique Networks This subsection describes the various communication devices that can be connected to a FactoryLink system and to PLCs to form a network. It also lets the user determine the appropriate entries for the value of the first slave address, last slave address, and the TW7 fields in the Telemecanique Logical Station Configuration table described previously.
21 | TELEMECANIQUE Reference
Configuring the Slaves and the TW7 Data Fields This additional information is required to determine the appropriate data required for entry into the various fields in the Telemecanique Logical Station Control Information table:
First and Last Slave Addresses
A UNI-TELWAY bus can have up to 253 slave addresses as 0 is reserved for the master). To improve communication efficiency between FactoryLink and a PLC or a UNI-TELWAY bus, FactoryLink can send/receive requests to/from the master for between 2 to 15 slave addresses. This slave addresses characteristic does not apply to MAPWAY/ETHWAY/FIPWAY/ISAWAY/XWAYIP, first slave and last slave are used to define the number of communication sockets to be used. The communication devices use the first slave address only for unsolicited messages and the successive addresses (from the first address + 1 to the last address) for message data. To make use of this characteristic, assign the slave numbers, 4 to 18, to the communication device. To do this, specify the value 4 in the First Slave Address Field and the value 18 in the Last Slave Address Field in the Telemecanique Logical Station Control Information table. This allows FactoryLink to send/receive up to 15 messages at a time to/from the network. These settings must be compatible with the number of addresses declared in the CONFIG.SYS configuration file. Note the TSX 37.xx PLCs can only poll 8 addresses if connected through the TER port. For other XWAY protocols, the first slave/cost slave addresses are used to define the number of communication sockets to be used. For example, 5-15 on ETHWAY asks for 10 communication sockets. TSX programming port can handle a maximum of 2 communication sockets. This protocol is used with PCX PLC board. UNI-TE is a master-slave protocol. FactoryLink is always seen as slave. All FactoryLink requests travel through the master. Response time may be important if UNI-TE network has a lot of connection points.
TELEMECANIQUE | 21 Reference
It is recommended to declare the exact number of slaves in the master PLC. In fact, any slave declared and missing will have slow down the pool cycle. The master will have to retry several times the request and to wait each time the response timeout. When running, FactoryLink tries to connect to the PLCs defined in the configuration tables. Connections may take several minutes if the network has a significant number of slaves. For best performances, install a PLC with two UNI-TEL networks; one to collect the data and another where FactoryLink will be the only slave.
XWAY Configuration Drivers
Xway driver default settings (ETHWAY, FIPWAY, UNI-TELWAY) must be tuned for FactoryLink:
For ETHWAY driver, follow this procedure:
1 Open the Control Panel and double-click the Network Icon. 2 Select the ETHWAY01 or ETHWAY02 protocol 3 Click "Properties" 4 Click the "Advanced" tab 5 Select "7 - Number of Send Buffers", and set the value to 50 6 Select "8 - Number of Receive Buffers", and set the value to 50 7 Click "OK" to validate your modifications 8 Exit the Network Configuration Panel. The new settings are now active. Note: The performance may degraded if a PLC on the network is broken. This degradation can be minimized by changing the RetryPeriod parameter of the ETHWAY driver from the default of 800 to 100.
21 | TELEMECANIQUE Reference
1 Open the Control Panel and double-click the Network Icon. 2 On the Protocols tab of the Network property sheet, select ETHWAY01 or ETHWAY02. 3 Click "Properties". 4 Set Retry Period field to 100. 5 Click OK to enter the modification.
For UNI-TELWAY
1 Run icon UNI-TELWAY. 2 Select File, Advanced Configuration. 3 Set the value 50 to SBUF et RBUF.
For FIPWAY version 2.1 or earlier
1 Rename the dll x:\xdosdrv\cnffip_y.dll in cnffip.dll, where x:\ = Base folder where the driver fip is installed, xdosdrv = Folder where the drivers XWAY are installed, _y= f for french, e for english, g for german. 2 Double-click cnffip.exe. 3 Select File, advanced configuration. 4 Set 50 to SBUF et RBUF For versions later than 2.1, refer to the procedure for UNI-TELWAY.
TW7
Messages of up to 128 bytes in length can be transferred by UNI-TELWAY or MAPWAY. Messages transferred by a TELWAY network cannot be more than 32 bytes in length. However, if a message must transit via a TELWAY network to reach its final destination, specify YES in the TW7 field in the Telemecanique Logical Station Configuration table.
TELEMECANIQUE | 21 Reference
Network Examples FactoryLink communicates directly with the PLCs via UNI-TELWAY or MAPWAY/ETHWAY/FIPWAY (see example 1). Each PLC can, in turn, control a lower level network of interconnected PLCs via UNI-TELWAY, MAPWAY, ETHWAY, FIPWAY, ISAWAY, XWAYIP, or TELWAY (see Example 2). FactoryLink communicates with the PLCs on these lower level networks by way of the PLC common to both networks. Each PLC on a network must be assigned the same drop number as the group of stations to which it belongs. The drop number specifies which group of stations the messages are sent to. A UNI-TELWAY bus has one master. All other logical devices (LSTAx) are slaves. A MAPWAY/ETHWAY/FIPWAY/ISAWAY/XWAYIP network has neither master nor slave addresses. Example 1: 1 FactoryLink, 1 network, and 1 PLC. In this example, FactoryLink communicates with LSTA0 on the MAPWAY network.
Network Example 1
FactoryLink
X-WAY Network
Device LSTAO
Example 2: 1 FactoryLink system, 3 networks, and 8 PLCs. In this example, FactoryLink communicates with LSTA0 and LSTA4 via a MAPWAY network. A lower level UNI-TELWAY bus is connected to LSTA4 and a lower level TELWAY network is connected to LSTA0.
21 | TELEMECANIQUE Reference
Network Example 2
Monitor 77/2
LSTA 8 TO 23
Device LSTA4 (Drop1) Device LSTA5 (Drop1) Device LSTA6 (Drop1) Device LSTA7 (Drop1)
Slave 17 Slave 16 Master
UNI-TELWAY Network
(sta3)
(sta5)
Slave 18
LSTA3 (Drop0)
TELEMECANIQUE | 21 Reference
The configuration of these networks and of the lower level networks is set in the Telemecanique Logical Stations Configuration table:
TELEMECANIQUE Logical Stations Control
TYPE TEMAP1
TELEMECANIQUE Logical Station Information
Gate Number
TW7
Drop
1 1 3 5 2 2 2 2
0 0 0 0 0 5 5 5
0 0 0 0 0 3 3 3
0 0 0 0 0 74 75 76
0 0 0 0 1 1 1 1
21 | TELEMECANIQUE Reference
FactoryLink and TSX/PMX PLC Data Objects This section describes how the FactoryLink communication system converts the various types of data supported by Telemecanique PLCs for use with FactoryLink and vice-versa. It also provides instructions for filling in the PL7 Object field in the Read/Write Configuration table.
Data Type Conversion
Each FactoryLink tag specified in the Tag Name field in the read and write tables is assigned a FactoryLink data type, a logical station, a corresponding PLC memory address (specified in the PL7 Object field), and a PLC data type. The data types supported by FactoryLink are different from those supported by the PLCs. However, when writing to a FactoryLink data tag from its corresponding memory location in the PLC (PL7 Object), the software interface converts the type of data from a PLC data object to a FactoryLink data object type. In the same way, when writing to a PLC memory location (PL7 Object) from a FactoryLink data tag, the software interface converts the type of data from a FactoryLink data object to a PLC data object type. The following types of data objects are supported by the PLCs: Bit: BIT Single-length word (16-bits): WORD Double-length word (32-bits): DWORD Double-length floating point word objects: FDWORD Text (only for unsolicited data): TXT FactoryLink supports the following data types: Digital Analog Long Analog Floating-point Message (only for reading unsolicited data)
TELEMECANIQUE | 21 Reference
Conversion Process
Bit, single-length word, and double-length word data objects can be converted respectively to/from FactoryLink digital, analog and floating-point tags.
Converting a PLC Data Object to a FactoryLink Data Object
The FactoryLink communication system converts PLC data object types: bits, single-length words, and double-length words respectively into FactoryLink digital, analog and floating-point data objects. The task places the PLC data object to convert in the LSBs of a 32-bit word and assigns the value 0 to non-significant bits. The task then converts the complete 32-bit unsigned word into a FactoryLink data tag value. If a digital type data object is required, the task performs the following conversion: data value equal to 0, then the tag takes the value 0 (OFF). Data value not 0, then the tag takes the value 1 (ON). If an analog data object is required, the task performs the following conversion: the 32-bit word is reduced to a 16-bit length word, then copied to the analog data tag. If the data object is a DWORD, the 16-bit MSB data is lost. If a floating-point data object is required, the task performs the following conversion: the 32-bit word is converted into a floating-point positive value, then copied to the FactoryLink floating-point data tag. The PLC text type tags and the FactoryLink message type tags do not require conversion. The sign extension is not implemented.
Converting a FactoryLink Data Tag Into a PLC Data Object
The PLC Interface task converts FactoryLink digital, analog and floating-point values respectively into PLC bit, single-length words and double-length word data objects. The task places the FactoryLink data object to convert in the LSBs of a 32-bit word and assigns the value 0 to non-significant bits. The task then converts the complete 32-bit unsigned word into a PLC data object value. If a bit type data object is required, the task performs the following conversion: data value equal to 0, then the bit is set to 0. Data value not 0, then the bit is set to 1 (digital data tags equal 0 when inactive (OFF) and 1 when active (ON)).
21 | TELEMECANIQUE Reference
If a word type data object is required, the task performs the following conversion: the 32-bit word is reduced to a 16-bit length word, then copied to a PLC single-length word. If a floating-point data object is selected, the sign and the decimal part are lost. In addition, if the integer part exceeds 216-1, it is cropped. If a double-word data object is required, the task performs the following conversion: the 32-bit word is entirely written to a PLC double word data object. The sign extension is not implemented.
Telemecanique PLC Objects
Depending on the type of data used, PLC data objects (memory addresses) can be placed in the following categories: Bit objects Single-length word objects (WORD) Double-length word objects (DWORD) Double-length floating point word objects (FDWORD) I/O objects (I/O) The names of PLC objects are specified in the PL7 Object field in the Telemecanique Read/Write Configuration table in symbolic language, depending on the type, function, and address of the data object. See the following tables to determine the symbolic representations valid for PLC objects. Entry of the corresponding symbol in the PL7 Object field is not case sensitive. Space characters are not allowed. If a logical station is assigned to a TSX 37-xx PLC type, it is recommended to use the standard IEC syntax (%MWi, %Si,...). However, it is still possible to use the TSX V5 syntax (Wi, SYi,...), this allows it to connect to a TSX 37-xx PLC without rewriting the communication tables of an existing application. Note: PCX57 is an ATS (TSX57-xx, TSX37-xx) PLC type, so use the ATS syntax. The available objects are the implemented objects for ATS PLCs.
TELEMECANIQUE | 21 Reference
Bit Objects
Object
Object
Internal word Read/Write Bit taken from an internal word read Constant word read Bit from constant word read System word read/write Bit from system word read Common word read/write Bit from commonword read
Wi/% MWi i: internal word number Wi,b/%MWi,b i : internal word number b : bit number in hex. CWi/%KWi i : constant word number CWi,b/%KWi,b i : constant word number b : bit number in hex. SWi/%SWi i : system word SWi,b/%SWi,b i : system word number b : bit number in hex. COMi,j/Not implemented i : station number j : common word number COMi,j,b / Not implemented i : station number j : common word number b : bit number in hex.
21 | TELEMECANIQUE Reference
Object
Bit from double-length DWi,b / %MDi,b internal word i : double internal word number read b : bit number in hex. Double-length constant CDWi / % KDi word i : double constant word number read Bit from double-length CDWi,b / %KDi,b constant word i : double constant word number read b : bit number in hex.
Double-Length Floating-Point Word Objects (FDWORD)
i = 0 to 26206 b = 0 to 1F
Object
Double-length FCDWi / %KFi floating point constant i: constant float word number word read Double-length floating point word read/write FCDWi,b / %MFi,b i : float internal word number
The floating-point numbers are stored with IEEE single precision format (32 bits) inside the PLC and with IEEE double precision format (64 bits) inside FactoryLink.
TELEMECANIQUE | 21 Reference
This may induce a lost of precision when exchanging data between the PLC and FactoryLink.
I/O objects (I/O)
Object
Discrete I/O module input bit read Discrete I/O module output bit write Register bit read
Ixy,b / Not implemented x : rack number in hex. y : module number in hex. b : bit number in hex. Oxy,b / Not implemented x : rack number in hex. y : module number in hex. b : bit number in hex. IWxy,i / Not implemented x : rack number in hex. y : module number in hex. i : word number IWxy,i,b / Not implemented x : rack number in hex. y : module number in hex. i : word number b : bit number in hex. OWxy,i / Not implemented x : rack number in hex. y : module number in hex. i : word number Xi / Not implemented i : step number Ti,P/V/R/D / Not Implemented i : timer number P : preset value V : current value R : timer running D : timer done
x = 0 to F y = 0 to 7 b = 0 to F x = 0 to F y = 0 to 7 b = 0 to F x = 0 to F y = 0 to 7 i = 0 to 7 x = 0 to F y = 0 to 7 i = 0 to 7 b = 0 to F x = 0 to F y = 0 to 7 i = 0 to 7 i = 0 to 511 i = 0 to 127
21 | TELEMECANIQUE Reference
Object
Ti,P / Not implemented i : timer number Mi,P/V/R / Not implemented i : monostable value P : preset value V : current value R : monostable running Mi,P / Not implemented i : monostable number Ci,P/V/E/F / Not implemented i : counter number P : preset value V : current value E : upcount overflow F : downcount overflow Ci,P / Not implemented i : counter number Ri,I/O/E/F / Not implemented i : register number I : input word O : output word E : empty register F : full register Ri,I / Not implemented i : register number
i = 0 to 127 i = 0 to 31
i = 0 to 31 i = 0 to 255
i = 0 to 255 i = 0 to 127
i = 0 to 127
FactoryLink allows access to a sub-group of NUM programmed in ladder objects. The list is: Saved variables ( %Mi ) Non-saved variables ( %Vi ) Common words ( %Si )
TELEMECANIQUE | 21 Reference
Num Objects
Object
Addressing Range
Saved Variables Word Double Word Bit from Word Unsaved Variables Word Double Word Bit from Word Common Word Word
Read/Write
%Si.W
i=< 3F7E *
i = Hexadecimal address of the object j = Number of the bit in the word * For this object, only addresses where the low byte is lower or equal to H7E are allowed. Caution:For NUM two words are consecutive and disjoin if they are separated by 2 unities. And in the same way two long words have to be separated by 4 unities.
Wi
High Byte
Low Byte
Wi+1 Wi+2
high Byte
21 | TELEMECANIQUE Reference
As a result... To take advantage of the algorithm that minimizes the number of requests, it is recommended that you write odd word series or even word series. For long word, write a series of long word equal modulo 4.
Examples
Read table Tab0 = %M0.W,%M2.W,%M1A.W,W78.W generates 1 read request of 60 words. Read table Tab1 = %M11.W,%M1B.W,%M1D.W,%M20.W,%M23.W,%M25.W generates 3 read requests. Reading of 7 words from %M11.W, Reading of the word %M20 and reading of 2 words from %M23. Read table Tab2 = %V25.L,%V29.L,%V2D.L,%V2E.L,%V32.L,%V34.L,%V36.L generates 4 requests. Reading of 3 long words from %V25.L, Reading of 2 long words from %V2E.L , Reading of long word %V32.L and Reading of long word %V34.L. Write table Tab3 = %S10.W,%S12.W,%S16.W,%S17.W generates 3 write requests. Writing of 2 words from %S10.W, writing word %S16.W and writing word %S17.W. Write table Tab4 = %M100.L,%M104.L,%M108.L,%M10A.L,%M10C.L,%M10D.L,%M111.L generates 4 write requests. Writing of 3 long words from %M100.L, writing of %M10A.L, writing of %M10C.L and writing of 2 long words from %M10D.L For NUM only the bits from 0 to 7 are available and are coded with the high byte of the word. Wi Wi+1 b7, b6, b5, b4, b3, b2, b1, b0 ////////////////////////////////// b7, b6, b5, b4, b3, b2, b1, b0
TELEMECANIQUE | 21 Reference
Unsolicited Data Configuration Example When FactoryLink receives unsolicited data from a PLC, it compares the UNI-TE address of the data received (a PLC and sender text block function) with the addresses of the logical stations assigned to the message type tags in the configuration tables. If a matching address is found, it automatically updates the tag assigned to this address using the data of the request received. A single Message type tag must be assigned to a logical station; otherwise, only the first tag encountered in the table with the lowest number will be updated. On a UNI-TELWAY bus, Serial Port: Master PLC: Unsolicited data is generated by a master PLC from a text block. Configure the CPL type text block TXT, for OUTPUT with: TXTi,C = HFC TXTi,M = Hxx65 where xx is the location of the TSX SCM module in the rack (FF for the built-in TSX SCI port) TXTi,L = Number of bytes to send. Slave PLC: To send unsolicited data from a UNI-TELWAY slave to a FactoryLink system, configure the CPL type text block for OUTPUT with the following: TXTi,M = HTSX SCM slot, sender address + 64 TXTi,C = H07FC Category/Request code TXTi,L = 6 + number of usable bytes If the transmission buffer address = Wi Wi = Hnetwork number/00 Wi + 1 = Hgate number/station number Wi + 2 = H (64 + lowest Monitor 77 address) FE E.g. H65FE Wi + 3 = Data to send Example: Master station on multi-drop bus 0.
21 | TELEMECANIQUE Reference
M77 addresses 1 to 15. Slave station: ad0 = H 10 (16), ad1 = H 11 (17), ad2 = H 12 (18). The UNI-TELWAY module is located in slot 3. In these examples, the lowest FactoryLink address (H65) corresponds to the address of Slave 1. If FactoryLink uses other slave addresses such as 10 to 25 (also referred to as data link addresses), the lowest address is H6E (100+10 in decimal notation). Configure the text block to send unsolicited data from a slave device to FactoryLink: TXTi for OUTPUT TXTi,M = H0375 (slot 3, sender address (H64 + ad1)) TXTi,C = H07FC (unsolicited data request code) TXTi,L = 6 + n (n = number of bytes to send) Address of Buffer Wi : Wi = H0000 (network number 0) Wi + 1 = H05FE (gate H05, station HFE) Wi + 2 = H65FE (Monitor 77 address H64 + 1) Wi + 3 = data to send On a MAPWAY/FIPWAY/ETHWAY network: Configure the TXT type NET function block for OUTPUT with to send unsolicited data from a network station to the FactoryLink system: TXTi,A = HMonitor 77 network/station address TXTi,T = 0 Monitor 77 reception text block number (always 0) TXTi,L = 2 + number of bytes to send Wi = H07FC unsolicited data category/request code Wi + 1 = data to send
TELEMECANIQUE | 21 Reference
Network Number
Station Number
Gate Number
Module Number
Device Number
0 0 1
FE FE 7
5 5 11
FE FE 0
74 74 0
In this example, the first station is configured to receive unsolicited data sent from slave 17. The second station is configured to receive unsolicited data sent by text block 3 of the master PLC application. The third station is configured to receive unsolicited data from text block 1 of a PLC application connected to the network as station 7.
Read/Write Information Table Entries for Unsolicited Read
Logical Station
Tag Name
PL7 Object
1 2 3
Unsol1: FactoryLink tag updated on reception of unsolicited data from slave 17. Unsol2: FactoryLink tag updated on reception of unsolicited data from master text block 3. Unsol3: FactoryLink tag updated on reception of unsolicited data from text block 1 of station number 7 on XWAY network 1.
E RROR M ESSAGES
This section describes the messages reporting operations and error conditions that can be generated and displayed for the Telemecanique protocol module.
Bad DCT file
Cause:
Action:
The specified file is corrupt. Delete the files from the FLAPP\DCT directory and restart FactoryLink.
Cause:
Action:
(UNI-TELWAY only) The master PLC does not poll the UNI-TELWAY slaves as expected. Ensure the UNI-TELWAY master PLC polls the range of communication slaves configured for the task.
Cause:
Action:
TECOM is invoked on UNI-TELWAY, and the associated UNI-TELWAY driver is not installed in the system. Install the UNI-TELWAY driver before invoking TECOM.
Cause:
Action:
The communication task cannot open the requested associated communication driver. Ensure the software driver is installed in the system.
Cause:
Action:
No external device definition is configured. Configure the EDI table for the device.
Cause:
Action:
Cause:
Action:
(ETHWAY only) An addressed PLC is not physically connected to the network. Ensure all addressed PLCs are physically connected to the ETHWAY network.
Cause:
Action: Link is spurious
The UNI-TELWAY driver must be configured to respond for a minimum of two slaves. Modify the NBR field in the config.sys file.
Cause:
Action:
(UNI-TELWAY only) An unexpected, unsolicited message is received. Ensure the PLC is sending unsolicited messages to the first UNI-TELWAY slave number reserved for this purpose.
Cause:
The response from logical station <xxx> was not received within the configured timeout period. The physical link may have broken while requests were still waiting for a response. Increase the timeout value in the Telemecanique Logical Station configuration table.
Action:
Cause:
Action:
The External Device Definition table does not have a TE__/CUSTOM logical port configured. Configure the logical port on the External Device Definition table. The Telemecanique table does not define a logical port on the invoked XWAY network. Define the logical port on the Telemecanique table. Definitions on the EDI and Telemecanique tables do not match. Ensure the definitions match in both EDI and Telemecanique.
Cause:
Action:
Cause:
Action:
Cause:
Action:
The Telemecanique communication task must use a minimum of two slaves. Ensure the first and last slave fields are configured properly.
Cause:
Action:
More than 200 block read tables are configured. Ensure less than 200 block read tables are configured.
Cause:
Action:
More than 200 block write tables are configured. Ensure less than 200 block write tables are configured.
Cause:
Action:
More than 200 exception write tables are configured. Ensure less than 200 exception write tables are configured.
Cause:
Action:
More than 200 unsolicited read tables are configured. Ensure less than 200 unsolicited read tables are configured.
Cause:
Action:
No read/write IO is configured for this logical port. Configure the necessary read/write IO for the logical port.
Cause:
FactoryLink tried to read/write non-configured objects in a PLC. For example, FactoryLink may have tried to read 43545 internal words but the PLC was configured for 32767 internal words. Check to ensure the PLC is configured with the correct range.
Action:
Cause:
Action:
The configured PLC address does not exist on the network. Verify the PLC address.
Cause:
Action:
The Telemecanique communications driver option bit is not validated. Install the option bit.
Cause:
Action:
An unsolicited message is received on an unexcepted communication socket. Ensure the sender (PLC) addresses the message to a configured logical station.
Chapter 22
This chapter contains information needed to set up and configure bidirectional communications between the FactoryLink real-time database and various devices in either of two ways: Directly (point-to-point mode) via a COM port on the system unit Over a TIWAY Serial Unilink network (TIWAY mode) via a COM port on the system unit through the TIWAY Host Adapter module The following table lists the supported device types for point-to-point and network communications:
Point-to-Point TIWAY Serial Unilink
Texas Instruments 525 Texas Instruments 530C Texas Instruments 530T Texas Instruments 535 Texas Instruments 540 Texas Instruments 545 Texas Instruments 565 Texas Instruments 545 Texas Instruments 560 Texas Instruments 565 Texas Instruments RTU Texas Instruments 5TI
Texas Instruments 520C Texas Instruments 525 Texas Instruments 530C Texas Instruments 530T Texas Instruments 535 PM550 PM550C
switch 1 up switch 2 up switch 3 down switch 4 down switch 5 configurable (See Baud Rate Table.) switch 6 configurable (See Baud Rate Table.) switch 7 configurable (See Baud Rate Table.) switch 8 configurable (See Baud Rate Table.) switch 9 configurable (See Host Command Timeout Table.) switch 10 configurable (See Host Command Timeout Table.) switch 1 up switch 2 down switch 3 up switch 4 down switch 5 configurable (See Baud Rate Table.) switch 6 configurable (See Baud Rate Table.) switch 7 configurable (See Baud Rate Table.) switch 8 configurable (See Baud Rate Table.) switch 9 down switch 10 down
DIP switch 2
U P
Host Command timeout TIWAY I Baud Rate Up Down Up Down Up Down Up Synchronous Asynchronous Full Duplex Half Duplex NRZI NRZ NITP
U P
10 Dipswitch 2
Up Down Up Down
Host Port Baud Rate Up Down Up Down Up Down Up Down Synchronous Asynchronous Full Duplex Half Duplex Even Parity Odd Parity Parity Enabled Parity Disabled
Baud Rate Set the TIWAY Serial Unilink network baud rate with DIP switch 1 switches 5, 6, 7, and 8. Set the host PC's (PC running FactoryLink) port baud rate with DIP switch 2 switches 5, 6, 7, and 8. Baud rates for the TIWAY Serial Unilink network and the host PC's port may be configured differently. Use the following information to set the baud rate on DIP switches 1 and/or 2:
Switches 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 = Up Baud Rate 110 150 300 600 1200 2400 4800 9600 19200 38400 57600* 115200*
0 = Down
Up 1
Down 0
Timeout Use the following information to set the host PC's command timeout:
DIPSWITCH 1 Position 9 10 Description 0 sec - Accepts No Host Commands (SANM) 10 sec Timeout 20 sec Timeout 40 sec Timeout
DIP Switches for TIWAY NIM Use the following information to set DIP switches for each NIM:
Dipswitch Settings for TIWAY NIM Switch LOCAL/REMOTE KEYDELAY LCKBIT NRZI/NRZ X.25/HDLC FULL/HALF SYNC/ASYNC BAUD NETWORK ADDRESS Desired Setting REMOTE (ONLINE) OFF OFF NRZI HDLC HALF ASYNC 115.2K 1-254 ARE VALID ADDRESSES
Note
If you are changing the baud rate of the TIWAY Serial Unilink network, change the corresponding switches for the Host Adapter.
A CCESSING
THE
Note
Before completing the protocol-specific General Electric configuration tables, you must complete the External Device Definition table. See Identifying Protocol Types and Defining Logical Ports on page 58 for details. In your server application, open Device Interfaces > Texas Instruments.
C ONFIGURING
THE
Open the Unilink Setup table. If you are communicating directly (point-to-point) with a single TI PLC, you do not need to configure this table. Specify the following information:
Logical Port for UNILINK
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a TI device.
Valid Entry: previously defined logical port number
Comment
The following table provides sample entries for the Texas Instruments TIWAY Unilink Setup table:
Field
Logical Port for UNILINK
Entry
Description
Specifies the logical communication path configured by this table Port 1 communicates with a TIWAY Host Adapter
Comment
Port 1 as MHIU
From the Unilink Setup table, select the row for the logical port you are configuring and open the Unilink Setup Information table. Specify the following information:
Adapter Mode
Specify whether a Host Adapter is the network manager. MHIU Network Manager HIU Any other Host Adapter on the network
Adapter Station
Enter the address of a Host Adapter on a network. Each Host Adapter on a TIWAY network must have a unique address.
Valid Entry: 1 - 254
Enter the number of the highest physical station address on the TIWAY Serial Unilink network associated with a logical station specified in the Texas Instruments Logical Station Table.
Valid Entry: 1 - 254
(Optional) Thirteen fields that allow you to configure optional parameters for an MHIU Host Adapter. For a description of these optional parameters, refer to the section on configuring the network manager in the TIWAY documentation.
Valid Entry: Refer to the section on configuring the MHIU
(Optional) Three fields that allow you to configure optional parameters for an HIU Host Adapter. For more information about optional parameters for this field, refer to the section on configuring the HIU in the TIWAY documentation.
Valid Entry: Refer to the section on configuring the HIU in the
The following table provides sample entries for the Texas Instruments TIWAY Unilink Setup Information table:
Field
Adapter Mode Adapter Station Adapter Max Station Address NM Option 1 - 9, A-E
Entry
Description
MHIU 5 1 1
Host Adapter is configured for MHIU mode Address for Host Adapter on the network The highest NIM address on the network is 1 Not configured because the Host Adapter is configured in MHIU mode
C ONFIGURING
THE
Open the Logical Station Control table. Complete a row for each logical port specified in the External Device Definition table you want to define as a communication path for read and write operations.
Logical Port
Enter a number, defined in the External Device Definition table Logical Port column, to represent a particular communication path to a TI device.
Valid Entry: previously defined logical port number
Baud Rate
Enter the speed at which the protocol module communicates with the devices linked to FactoryLink via this logical port. This entry must match the baud rate configuration of the devices. Refer to the device manufacturers documentation for details.
Valid Entry: 110, 150, 300, 600, 1200, 2400, 3600, 4800, 7200,
Recommended entry is 19200 if using a TI PLC on a TIWAY network or 9600 if using a point-to-point TI PLC. However, if using hardware requiring special parameters, you may need to enter a different baud rate.
Parity
Enter the parity error correction during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: odd, even, none
Data Bits
Enter the number of data bits used during transmission via this logical port. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 5, 6, 7, 8
The recommended entry is 7. However, if using hardware requiring special parameters, you may need to enter a different data bit.
Stop Bits
Enter the number of bits sent after a character to create a pause before the start of the next character. This entry must match the configuration of the devices communicating via this port. Refer to the device manufacturers documentation for details.
Valid Entry: 1, 2
The recommended entry is 1. However, if using hardware requiring special parameters, you may need to enter a different stop bit.
Timeout
Enter the length of time, in tenths of a second, the protocol module will wait to receive a response to a read or write command before timing out. You must enter a value greater than 0 for the protocol module to timeout.
Valid Entry: 0 - 32000
(Optional) Enter a tag name for a message tag to which a text string will be written to indicate a communications error associated with this logical port.
Valid Entry: tag name Valid Data Type: message
When the table is complete, click the Save icon to validate the information. Define the data type (message) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the Texas Instruments Logical Station Control table:
Field
Logical Port
Entry
Description
Baud Rate Parity Data Bits Stop Bits Timeout Status Msg Tag
Specifies the logical communication path configured by this table. Specifies the communication rate. Odd parity checking. Specifies 7 data bits in the transmission. Specifies 1 stop bit in the transmission. The response timeout is 3 seconds. Error messages are written to the message tag logical port 0.
C ONFIGURING
THE
From the Logical Station Control table, select the row for the logical port you are configuring and open the Logical Station Information table. Complete a row for each device to communicate through this logical port.
Error/Status Tag Name
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station). You can animate output-text objects to display the codes stored in an Error/Status Tag Name tag on a graphics screen.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. Later, you will enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry: 0 - 999
Device Type
Enter the TI PLC type to which communications are to be directed. (When using a TI545, enter TWY565 or PLC 565.)
Valid Entry Unilink Network
TWY520C TWY525 TWY530C TWY530T TWY535 TWY560 TWY565 TWYRTU TWY5TI TWY550 TWY550C
Physical Station
Physical station address of the device with which the EDI task communicates when using this logical station in a Read/Write table.
Valid Entry: 1 - 254 (Normally, the physical station number is
Comment
When the table is complete, click the Save icon to validate the information. Define the data type (analog) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the Texas Instruments Logical Station Information table:
Field
Error/Status Tag Name Logical Station Device Type
Entry
Description
Contains information about communication errors Specifies the logical communication paths. Specifies the type of device connected to the communication path. Specifies the physical station numbers associated with the logical path.
Physical Station
Comment
TI, PORT 0
C ONFIGURING
THE
Open the Read/Write Control table. Complete a row for each read or write table.
Tip
See Application Design Tips and Techniques on page 127 for information about triggering schemes using tags defined in this table.
Table Name
Assign a name to this read or write request. Define one request (table) per line and do not include spaces in the name. You can define as many tables as available memory allows. Try to make the table name reflective of the operation it represents. If this is a triggered read or a block write table, when the trigger tag (Block Read Trigger for a read operation or Block Write Trigger for a write operation) is forced to 1 (ON), the tag prompts FactoryLink to process this table and any other table in which the same trigger is defined.
Valid Entry: alphanumeric string of up to 16 characters
Exception Write
For EDI to interpret this operation as a triggered block write or as a read operation, accept the default of NO. For EDI to interpret this operation as an exception write and write tag values to the device only when those values change, enter YES. Do not specify tags expected to change at frequent and unpredictable intervals in an exception write table. Any tag specified will be written to the device in its own packet (message) each time it changes. Defining tags that change value frequently as exception writes can slow down communications or result in an error message. In an exception write, an internal change-status indicator within the tag containing the data to be written prompts the write operation. If a tag is configured for an exception write and EDI recognizes this indicator is set since the last scan of the real-time database (indicating the value of the tag has changed), EDI writes this tags value to the device.
Valid Entry: yes, no (default = no)
If this is a block read operation, enter a number to indicate the priority of this table, relative to other read operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of block read requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a write operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block read.
Valid Entry: 1 - 4 (default = 1)
Note
The Block Read Trigger, Block Read Disable, Block Read Complete, and Block Read State tags apply only to triggered read operations. Do not define these tags If this is a write operation, ignore this field. If this is a triggered read operation, this field is required. Enter a tag name for a digital tag to initiate a block read of the addresses specified in the Read/Write Information table. When this tags value is forced to 1 (ON), the addresses are read.
Valid Entry: tag name Valid Data Type: digital
Tip
The Block Read Disable tag can be used to disable a block read operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered read table, the Block Read Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for details.
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to disable a block read of the tags specified in this table, enter a tag name. When this tags value is forced to 1 (ON), the read operation is not executed, even when the block read trigger is set to 1. To reenable a block read table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a write operation, ignore this field. If this is a triggered read operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the tags defined in the Read/Write Information table are updated in the FactoryLink database, the state tag is forced back to 1.
Valid Entry: tag name Valid Data Type: digital
If this is a block or exception write operation, enter a number to indicate the priority of this table, relative to other write operations. The highest priority is 1. This number influences the order in which the EDI task handles the queuing of write requests. If EDI receives two requests at the same time, it processes the request with the highest priority first. The default is 1. If this is a read operation, accept the default of 1. This field defaults to 1 regardless of whether the operation being defined is a block or exception write.
Valid Entry: 1 - 4 (default = 1)
Note
The Block Write Trigger, Block Write Disable, Block Write Complete, and Block Write State tags apply only to write operations. Do not define these tags for read operations.
Block Write Trigger
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is required. Enter a tag name for a digital tag to initiate a block write of the tag values specified in the Read/Write Information table to the addresses defined to receive the values. When this tags value is forced to 1 (ON), FactoryLink writes the values.
Valid Entry: tag name Valid Data Type: digital
Tip
The Block Write Disable tag can be used to disable a block write operation that is either part of a cascaded loop or is self-triggered. The triggering cycle will cease upon disabling, however. To reenable a cascaded loop or a self-triggered write table, the Block Write Trigger tag must be toggled or forced to 1. See Application Design Tips and Techniques on page 127 for details.
If this is a read operation or an exception write operation you do not plan to periodically disable, ignore this field. If this is a block write table or an exception write table you plan to periodically disable, this field is optional. Enter a tag name for a digital tag to disable a block write to the addresses specified in this table. When this tags value is forced to 1 (ON), the write operation is not executed, even when the block write trigger is set to 1. To reenable a block write table that is disabled, set this tag back to 0 (OFF).
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write table, this field is optional. If you need a digital tag to indicate when this operation is complete, enter a tag name. This tag is forced to 1 (ON) at startup. After the data defined in this tables Read/Write Information table is written to the device, the complete tag is forced to 1 again. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
If this is a read or exception write operation, ignore this field. If this is a block write operation, this field is optional. If you need a digital tag to indicate the state of this operation (in progress or complete), enter a tag name. This tag is forced to 1 (ON) at startup. While the table is being processed, the tag is set to 0 (OFF). After the data defined in this tables Read/Write Information table is written to the device, the state tag is forced back to 1. Do not use this tag when more than one logical port is specified in a single table.
Valid Entry: tag name Valid Data Type: digital
When the table is complete, click the Save icon to validate the information. Define the data type (digital) for any tag names displayed in the Tag Definition dialog box.
The following table provides sample entries for the Texas Instruments Read/Write Control table:
Field
Table Name Exception Write Block Read Priority Block Read Trigger
Entry
Description
READ N 1
Name of the read/write table. Table READ will perform exception writes. Priority is set to 1.
TI_READ_TRIGGER When the value of TI_READ_TRIGGER is 1 or (on), a block read of values specified by the Read/Write Information table associated with table READ occurs. TI_READ_DISABLE The tag TI_READ_ DISABLE disables the block read of table READ when the value is 1. TI_READ_STATE The value for TI_READ_STATE is set to 1 if a read operation of table READ is in progress, and the value is 0 if it is inactive. Default=1
C ONFIGURING
THE
From the Read/Write Control table, select the row for the table you are configuring and open the Read/Write Information table. For a Read Table add a table entry for each FactoryLink tag in which data read from the device will be stored when the operation executes. For a Write Table add a table entry for each tag to be written when the operation executes.
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device. For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, float
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Data Type
Specify the type of data being read from or written to the device for each tag defined in the Tag Name field. Refer to the TIWAY documentation for valid data types for each channel. If you are using the loop indexing feature, see Configuring Tables for Loop Indexing on page 543 for information about valid entries for this field.
Valid Entry FactoryLink Type
Valid Entry
FactoryLink Type
Y - Y input packed C - CR packed WX - word input WY - word output TCP - timer counter preset TCC - timer counter current DSP - drum step preset DSC - drum step current DCP - drum count preset STW - status word
Digital Digital Analog Analog Analog Analog Analog Analog Analog Analog
TI 545 or TI 565 PLCs with s-memory (special-function memory) can also use the following entries:
Valid Entry Description FactoryLink Type
** ** ***
Loop V-flags Loop ramp/soak status Analog alarm V-flags Analog alarm C-flags Loop C-flags Loop gain
* ** ***
Read-only. For point-to-point protocol modules, use AVF_ instead of AVF. Read-only. Exception write only.
Valid Entry
Description
FactoryLink Type
LTI LTD LHA LLA LPV LPVH LPVL LODA LYDA LTS LSP LMN ** LERR LMX LHHA LLLA LRCA LRDS LRRC * ** ***
Loop reset Loop rate Loop high alarm Loop low alarm Loop process variable Loop pv high limit Loop pv low limit Loop orange deviation Loop yellow deviation Loop sample rate Loop setpoint Loop output Loop error Loop bias Loop high alarm limit Loop low alarm limit Loop rate of change limit Loop ram dest. setpoint Loop ramp rate of change
Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point
Read-only. For point-to-point protocol modules, use AVF_ instead of AVF. Read-only. Exception write only.
Valid Entry
Description
FactoryLink Type
LRST LSDB AHA ALA APV APVH APVL AODA AYDA ATS ASP ** AERR AHHA ALLA ARCA LCFH LCFL ACFH ACFL * ** ***
Loop soak time Loop soak deadband Analog alarm high limit Analog alarm low limit Analog alarm process variable Analog alarm PV high limit Analog alarm PV low limit Analog alarm orange deviation Analog alarm yellow deviation Analog alarm sample rate Analog alarm setpoint Analog alarm error Analog alarm high limit Analog alarm low limit Analog alarm rate of change Analog C flags high order Analog C flags low order Analog C flags high order Analog C flags low order
Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Analog Analog Analog Analog
Read-only. For point-to-point protocol modules, use AVF_ instead of AVF. Read-only. Exception write only.
Valid Entry
Description
FactoryLink Type
*** * ** ***
Note
PORT
Digital
Read-only. For point-to-point protocol modules, use AVF_ instead of AVF. Read-only. Exception write only.
Use the PORT data type only with an exception write tag. A 1 (one) written to this tag closes the port associated with the logical station for this tag. No further reads or writes occur. A 0 (zero) written to this tag opens the port. Use of the TIWAY Network reinitializes the Unilink Host Adapter before further reads or writes occur. After the port is reopened, reads and writes will operate normally.
Address
Enter the address of the memory location (word) being read or written to. The system reads the value at the address and transfers it to the tag specified in the Tag Name column. The amount of memory assigned to each PLC data type depends on several factors, including the PLC model and the amount of memory installed in the system. If not using the loop indexing feature, do not configure more than one Read/Write table to write to the same address. If you are using the loop indexing feature, the Address field may need to be left blank. See Loop Indexing on page 543 for information about configuring tables for loop indexing. DCP, LRDS, LRRC, LRST, and LSDB data types require you employ additional parameters to determine the Address field entry. See Additional Parameters for TI Data Types on page 552 for information about these parameters.
Valid Entry: 1 - 32767, 1 - 64 (used with TI 545 or TI 565 PLCs
with s-memory; see additional data types listed in the preceding table)
Loop Index
If you are not using loop indexing, leave this field blank.
(Optional; use only with TI 545 or TI 565 PLCs having s-memory) Alphanumeric string representing an analog tag whose value determines the loop tag. The system reads the PLC address specified in the Logical Station and Data Type fields and writes the returned data to the loop tag specified by the value of the loop index variable. The value of this loop index variable designates one of the tags specified in the Tag Name field. The loop index variable is valid only for s-memory data types such as loop variable and analog alarms. See the Data Type field description on page 537 for valid s-memory data types. See Configuring Tables for Loop Indexing on page 543 for more information about loop indexing.
Valid Entry: NONE, LOOP1, LOOP2, LOOP3, LOOP4,
LOOP5, LOOP6, LOOP7, LOOP8, LOOP9, LOOP10, LOOP11, LOOP12, LOOP13, LOOP14, LOOP15, LOOP16 (default = NONE)
When the table is complete, click the Save icon to validate the information. Define the data type (digital, analog, or floating-point) for any tag names displayed in the Tag Definition dialog box. The following table provides sample entries for the Texas Instruments Read/Write Information table:
Field
Table Name Tag Name
Entry
Description
READ TX_DIG_01
Specifies the Read/Write table name Destination tags in the real-time database for the addresses read from the PLC Specifies the path to send the request Variables in memory addresses 1 and 50 Memory addresses
0 Y 1 NONE
L OOP I NDEXING
You can configure a TI PLC to read and write to a maximum of 64 loop tags in the FactoryLink real-time database, using a loop index variable. A loop index variable is an analog tag whose value specifies which of up to 64 tags (loop tags) in the real-time database that it will read or write to. A maximum of 16 loop index variables can be defined. These loop index variables constitute a loop index. Configuring Tables for Loop Indexing To implement the loop indexing option, configure the following tables: One initial Read/Write table that references up to 16 loop index variables One or more Read/Write tables that reference the loop index variables specified in the initial Read/Write table
Initial Read/Write Table
First, configure one Texas Instruments Read/Write table that references up to 16 loop index variables. Next, to implement the loop indexing option, in the Texas Instruments Read/Write Control table, configure either a write trigger or enable the exception write. The entries in the loop indexing Texas Instruments Read/Write Information table identify the analog loop index variables. The table can include up to 16 loop index variables. The value of each loop index variable specifies a different loop tag in the FactoryLink real-time database. Configure only one Texas Instruments Read/Write Information table to identify these loop index variables. Specify the following information for each loop index variable:
Tag Name
(Optional) Enter a tag name for an analog tag in which to store communications error codes associated with this device (logical station). You can animate output-text objects to display the codes stored in an Error/Status Tag Name tag on a graphics screen.
Valid Entry: tag name Valid Data Type: analog
Logical Station
Enter a number to identify the logical station to which the information in this row pertains. A logical station represents the combination of a logical port with a physical station. Assign a unique number to each device communicating through this logical port. You will later enter this logical station number in a read or write table to represent the device defined in this row. In a read or write table, this number will identify the device to or from which data is to be sent or received.
Valid Entry:
0 - 999
Data Type
Specify the type of data being read from or written to the device for each tag defined in the Tag Name field.
Valid Entry: register, status
Address
For a read table, enter the address in the devices memory where the value to be stored in this tag is located. For a write table, enter the address in the devices memory to which the tag value will be written.
Valid Entry: 1 - 8192
Loop Index
Enter an alphanumeric string representing a real-time database analog tag whose value determines the TI 545 or TI 565 loop tag. Loop index variable used only with TI 545 or TI 565 PLCs having s-memory.
Valid Entry: NONE, LOOP1, LOOP2, LOOP3, LOOP4,
LOOP5, LOOP6, LOOP7, LOOP8, LOOP9, LOOP10, LOOP11, LOOP12, LOOP13, LOOP14, LOOP15, LOOP16, (default = NONE)
When all appropriate information is specified, the table resembles the following:
In this example, table FB references the 16 loop tags (listed in the Tag Name field) previously defined in the Graphics Mode Input task. The entries in the Loop Index field reference the loop tags in the Tag Name field that are used by the loop indexing Read/Write tables. For example, if a loop indexing Read/Write table needs to reference the analog value contained in the tag LOOPNDX1, you must enter LOOP1 in its Loop Index field. When the Texas Instruments Read/Write table is complete, click the Save icon to accept the information.
Loop Indexing Read/Write Table
Next, configure one or more Read/Write tables for each loop index variable defined in the initial Read/Write table. The entries in the loop indexing Texas Instruments Read/Write Information table reference each loop index variable referenced in the initial Read/Write table and the corresponding loop tags read by this variable. These entries also use the loop index variable specified in the initial Read/Write table to identify loop tags in the FactoryLink real-time database to be read or written to. The table can include up to 1,000 entries. Specify the following information for each loop tag:
Tag Name
For a read table, specify a tag name for a tag in which FactoryLink will store the data read from the device.
For a write table, specify a tag name for a tag containing a value to be written to the device.
Valid Entry: tag name Valid Data Type: digital, analog, floating-point
Logical Station
Enter the number representing the device from which the data is to be read or to which the tags value will be written. This number was originally defined in the Logical Station Information table for the logical port through which communications with this device occurs.
Valid Entry: previously defined logical station number
Data Type
Specify the type of data being read from or written to the device for each tag defined in the Tag Name field. For valid data types for each channel, refer to the TIWAY documentation.
Valid Entry
Description
FactoryLink Type
Variable memory Constant memory X input packed Y input packed CR packed Word input Word output Timer counter preset Timer counter current Drum step preset Drum step current Drum count preset Status word
Analog Analog Digital Digital Digital Analog Analog Analog Analog Analog Analog Analog Analog
TI 545 or TI 565 PLCs with s-memory (special-function memory) can also use the following entries:
Valid Entry Description FactoryLink Type
** ** ***
LVF LRSF AVF AACF LCF LKC LTI LTD LHA LLA LPV LPVH LPVL LODA LYDA LTS LSP
Loop V-flags Loop ramp/soak status Analog alarm V-flags Analog alarm C-flags Loop C-flags Loop gain Loop reset Loop rate Loop high alarm Loop low alarm Loop process variable Loop pv high limit Loop pv low limit Loop orange deviation Loop yellow deviation Loop sample rate Loop setpoint
Analog Analog Analog Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point
* ** ***
Read-only. For point-to-point protocol modules, use AVF_ instead of AVF. Read-only. Exception write only.
Valid Entry
Description
FactoryLink Type
LMN ** LERR LMX LHHA LLLA LRCA LRDS LRRC LRST LSDB AHA ALA APV APVH APVL AODA AYDA ATS * ** ***
Loop output Loop error Loop bias Loop high alarm limit Loop low alarm limit Loop rate of change limit Loop ram dest. setpoint Loop ramp rate of change Loop soak time Loop soak deadband Analog alarm high limit Analog alarm low limit
Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point Floating-point
Analog alarm process variable Floating-point Analog alarm PV high limit Analog alarm PV low limit Floating-point Floating-point
Analog alarm orange deviation Floating-point Analog alarm yellow deviation Floating-point Analog alarm sample rate Floating-point
Read-only. For point-to-point protocol modules, use AVF_ instead of AVF. Read-only. Exception write only.
Valid Entry
Description
FactoryLink Type
ASP ** AERR AHHA ALLA ARCA LCFH LCFL ACFH ACFL *** * ** ***
Note
Analog alarm setpoint Analog alarm error Analog alarm high limit Analog alarm low limit Analog alarm rate of change Loop C flags high order Loop C flags low order Analog C flags high order Analog C flags low order Port ON/OFF digital tag
Floating-point Floating-point Floating-point Floating-point Floating-point Analog Analog Analog Analog Digital
PORT
Read-only. For point-to-point protocol modules, use AVF_ instead of AVF. Read-only. Exception write only.
Use the PORT data type only with an exception write tag. A 1 (one) written to this tag closes the port associated with the logical station for this tag. No further reads or writes occur. A 0 (zero) written to this tag opens the port. Use of the TIWAY Network reinitializes the Unlink Host Adapter before further reads or writes occur. After the port is reopened, reads and writes will operate normally.
Address
For a read table, enter the address in the devices memory where the value to be stored in this tag is located. For a write table, enter the address in the devices memory to which the tag value will be written.
If no loop index variables have yet been specified, when used with the loop indexing feature, this field acts as a default address for the real-time database to write to at startup. DCP, LRDS, LRRC, LRST, and LSDB data types require you employ additional parameters to determine the Address field entry. For information about these parameters, see Additional Parameters for TI Data Types on page 552.
Valid Entry: 1 - 32767, 1 - 64 (use with TI 545 or TI 565 PLCs
with s-memory; see additional data types listed in the preceding table)
Loop Index
(Loop index variable used only with TI 545 or TI 565 PLCs having s-memory) Alphanumeric string representing a real-time database analog tag whose value determines the TI 545 or TI 565 loop tag. The system reads the PLC address specified in the Logical Station and Data Type fields and writes the returned data to the loop tag specified by the value of the loop index variable. The value of this loop index variable designates one of the tags specified in the Tag Name field. This entry must be the same as the loop index field entry in the initial Read/Write table that corresponds to the loop tag being referenced. For example, if referencing the loop tag LOOPNDX1 specified in the Tag Name field in the initial Read/Write table, enter LOOP1, which is the corresponding loop index variable specified in the Loop Index field in the initial Read/Write table. The loop index variable is valid only for s-memory data types such as loop variables and analog alarms. For valid s-memory data types, see the Data Type field description earlier in this section.
Valid Entry: NONE, LOOP1, LOOP2, LOOP3, LOOP4,
LOOP5, LOOP6, LOOP7, LOOP8, LOOP9, LOOP10, LOOP11, LOOP12, LOOP13, LOOP14, LOOP15, LOOP16, (default = NONE)
When all appropriate information is specified, the table resembles the following sample:
In this example, the value of LOOP1 designates which loop tag, defined in the Tag Name field, is to be read or written to. The system reads the PLC address specified in the Logical Station, Data Type, and Loop Index fields and writes the returned data to the appropriate loop tag. When FactoryLink initializes the database at startup, all tags' values are set to 0 and address 1 acts as a default loop tag number because the loop write tag's values have not yet been written. The protocol module reads or writes to address 1 only if the loop index variable is 0. This prevents a meaningless read of loop tag 0. When the table is complete, click the Save icon to validate the information.
A DDITIONAL P ARAMETERS
FOR
TI D ATA TYPES
To use certain TI data types, you must enter a value in the Address field of the Texas Instruments Read/Write information table containing a drum and a step number or a loop and a ramp number. The following is a list of TI data types requiring these special parameters: DCP LRDS LRRC LRST LSDB To determine the correct address field entry for each data type, follow the corresponding procedure. DCP 1 Determine which drum to use. For information about drums, refer to the Programming Instruction Manual for the appropriate TI PLC. 2 Convert the drum number to a two-digit hexadecimal value. 3 Determine which step to use. For information about steps, refer to the Programming Instruction Manual for the appropriate TI PLC. 4 Convert the step number to a two-digit hexadecimal value. 5 Append the converted drum and step numbers to create a four-digit hexadecimal value.
Note
In this four-digit number, the hexadecimal drum value must precede the step value. Example 1:drum 10 = 0A, step 11 = 0B = 0A0B Example 2:drum 2 = 02, step 1 = 01 = 0201
Convert this hexadecimal value to decimal. Example 1:0A0B = 2571 Example 2:0201 = 513 Enter the decimal value in the Address field. Example 1:Enter 2571 in the Address field in the Read/Write tables. Example 2:Enter 513 in the Address field in the Read/Write tables. LRDS, LRRC, LRST, and LSDB 1 Determine which loop to use. Use any of the loops configured in the Read/Write tables. 2 Convert the loop number to a two-digit hexadecimal value. 3 Determine which ramp to use. For information about ramps, refer to the Programming Instruction Manual for the appropriate TI PLC. 4 Convert the ramp number to a two-digit hexadecimal value. 5 Append the converted loop and ramp numbers to create a four-digit hexadecimal value.
Note
In this four-digit number, the hexadecimal loop value must precede the ramp value. Example 1: loop 1 = 0,1 ramp 1 = 00 = 0100 Example 2: loop 10 = 0A, ramp 11 = 0A = 0A0A 6 Convert this hexadecimal value to decimal. Example 1:0100 = 256 Example 2:0A0A = 2570
22 | TEXAS INSTRUMENTS TIWAY Computations for 5TI Sequencer Ladder Logic Code
Enter the decimal value in the Address field. Example 1:Enter 256 in the Address field in the Read/Write tables. Example 2:Enter 2570 in the Address field in the Read/Write tables.
C OMPUTATIONS
Note
FOR
This information was extracted from the 5TI2000 Programmer Operator's Manual. The 5TI Sequencer has a 16-bit word that represents the ladder logic code. In the 1010 series sequencer, 14 of these 16 bits are available for use, and in the 1020 series, 15 bits are available. The construction of the 16-bit word is described in Diagram A. The binary weights for each bit are described in Diagram B. Sample computations are given in Diagram C. Use the following steps to update the ladder logic in the 5TI Sequencer: 1 Define a FactoryLink analog tag in the Read/Write Information table. 2 Enter an L in the Data Type field of the Texas Instruments Read/Write Information table. 3 Enter the ladder logic program address in the Address field. 4 Compute the 16-bit word representing the ladder logic. 5 Write IML logic to store computation into the analog tag. 6 Use the tag type LEDS, opcode LEDSD, and display digits on the 5TI programmer to check the accuracy of the computation. Diagram A: Bit Layout for 16-bit Sequencer Word B15 B14 B13 <Tag Type> B11 B10 <Opcode> B9 B8 B7 B6 B5 B4 B3 B2 B1 B0 <-Digit Keys->
TEXAS INSTRUMENTS TIWAY | 22 Computations for 5TI Sequencer Ladder Logic Code
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1
0 0 0 0 1 1 0 0 1 1
0 0 0 1 0 1 0 1 0 1
0 1 1 0 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 0
1024 2048 3072 4096 8192 12288 16384 20480 24576 28672
Diagram C: Sample Computations STR CR, 511 STR CR 511 4096+3072 +511 =7679
ER:xxxN is a single-digit format in which one digit represents a single error condition. In some cases, two individual codes appear within a string to indicate multiple error conditions.
Double-Digit Code Format
ER:xxNN is a double-digit format in which two digits represent a single error condition.
Decoding ER Decode the ER: string by interpreting the least significant digit (LSD rightmost integer) and the most significant digit (MSD leftmost integer) of NN. Example:
err0043
4=
3=
If the MSD is less than eight, use Case 1 for decoding. If the MSD is eight or higher, use Case 2 for decoding.
Case 1: EDI Task or Protocol Module Errors The LSD of the xx in err 00xx identifies the error, and the MSD identifies its cause. Decode the err 00xx code according to the following guidelines:
MSD
Cause:
Action: Verify device configuration and cabling. Check that FactoryLink configuration tables contain the proper station addresses and template parameters. Check that the Texas Instruments Logical Station Control table contains the proper baud rate, parity, and data format parameters.
2
Cause:
Cause:
Buffer overflow.
Cause:
Cause:
Transmit error.
LSD
Cause:
Action: Use the action specified for the error code's MSD.
2
Cause:
Receiver error.
Action: Use the action specified for the error code's MSD.
3
Cause:
Receiver abort.
Action: Use the action specified for the error code's MSD.
4
Cause:
Action: Use the action specified for the error code's MSD.
5
Cause:
Action: Use the action specified for the error code's MSD.
6
Cause:
Action: Use the action specified for the error code's MSD.
7
Cause:
Action: Use the action specified for the error code's MSD.
err 0023 0 0 2 3
receiver abort (LSD) timeout error (MSD) This error indicates cabling problems, incorrect DIP switch settings, or other hardware-related problems. Case 2: TIWAY Serial Unilink Network or Point-to-Point TI PLC Errors Use the following error code for TIWAY Serial Unilink or Point-to-Point:
err 0009
Cause:
Action: Force-write a 0 to the port on/off tag defined to reopen the port. TIWAY Serial Unilink Network exception code errors are listed below. For more information about TIWAY errors, locate the TI code in the list below and refer to the TIWAY documentation.
81 (TIWAY code: 0001)
Cause:
Action: Consult page 6-1 in the TIWAY 1 UNILINK Host Adapter User's Manual.
82 (TIWAY code: 002)
Cause:
Cause:
Action: Reissue the command. Reset the Network Manager if the error continues.
84
(TIWAY code: 0006) Cause: The command cannot use secondary address 00. Action: Retransmit the command with the correct secondary address.
Cause:
Action: Reset the adapter with the NM function. Call the Texas Instruments Technical Services Hotline at (615) 461-2501 if the error continues.
86 (TIWAY code: 0009)
Cause:
Cause:
Cause:
Action: Adjust the maximum poll-time value. Refer to Chapter 5, command code 30, in the TIWAY documentation for information about adjusting this value.
89 (TIWAY code: 000E)
Cause:
Cause:
Cause:
Cause:
Cause:
Cause:
Cause:
Cause:
Action: Check the address in the command string and the addresses of the secondary devices. Then, issue a connect secondary command or enable a macro that was previously defined to connect that secondary.
91 (TIWAY code: 0089)
Cause:
Cause:
The char count field value does not match the received count.
Cause:
Cause:
Cause:
Action: Reset the Host Adapter and restart the protocol module.
96 (TIWAY code: 100C)
Cause:
Action: To gain enough memory for the secondary status information, de-allocate resources for a source ID. Refer the TIWAY documentation for information about de-allocating resources.
97 (TIWAY code: 100D)
Cause:
Action: To gain enough memory for the secondary status information, de-allocate resources for a source ID. Refer to the TIWAY documentation for information about de-allocating resources.
98 (TIWAY code: 100E)
Cause:
Cause:
Cause:
Action: Issue command code 30 to configure the network manager and command code 11 to configure the HIU.
AB (TIWAY code: 2003)
Cause:
Cause:
Cause:
Cause:
Cause:
For developer actions for each error, refer to the documentation for the appropriate Texas Instruments PLC.
B1
Cause:
Cause:
B4
Cause:
B5
Cause:
B6
Cause:
B7
Cause:
B8
Cause:
B9
Cause:
BA
Cause:
BB
Cause:
BC
Cause:
BD
Cause:
BE
Cause:
BF
Cause:
C0
Cause:
C1
Cause:
C2
Cause:
C3
Cause:
C4
Cause:
C5
Cause:
C6
Cause:
C7
Cause:
C8
Cause:
C9
Cause:
CA
Cause:
CB
Cause:
CC
Cause:
CD
Cause:
CE
Cause:
D1
Cause:
err 00B2 0 0 B 2
This error indicates that the address specified in the Read/Write table is out of range. Texas Instruments Message Strings Error messages generated by the EDI task, the protocol module, and all TI PLCs on the system can be written to a real-time database message tag for display as message strings on a developer-defined graphic screen. Locate the error code next to the message string to determine the cause and appropriate action for each message string. Then, use that code to see the Case 1 or Case 2 Errors in this chapter. Error message strings and their corresponding codes appear alphabetically in the following table.
Code Message String
B2 C6 8C 3 (MSD) 84 92 4 (MSD) 93 8B 91
Address out of range Attempted write to protected variable Bad command in string Buffer overflow Cannot use secondary address 00 Char count field doesn't match received count Checksum error on return data Checksum mismatch Clear to Send lost Colon (:) missing from start
Code
Message String
CD 8F AD 81 8E 8A BF C0 B6 B7 AE 95 98 AA AC D1 99 C5 BD BA B4 BE B9 86 94
Comm error in HOLD mode Command frame too short Command has option code twice Command timed out by HIU function Command too long for command code Data Carrier Detect lost Data not inserted Data not written Diagnostic fail upon power up Fatal error detected HIU already configured HIU not initialized HIU not initialized for bandwidth statistics HIU not yet configured for MHIU HIU of MHIU not configured I/O configuration error Illegal auto redundant mode command Illegal instruction in program mem Illegal number of ASCII characters received Illegal request in operational mode Illegal task code request Illegal write to program memory Incorrect amount of data with command Incorrect HDLC checksum Invalid character detected
Code
Message String
Invalid data returned Invalid data sent with command Invalid field with command Invalid op with NIM Local/Remote mode Keylock protect error Network was not deleted NM can't process secondary bits NM is not configured No response from Programmable Controller No response from special function module Not enough memory for another source ID Not enough memory for requested secondary PLC busy - cannot perform operation Port Lockout is active Receive DSF translate error Receive invalid read length Receiver abort Receiver CPT translation error Receiver error Req. memory < minimum defined value Req. memory is not mult. of block sz Req. memory > maximum defined value Request exceeds program memory size Requested data not found Requested memory size exceeds total memory
Code
Message String
Reset current transaction Secondary device not connected Secondary timed out in message Secondary/max poll timeout Store and forward buffer is busy Texas Instruments exception error ti__dsf dsf_read( ) error return - PORT CLOSED ti__dsf dsf_write ( ) error return - PORT CLOSED TIWAY 1 HDLC ERROR - RESET SECONDARY TIWAY 1 Ports RS232/Local Line mismatch Transmit error Turnaround error / timeout error Uneven # bytes from secondary Unknown error detected Write operation did not verify Wrong secondary address returned