12.05.2014 Views

Automating Manufacturing Systems - Process Control and ...

Automating Manufacturing Systems - Process Control and ...

Automating Manufacturing Systems - Process Control and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

plc basic functions - 15.4<br />

A<br />

MOV<br />

Source F8:07<br />

Destination F8:23<br />

B<br />

MOV<br />

Source F8:07<br />

Destination N7:23<br />

C<br />

MOV<br />

Source 123<br />

Destination N7:23<br />

NOTE: when a function changes a value, except for inputs <strong>and</strong> outputs, the value is<br />

changed immediately. Consider Figure 15.2, if A, B <strong>and</strong> C are all true, then the<br />

value in F8:23 will change before the next instruction starts. This is different than<br />

the input <strong>and</strong> output scans that only happen before <strong>and</strong> after the logic scan.<br />

Figure 15.2<br />

Examples of the MOV Function<br />

A more complex example of move functions is given in Figure 15.3. When A<br />

becomes true the first move statement will move the value of 130 into N7:0. And, the second<br />

move statement will move the value of -9385 from N7:1 to N7:2. (Note: The number<br />

is shown as negative because we are using 2s compliment.) For the simple MOVs the<br />

binary values are not needed, but for the MVM statement the binary values are essential.<br />

The statement moves the binary bits from N7:3 to N7:5, but only those bits that are also on<br />

in the mask N7:4, other bits in the destination will be left untouched. Notice that the first<br />

bit N7:5/0 is true in the destination address before <strong>and</strong> after, but it is not true in the mask.<br />

The MVM function is very useful for applications where individual binary bits are to be<br />

manipulated, but they are less useful when dealing with actual number values.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!