24.01.2015 Views

PLC Programming

  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Bitstring Operators...<br />

LD ivar1<br />

MOVE ivar2<br />

ST ivar2 (* result: var2 erhält Wert von var1 *)<br />

( ! you get the same result with:<br />

LD ivar1<br />

ST ivar2 )<br />

Example in ST:<br />

ivar2 := MOVE(ivar1);<br />

( ! you get the same result with: ivar2 := ivar1; )<br />

INDEXOF<br />

This function is not prescribed by the standard IEC61131-3.<br />

Perform this function to find the internal index for a POU.<br />

Example in ST:<br />

var1 := INDEXOF(POU2);<br />

SIZEOF<br />

This function is not prescribed by the standard IEC61131-3.<br />

Perform this function to determine the number of bytes required by the given data type.<br />

Example in IL:<br />

arr1:ARRAY[0..4] OF INT;<br />

Var1<br />

LD<br />

SIZEOF<br />

INT<br />

arr1<br />

ST Var 1 (* Result is 10 *)<br />

Example in ST:<br />

var1 := SIZEOF(arr1);<br />

10.2 Bitstring Operators...<br />

AND<br />

Bitwise AND of bit operands. The operands should be of the type BOOL, BYTE, WORD or DWORD.<br />

Example in IL:<br />

Var1 BYTE<br />

LD 2#1001_0011<br />

AND 2#1000_1010<br />

ST Var 1 (* Result is 2#1000_0010 *)<br />

Example in ST:<br />

10-4 CoDeSys V2.3

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

Saved successfully!

Ooh no, something went wrong!