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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

plc st - 19.5<br />

Text Program Line<br />

VAR AT %B3:0 : WORD; END_VAR<br />

VAR AT %N7:0 : INT; END_VAR<br />

VAR RETAIN AT %O:000 : WORD ; END_VAR<br />

VAR_GLOBAL A AT %I:000/00 : BOOL ; END_VAR<br />

VAR_GLOBAL A AT %N7:0 : INT ; END_VAR<br />

VAR A AT %F8:0 : ARRAY [0..14] OF REAL; END_VAR<br />

VAR A : BOOL; END_VAR<br />

VAR A, B, C : INT ; END_VAR<br />

VAR A : STRING[10] ; END_VAR<br />

VAR A : ARRAY[1..5,1..6,1..7] OF INT; END_VAR<br />

VAR RETAIN RTBT A : ARRAY[1..5,1..6] OF INT;<br />

END_VAR<br />

VAR A : B; END_VAR<br />

VAR CONSTANT A : REAL := 5.12345 ; END_VAR<br />

VAR A AT %N7:0 : INT := 55; END_VAR<br />

VAR A : ARRAY[1..5] OF INT := [5(3)]; END_VAR<br />

VAR A : STRING[10] := ‘test’; END_VAR<br />

VAR A : ARRAY[0..2] OF BOOL := [1,0,1]; END_VAR<br />

VAR A : ARRAY[0..1,1..5] OF INT := [5(1),5(2)];<br />

END_VAR<br />

Description<br />

a word in bit memory<br />

an integer in integer memory<br />

makes output bits retentive<br />

variable ‘A’ as input bit<br />

variable ‘A’ as an integer<br />

an array ‘A’ of 15 real values<br />

a boolean variable ‘A’<br />

integers variables ‘A’, ‘B’, ‘C’<br />

a string ‘A’ of length 10<br />

a 5x6x7 array ‘A’ of integers<br />

a 5x6 array of integers, filled<br />

with zeros after power off<br />

‘A’ is data type ‘B’<br />

a constant value ‘A’<br />

‘A’ starts with 55<br />

‘A’ starts with 3 in all 5 spots<br />

‘A’ contains ‘test’ initially<br />

an array of bits<br />

an array of integers filled with 1<br />

for [0,x] <strong>and</strong> 2 for [1,x]<br />

Figure 19.5<br />

Variable Declaration Examples<br />

• Basic numbers are shown below. Note the underline ‘_’ can be ignored, it can be<br />

used to break up long numbers, ie. 10_000 = 10000.

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

Saved successfully!

Ooh no, something went wrong!