Question about PLC instructions

Can input X1 change while the sequence of commands is still being processed?

eg.

LD X1
AND X2
OUT Y1

LD X1 // Can X1 loaded here differ from the previous one?
AND X3
OUT Y1

thank

+5
source share
4 answers

A common method is to copy I / O registers to an internal memory address so that the programmer can be sure that his IO will not change between instructions. Paste the copies at the beginning of the scan and copy them to the outputs at the end of the scan.

+1
source

Many, but not all, PLCs work with I / O images. Inputs are read and stored in registers. During processing, you are working with an I / O image. The image is updated at the end of the cycle. Thus, during processing, the inputs cannot change, but only between cycles.

+7

Jim C, , (?) "" , //​​/etc ( IO), . IO, , CPU , "" .

:

//Start of Program
// Here the CPU scan starts with X1 closed, X2 closed in the IO image    

LD X1  //(X1 = closed)
AND X2 //(X2 = closed)
OUT Y1  //(Y1 will be set high/closed)

//  **suddenly X1 opens**
//(using LDI here to denote "immediate")

LDI X1 //(open - reading true status)
AND X2 //(closed)
OUT Y1  //(Y1 will now open)

LD X1 //(reading from image = closed, still)
AND X2 //(closed)
OUT Y1 //(Y1 will close again)

END of Program

(X1 = ), Y1 .

, , , , . , , . , -, .

ps: "LDI" , , . , Koyos STR () LD STRI ( ).

+3

Yes, of course, this is possible - probably changing this parameter in this interval will be very low, therefore, if you have an error in which you suggested that these two values ​​will never differ, this may not be displayed for a while.

0
source

All Articles