The text of a manual · part 23 of 27
ControlLogix Digital I/O Modules User Manual: ControlLogix Digital I/O Modules User Manual, pages 221 to 230
Pages 221 to 230 of 258, from ControlLogix Digital I/O Modules User Manual
The original document is the PDF (7.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 1756-OB16E
Page 221
Use Ladder Logic To Perform Run Time Services and Reconfiguration
Appendix C
Enter Message Configuration After creating a tag, you must enter certain parameters for the message configuration. This information is entered on the Configuration and Communication tabs of the Message Configuration dialog box. The Message Configuration dialog box is accessed by clicking the box with the ellipses (in the Message Control field).
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017
221
Page 222
Appendix C
Use Ladder Logic To Perform Run Time Services and Reconfiguration
Configuration Tab The Configuration tab provides information on what module service to perform and where to perform it.
Table 65 explains the relationship of the fields in the above dialog boxes. For example, despite different entry fields, both screen examples are configured to send a message to reset an electronic fuse (module service) on Channel 0 of a 1756-OA8D module (where to perform the service). Table 65 - Relationship of Message Configuration Parameters Parameter
Description
Service Type
Defines the type of module service to be performed. For example, a reset. Note: In version 10.07.00 or later, you can use a pull-down menu to choose the Service Type. The application defaults the Service Code, Instance, Class, and Attribute parameters based on the Service Type that you choose. All values are in Hex.
Class
Object that you are sending a message to, such as the device object or a discrete output point.
Instance
Each object can have multiple instances. For example, a discrete output can have 16 points or instances of where a message can be sent. This specifies the instance.
Attribute
Further identifies the exact address for the message. An analog input can have multiple alarms so this attribute acknowledges a specific alarm and not the other alarms. If an attribute is not specified (default to 0) the Service applies to all attributes of the Class/Instance.
Table 66 lists tags used in the Source and Destination fields of the message instructions. Table 66 - Source and Destination Field Tags Source Tag
Description
Enable_32_Points DINT
Parameter used to determine which points are enabled for the service. That is, if bit 0 = 1 for Reset Fuse, then point 0 has its electronic fuse reset.
Results_32_Points DINT
Pass (0)/ Fail (1) result for the service. That is, if bit 0 = 1 for the results of the Reset Fuse, then the Reset Fuse failed for point 0.
Choose the physical location, slot number, and data type in the Source Element and Destination fields.
222
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017
Page 223
Use Ladder Logic To Perform Run Time Services and Reconfiguration
Appendix C
Communication Tab The Communication tab provides information on the path of the message instruction. For example, the slot number of a 1756-OA8D module distinguishes exactly which module a message is designated for. IMPORTANT
Use the Browse button to see a list of the I/O modules in the system. You choose a path when you choose a module from the list. You must name an I/O module during initial module configuration to choose a path for your message instruction. Click OK to set the path.
S
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017
223
Page 224
Appendix C
Use Ladder Logic To Perform Run Time Services and Reconfiguration
Use Timestamped Inputs and Scheduled Outputs for Standard and Diagnostic I/O Modules This section demonstrates the use of timestamped inputs and scheduled outputs for standard and diagnostic digital I/O modules. The Change of State timestamp can be used to synchronize the output turning On or Off based on the time that the input transitions. The program can be extended to include synchronizing multiple output modules by sending the same timestamp to all output modules. In the illustration below, the output follows the state of input 0, but it is delayed by exactly 10 ms. The advantage of using CST over timers is that the synchronization is performed at the I/O module, which eliminates any jitter due to controller or communication delays. Your control becomes much more deterministic even under changing loads. For this synchronization to work properly, the 10 ms delay must be long enough to account for any controller, backplane, and network delays. The input and output modules must reside in the same rack as a Time Master (controller). Timestamp units are microseconds. The following illustrations show the ladder instructions the program uses. The rungs perform these tasks: • Rungs 0 and 1 detect the transition from Program to Run mode. This is used to turn On ‘init’, which causes the program to initialize its tags. • Rung 2 only executes once and initializes the LastTimestamp. LastTimestamp is used to detect a Change of State on the input point by checking to see if the timestamp of the input data has changed.
224
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017
Page 225
Use Ladder Logic To Perform Run Time Services and Reconfiguration
Appendix C
• Rung 3 is the main rung that checks for Change of State on the input point by comparing the current input timestamp (Time_at_which_Input_Changed) with the last timestamp (LastTimestamp).
The input point (point 0) must have Change of State enabled or the timestamp does not update when the point transitions. Once Change of State has been detected, 10 ms is added to the input timestamp and sent to the output module's timestamp. This causes the output module to apply its output exactly 10 ms (10,000 µs) after the input changed state. The MOVe instructions update LastTimestamp in preparation for the next change of state. IMPORTANT
Timestamps are eight bytes in size, two DINTS, but only the lower four bytes of the output timestamp (Time_at_which_Ouput_Will_Change) are used to schedule the outputs into the future (to a max of 16.7 s or 16,700,000 μs).
• Rung 4 is the standard XIC-OTE rung that controls the output point based on the input point.
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017
225
Page 226
Appendix C
Use Ladder Logic To Perform Run Time Services and Reconfiguration
The only difference is the output module is configured for scheduled outputs. The outputs are not applied until the scheduled time has occurred. The Controller Tags dialog box shows examples of the tags created in ladder logic.
Use Timestamped Inputs and Scheduled Outputs for Fast I/O Modules This section demonstrates the use of timestamped inputs and scheduled outputs for fast digital I/O modules. The Change of State timestamp can be used to synchronize the output turning On or Off based on the time that the input transitions. The program can be extended to include synchronizing multiple output modules by sending the same timestamp to all output modules. In the example on page 227, the output follows the state of input 0, but it is delayed by the amount of time in the Delay tag. The advantage of using CIP Sync over timers is that the synchronization is performed at the I/O module, which eliminates any jitter due to controller or communication delays. Your control becomes much more deterministic even under changing loads. For this synchronization to work properly, the value in the Delay tag must be long enough to account for any controller, backplane, and network delays.
226
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017
Page 227
Use Ladder Logic To Perform Run Time Services and Reconfiguration
Appendix C
In this example, the controller, input, and output modules all reside in the same chassis, but they can reside in separate chassis as long as they are all part of the same synchronized CIP Sync system. Time-stamp units are microseconds. IMPORTANT
Unlike standard and diagnostic I/O modules that use CST for timestamps, fast I/O modules use CIP Sync timestamps, which are a full 64 bits in width. Manipulation of CIP Sync time values requires the use of 64-bit math. The following example uses 64-bit Add-on Instructions contained in the LINT (64-bit signed 2's complement integer) Math Library at http://samplecode.rockwellautomation.com.
The following illustrations show the ladder instructions the program uses. The rungs perform these tasks: • Rungs 0 and 1 capture the rising or falling timestamps for input 0 of a 1756-IB16IF module. • Rung 2 executes only once at the transition from Program to Run mode. It initializes LastInputTimestamp, which is used to detect a change of state on the input point by checking to see if the timestamp of the input data has changed. This rung also clears the output module’s TimestampOffset bit to disable its Time Step Compensation algorithm.
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017
227
Page 228
Appendix C
Use Ladder Logic To Perform Run Time Services and Reconfiguration
• Rung 3 is the main rung that checks for a change of state on the input point by comparing the current input timestamp with the last timestamp (LastInputTimestamp).
The input point (point 0) must have Change of State enabled. Otherwise, the timestamp does not update when the point transitions. Once Change of State has been detected, the value in the Delay tag is added to the input timestamp and sent to the output module's timestamp using a COP instruction. This causes the output module to apply its output at a time equal to the time that the input changed state plus the Delay time. The final COP instruction updates LastInputTimestamp in preparation for the next change of state. • Rung 4 is the standard XIC-OTE rung that controls the output point based on the input point. The only difference is that the output module is configured for scheduled outputs. The outputs are not applied until the scheduled time has occurred.
228
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017
Page 229
Use Ladder Logic To Perform Run Time Services and Reconfiguration
Appendix C
The Controller Tags dialog box shows examples of the tags created in ladder logic.
Reset a Fuse, Perform Pulse Test, and Reset Latched Diagnostics This ladder logic program shows how to use ladder logic to reset an electronic fuse for a faulted point, perform a pulse test, and to reset latched diagnostics.
Click the box in each rung to see the associated configuration and communication.
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017
229
Page 230
Appendix C
Use Ladder Logic To Perform Run Time Services and Reconfiguration
The rungs perform these functions: • Rungs 0 and 1 are used to perform a reset fuse service on Bits 0 and 1, respectively. The example is of a 1756-OA8D module in slot 4. • Rung 2 performs a pulse test service to slot 4. • Rung 3 moves the results of the pulse test to a data storage location. (The actual results appear in the message instruction tags under the tag name EXERR). • Rung 4 performs a reset latched diagnostics service to slot 4. This example shows an output module. The Controller Tags dialog box shows examples of the tags created in the ladder logic, as displayed in the tag editor.
Perform a WHO to Retrieve Module Identification and Status This ladder logic example shows how to retrieve module identification and status through a WHO service. In this application, a message instruction retrieves this module identification information: • Product type • Product code • Major revision • Minor revision • Status • Vendor • Serial number • String length • ASCII string
230
Rockwell Automation Publication 1756-UM058I-EN-P - December 2017