Scan cycle

Ashwin

Member
Join Date
Mar 2003
Location
Columbia, MO
Posts
62
I am trying to move a value from one integer file to another in the same rung.How will it get transfered.

Assume, a pushbutton starts the cycle..and a particular integer value is shifted from one integer file 1 to 2 and from there to 3 and 3 to 1. all of this is done in the same rung. how will the integers get passed and will the value be transfered back to one in same scan cycle.
 
Scan anyone?

What ever your program contains will be operated on and completed in one scan cycle. Now, whether your program is bogus or not, now that is another story. The best way to answer your question is to just do it. Hey that sounds like a good tag line for a commercial.
 
Assume, a pushbutton starts the cycle..and a particular integer value is shifted from one integer file 1 to 2 and from there to 3 and 3 to 1. all of this is done in the same rung. how will the integers get passed and will the value be transfered back to one in same scan cycle.



Was +----------+ +----------+ +----------+ Was
PB PB | MoveWord | | MoveWord | | MoveWord | PB
--| |---|/|---+fm: file-1+----+fm: file-2+----+fm: file-3+---( )
|to: file-2| |to: file-3| |to: file-1|
+----------+ +----------+ +----------+


.

Use the appropriate parameters as required by your PLC.

All done in one rung and one scan.

The "--|/|-- Was PB" prevents multiple operations of the rung. It will happen only once until you release and push the button again.
 
but...

OK maybe i should perform it practically and see...when i look at the registers..i wont be able to see the change in the intermediate registers isnt it for it should all happen in milliseconds.isnt it.
 
If the above example is the only place in the program where the data files are used, then I agree with how the data will be updated.

But be careful if the program has some type of interrupt routine or a seperate file that runs independent of the main ladder scan. It IS possible for the program to get interrupted somewhere in between those file moves and have different data written to one of the files. Not all PLC's are created equal!

One usually takes steps to make sure that if data is passed back and forth between independent routines, that some form of interlock is provided so that only one routine has control of the file until all of the data has been updated. In some PLC's (G&L comes to mind) it is possible to experience problems because the interrupt can occur in the middle of the move instruction i.e. if an integer is being updated from a value of 255 to 256 (0FFh to 100h) and the interrupt occurs in the middle of the copy instruction, the interrupt file would 'see' a value of 1FFh since the big end gets changed before the little end.
 


Was +----------+ +----------+ +----------+ Was
PB PB | MoveWord | | MoveWord | | MoveWord | PB
--| |---|/|---+fm: file-1+----+fm: file-2+----+fm: file-3+---( )
|to: file-2| |to: file-3| |to: file-1|
+----------+ +----------+ +----------+




.
If you were to preload the word in File-1 with "1", File-2 with "2", and File-3 with "3", then pushed the button, you would find that all of the words are then equal to "1".

You won't be able to see it happen, but the "1's" are proof that it did happened.


Randy said...
What ever your program contains will be operated on and completed in one scan cycle.

There are some instructions that don't complete in the given scan. This is more common among the matrix-type instructions.

Depending on the specific instruction and the size of the matrix, it might take up to 16 scans to complete the instruction.
 
Last edited:

Similar Topics

I think I understand how the scan cycle of a ladder program is done. But if you create a section of code that uses Structured Text how would that...
Replies
8
Views
4,128
When using AB PLC's during the scan cycle instructions are scanned top to bottoma nd left to right correct? How does this work with instructions...
Replies
7
Views
3,129
Hi all, I probably have some short questions for you. I'm trying to understand timers and the Siemens operating system in more detail...
Replies
9
Views
12,333
Back
Top Bottom