RSL5k Synchronous File Copy finished

SSartain

Member
Join Date
Sep 2016
Location
Jasper, TN
Posts
3
How can you ensure that a Synchronous File Copy instruction has completed before you execute another Synchronous File Copy instruction on the destination data?
 
To the best of my knowledge a CPS instruction won't allow anything else to happen until it is complete. That includes interruption from other tasks. So by exclusion you couldn't possibly have two CPS instructions operating on the same data simultaneously.

Keith
 
Thank
I suspected that was the case but it is critical in my application the a subset of data be written to a structured tag(file) before the whole tag(file) is copied. I wish I could figure a way to test it besides just seeing if it glitches in the field.
 
The CPS instruction causes confusion for a lot of people and probably results in it being overused because its purpose is misunderstood. The instruction help in RSLogix5000 is actually pretty good at explaining the differences and when you should use CPS over COP.

In general, instructions in the same program execute one at a time in a specific order. So if you have 2 CPS instructions in the same program, the first one will always execute to completion before the second one starts. The same is true for a COP instruction. The difference for the CPS instruction is that once it starts executing, interrupts are disabled. This is useful if the source or destination data is I/O data and a partial write may cause the data to be misinterpreted by the receiver. Therefore, you mainly need CPS if the source or destination is I/O data, produce/consume data, or data that a task with a higher priority can also write to. To clarify, the reason I/O data and produce/consume data carry this risk is that they are inherently updated asynchronously to the program execution. If you buffer your I/O, this is probably not an issue.

For most tasks, a regular COP will work just fine. So what's wrong with always using CPS just to be safe? It's the "disables interrupts" part. For instance, if you have a task that needs a very stable time base (PID loops) and you give it a period of 100ms and a priority of 1 so that nothing will interrupt it. You may think that your task should execute perfectly. However, if your program uses CPS heavily, it can cause jitter in the execution time of your priority 1 task by delaying its start time.
 
Last edited:
Thank
I suspected that was the case but it is critical in my application the a subset of data be written to a structured tag(file) before the whole tag(file) is copied. I wish I could figure a way to test it besides just seeing if it glitches in the field.

The only way you should have trouble with this is if the two operations are happening in two different tasks. If that is the case, and you are concerned that you only copy data after the entire record has been written, use a "complete" flag at the end of the record. Test for the flag before you copy and reset the flag after the copy.
 

Similar Topics

Hey All. Weird Issue today. Never before have I had trouble with this particular PLC in the 3 years its been here. Regularly online with it. I...
Replies
4
Views
1,384
hey all. probably an easy one for you. just downloaded 525 drive firmware v 5.01. As I am sure I have done before. Control flash gives me the...
Replies
7
Views
2,450
I just bought Logix5k for the first time this past week, and downloaded a couple versions. I spoke to Rockwell support and they said that for me...
Replies
12
Views
3,470
I am using RSL5K Ver 28.12. Right now having grace period of license for the RSK5K Studio. Trying to add Armor Guard I/O Module 1732ES-IB12OBV2 in...
Replies
5
Views
2,944
Does anyone know if there is a "GOOD" reason why we are not allowed to deleted an unscheduled program online. I can delete it offline (don't know...
Replies
5
Views
1,866
Back
Top Bottom