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.14<br />

copy an array of 10 values starting at N7:50 to N7:40.TheFAL function will perform<br />

mathematical operations using an expression string, <strong>and</strong> the FSC function will allow two<br />

arrays to be compared using an expression. The FLL function will fill a block of memory<br />

with a single value.<br />

A<br />

COP<br />

Source #N7:50<br />

Dest #N7:40<br />

Length 10<br />

COP(start value,destination,length) - copies a block of values<br />

FAL(control,length,mode,destination,expression) - will perform basic math<br />

operations to multiple values.<br />

FSC(control,length,mode,expression) - will do a comparison to multiple values<br />

FLL(value,destination,length) - copies a single value to a block of memory<br />

Figure 15.13<br />

Block Operation Functions<br />

Figure 15.14 shows an example of the FAL function with different addressing<br />

modes. The first FAL function will do the following calculations N7:5=N7:0+5,<br />

N7:6=N7:1+5, N7:7=N7:2+5, N8:7=N7:3+5, N7:9=N7:4+5. The second FAL statement<br />

does not have a file ’#’ sign in front of the expression value, so the calculations will be<br />

N7:5=N7:0+5, N7:6=N7:0+5, N7:7=N7:0+5, N8:7=N7:0+5, N7:9=N7:0+5.Witha<br />

mode of 2 the instruction will do two of the calculations when there is a positive edge<br />

from B (i.e., a transition from false to true). The result of the last FAL statement will be<br />

N7:5=N7:0+5, N7:5=N7:1+5, N7:5=N7:2+5, N7:5=N7:3+5, N7:5=N7:4+5.Thelast<br />

operation would seem to be useless, but notice that the mode is incremental. This mode<br />

will do one calculation for each positive transition of C.Theall mode will perform all five<br />

calculations in a single scan whenever there is a positive edge on the input. It is also possible<br />

to put in a number that will indicate the number of calculations per scan. The calculation<br />

time can be long for large arrays <strong>and</strong> trying to do all of the calculations in one scan<br />

may lead to a watchdog time-out fault.

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

Saved successfully!

Ooh no, something went wrong!