06.08.2013 Views

Technical Manual TNC 360 - heidenhain - DR. JOHANNES ...

Technical Manual TNC 360 - heidenhain - DR. JOHANNES ...

Technical Manual TNC 360 - heidenhain - DR. JOHANNES ...

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.

3.5 Comparisons<br />

3.5.1 EQUAL TO (==) ==<br />

Abbreviation for the PLC Editor: == (EQUAL)<br />

Byte/Word/Double Constant<br />

Execution time [µs] 1.8 to 2.4 2.0<br />

Number of bytes 6 8<br />

Operands: B, W, D, K<br />

Operation:<br />

With this command, a direct transfer from Word to Logic processing occurs. The contents of the<br />

Word Accumulator and the contents of the addressed operand are compared. If the Word<br />

Accumulator and the operand are equal, the condition is true and the Logic Accumulator is set to 1.<br />

If they are not equal the Logic Accumulator is set to 0. The comparison takes place over the number<br />

of bits corresponding to the operand, i.e. B = 8 bit, W = 16 bit and D = K = 32 bit.<br />

Example:<br />

A constant is to be compared with the contents of Doubleword D8. The result is then assigned to<br />

Marker M500.<br />

Initial state: Constant = 16 000<br />

Doubleword D8 = 15 000<br />

The Accumulator and operand contents are shown in decimal notation. The 10 bit wide Accumulator<br />

allows the entry of the highest possible Accumulator contents (2 147 483 647).<br />

Line Instruction Accumulator Contents Operand Contents<br />

x x x x x x x x x x<br />

1 L K16000 1 6 0 0 0<br />

Bit 31 . . . 7 0<br />

2 == D8 ... x x x x x x 0 x x x x x x x 1 5 0 0 0<br />

3 = M500 ... x x x x x x 0 x x x x x x x 0<br />

Line 1: The constant is loaded into the Accumulator.<br />

Line 2: The contents of the Accumulator and the Doubleword D8 are compared<br />

( Accumulator = Operand ? ).<br />

As the condition is not fulfilled the Logic Accumulator is set to 0.<br />

Line 3: The contents of the Logic Accumulator (The result of the comparison) are<br />

assigned to Marker M500.<br />

8/95 <strong>TNC</strong> <strong>360</strong> 3 Commands 7-63

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

Saved successfully!

Ooh no, something went wrong!