SLC500 COP instruction & scan

tborycki

Member
Join Date
Nov 2009
Location
Calgary, AB
Posts
2
Hi all,
I'm trying to understand what, if any, break/delay in the logic scan occurs when using a COP instruction in a SLC500 program.

I have the following instructions executing in my logic (in sequential rungs):

COP #M1:23.0 #N96:0 100
COP #M1:23.60 #N7:170 1

(Reading data from a Prosoft MVI46-MNET module, but I'm assuming this is not important to the question at hand)

Later on in the logic (same scan), I check to see if N96:60 is equal to N7:170. Occasionally they are not the same. The data I am reading back in the M1:23 file does change occasionally as modbus commands execute, but I would have thought that since the COP instructions are occurring immediately after one another the data would always be the same unless some external logic is overwriting it (which does not appear to be happening).

So, the heart of my question: Do COP instructions execute completely (i.e. all source registers copied to the destination registers) before the next rung is executed, or does it run independantly of logic scan?

Thanks,
Trevor
 
It is my understanding that a reference to an 'M' location causes a direct access of that location in the target module each and every time the instruction is run. (The execution time hit, I understand, is also the reason that they are discouraged.) So I can see a change happening in the interval between the instructions.

And to answer you actual question, I believe the COP commands execute completely each invocation. But as there is a time interval between them, no matter how small, the 'M' data can change. Your second execution causes a seperate access of the module for that specific 'M' location.
 
Last edited:
Greetings Trevor ...

and welcome to the forum ...

So, the heart of my question: Do COP instructions execute completely (i.e. all source registers copied to the destination registers) before the next rung is executed, ...

the answer is Yes, the entire length of the COP is "copied" before the next rung is executed ...

but ... that's probably NOT really the "heart of your question" ...

the real question here is: "Could the Prosoft MVI46-MNET module be changing the data which is stored in M1:23.60 partway through the ladder scan?" ...

and more specifically, could the Prosoft module be changing the data stored in that M-file BETWEEN your two COP instructions? ...

I have ZERO experience with the module you're using, but I'd bet serious money that it IS capable of changing the data in that buffer – at ANY point in your ladder scan ...

the only other reasonable cause of what you're reporting is that SOMETHING ELSE is affecting (changing) the values stored in either N96:60 and/or N7:170 ... that "something" could be an instruction in your program – or maybe a signal from an HMI, etc. ...

PS Edit ... I see that my distinguished colleague Bernie Carlton and I are on the same track ...

the screen shot below is taken from an interesting paragraph on page E-24 in the SLC Instruction Set Reference Manual ...

http://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1747-rm001_-en-p.pdf

you might find some useful ideas on solving your problem in that chapter ...

M0M1.JPG
 
Last edited:
So, the heart of my question: Do COP instructions execute completely (i.e. all source registers copied to the destination registers) before the next rung is executed, or does it run independantly of logic scan?
A far as I can tell yes, but I don't think that is the right question. The real question is can Prosoft MVI46-MNET module update the M memory within a scan and the answer is yes again.
 
To illustrate the time hit I mentioned compare these times (taken from an older manual that actually had these times) for a COP of 100 locations. Locally (N file to N file) it would take about 220 microseconds. Coming from a M file pushes it to about 2300 microseconds.
 
PLC skills

Hello guys,
What is your suggestion, what is best way to learn and understand one system which contains some PLC, touch panels, motors....Are we first have to learn basic function or what this system have to do and how do it or first study a lot about components (generally) for specific manufacturer or some books or maybe all things by little.
In heart of question is, I need some advice, how I could improve my PLC skills, I know best way is would be some training program but here in Serbia offers is very poor and very expensive.
Yes, I know miracle is not possible over the night, good advice and suggestions from the people which are have huge experience sometime haven’t price, any links or book or good story how you acquiring your PLC knowledge.
Thanks in advice
 

Similar Topics

can the slc500 5/05 send a email and text over Ethernet ?
Replies
3
Views
149
Hello, did anybody know, if there exist an converting cable like the1492-CM1746-M01 (for an 1746-IB16 to an 5069-IB16), for an 1746-HSCE to an...
Replies
3
Views
358
Customer is buying several spare 504 CPU's to have one handy when there's an issue with the ones in operation. Having them on the shelf for years...
Replies
15
Views
2,759
You have to go offline to create the 'Trend' but do you have to download the program to go back Online with the Trend ?
Replies
0
Views
324
Ex If I Read from Integer file N7:0 N7:0 is an 8 point input card , input 0 and 2 are on , rest off When I look at : N7:0 -7 6 5 4 3 2 1 0 I...
Replies
5
Views
704
Back
Top Bottom