374 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 8 Array (File)/Misc. Instructions (FAL, FSC, COP, CPS, FLL, AVE, SRT, STD, SIZE)
Example 3: The project_data array (100 elements) stores a variety of values that change at
different times in the application. To send a complete image of project_data at one
instance in time to another controller, the CPS instruction copies project_data to
produced_array.
· While the CPS instruction copies the data, no I/O updates or other tasks
can change the data.
· The produced_array tag produces the data on a ControlNet network for
consumption by other controllers.
· To use the same image of data (that is, a synchronized copy of the data), the
consuming controller (s) uses a CPS instruction to copy the data from the
consumed tag to another tag for use in the application.
Relay Ladder
Structured Text
CPS(project_data[0],produced_array[0],100);
Example 4: Local:0:I.Data stores the input data for the DeviceNet network that is connected
to the 1756-DNB module in slot 0. To synchronize the inputs with the
application, the CPS instruction copies the input data to input_buffer.
· While the CPS instruction copies the data, no I/O updates can change the
data.
· As the application executes, it uses for its inputs the input data in
input_buffer.
Relay Ladder
Structured Text
CPS(Local:0:I.Data[0],input_buffer[0],20);
Example 5: This example initializes an array of timer structures. When enabled, the MOV
instructions initialize the .PRE and .ACC values of the first array_timer element.