Binary access to variables of type Byte, Int, Word etc.

Question:

How can Bit information be read e. g. from a Word variable or be assigned to a Boolean variable?

Answer:

In DDS versions > 2.0 variables e. g. of Word type can be read in all programming languages or be assigned by Boolean values.

Example for ST:
  • wVariable1: WORD;
  • bVariable2 : BOOL;
  • bVariable3 : BOOL;

bVariable2  :=  wVariable1.4;  (Bit information of the Word variable are read and assigned to a binary variable.)

wVariable1.6  := bVariable3;   (The value of the binary variable is assigned to Bit 6 of the Word variable.)

URL for linking this AKB article: https://www.lenze.com/en-de/go/akb/20030182/1/
Formulario de contacto