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 memory - 14.8<br />

indirect - another memory location can be used in the description of a location.<br />

I:000/[N7:2] -If N7:2 location contains 5 this will become I:000/05<br />

I:[N7:1]/03 -If the integer memory location contains 2 this will become I:002/03<br />

#I:[N7:1] -If the integer memory location contains 2 the file will start at I:002<br />

N[N7:0]:8 - If the number in N7:0 is 10 the data address becomes N10:8<br />

Figure 14.9<br />

Indirect Addressing<br />

Expressions allow addresses <strong>and</strong> functions to be typed in <strong>and</strong> interpreted when the<br />

program is run. The example in Figure 14.10 will get a floating point number from file 8,<br />

location 3, perform a sine transformation, <strong>and</strong> then add 1.3. The text string is not interpreted<br />

until the PLC is running, <strong>and</strong> if there is an error, it may not occur until the program<br />

is running - so use this function cautiously.<br />

expression - a text string that describes a complex operation.<br />

“sin(F8:3) + 1.3” - a simple calculation<br />

Figure 14.10<br />

Expression Data Values<br />

These data types <strong>and</strong> addressing modes will be discussed more as applicable functions<br />

are presented later in this chapter <strong>and</strong> book. Floating point numbers, expressions <strong>and</strong><br />

indirect addressing may not be available on older or lower cost PLCs.<br />

Figure 14.11 shows a simple example ladder logic with functions. The basic operation<br />

is such that while input A is true the functions will be performed. The first statement<br />

will move (MOV) the literal value of 130 into integer memory N7:0. The next move function<br />

will copy the value from N7:0 to N7:1. The third statement will add integers value in<br />

N7:0 <strong>and</strong> N7:1 <strong>and</strong> store the results in N7:2.

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

Saved successfully!

Ooh no, something went wrong!