07.03.2014 Views

Introduction.

Introduction.

Introduction.

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.

Workshop PG5<br />

Resources<br />

3.2.2 Registers<br />

32 bit value<br />

Integer : -2 147 483 648 to +2 147 483 647<br />

Floating decimal : -9.22337E+18 to +9.22337E+18<br />

R<br />

NV<br />

0 4095<br />

A register can contain floating decimal or integer values. Registers are extremely<br />

useful for arithmetic operations or operations with analogue values like<br />

measurements and regulation tasks. You can have up to 4096 Registers. They<br />

are non volatile.<br />

In FUPLA, the lines connected to a register have different colors depending on<br />

their content. If they contain a floating decimal value the lines are yellow, if<br />

they contain an integer value, they are green. You can't interact an integer<br />

value, with a floating decimal values. For example you can't add the two together.<br />

One of the values has to be converted into the other’s value, and then<br />

added.<br />

How to use<br />

Registers in<br />

your program:<br />

The following example adds the number 113 to the content of register 12 and<br />

puts the result into register 54:<br />

R 54 = R 12 + 113<br />

Instruction list program:<br />

COB 0<br />

0<br />

ADD R 12<br />

113<br />

R 54<br />

FUPLA program:<br />

(FBox: Integer, ADD)<br />

Setup<br />

Registers:<br />

Dynamic resources allocation is a powerful feature introduced to free you from<br />

having to specify a fixed address for every resource that you need.<br />

Dynamic resources are used by defining a symbol name for a resource without<br />

specifying an address. You won’t need to change these settings until you start<br />

to write large programs with a large number of registers.<br />

You must increase the dynamic space settings in case of assembling errors like<br />

"Auto allocation overflow for type: R".<br />

© Saia-Burgess Controls Ltd. Page 3-5

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

Saved successfully!

Ooh no, something went wrong!