L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual
Page 514
L-force | PLC Designer
Operands in PLC Designer
512
DMS 3.2 EN 02/2011 TD29
Declaration in POU:
VAR
x:stru1;
END_VAR
Bitaccess:
x.enable:=true;
This will set TRUE the 42. bit in variable x. Since bvar has 8 bits and rvar has 32 bits,
the bitaccess will be done on the second bit of variable wvar, which as a result will get
value 4.
Stop!
If a variable, which does a bitaccess on a structure variable with the aid of a global
constant, should be displayed correctly in the input assistant, at monitoring in the
declaration window and in the intellisense function. please use pragma {bitaccess}
which is shown in the example. Then in addition you get displayed the global
constant beyond the respective structure variable during monitoring in the
declaration window: