Lenze PLC Designer PLC Designer (R2-x) Uživatelský manuál Strana 512

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 844
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 511
L-force | PLC Designer
Operands in PLC Designer
510 DMS 3.2 EN 02/2011 TD29
10.2.3 Addressing bits in variables
In integer variables individual bits can be accessed. For this, the index of the bit to be
addressed is appended to the variable, separated by a dot. The bit-index can be given
by any constant. Indexing is 0-based.
Note!
Bitaccess in Direct variables is not allowed.
Example:
a : INT;
b : BOOL;
...
a.2 := b;
The third bit of the variable a will be set to the value of the variable b.
If the index is greater than the bit width of the variable, the following error message is
issued: Index '<n>' outside the valid range for variable '<var>'!
Bit addressing is possible with the following variable types: SINT, INT, DINT, USINT,
UINT, UDINT, BYTE, WORD, DWORD.
If the variable type does not allow it, the following error message is issued: "Invalid
data type '<type>' for direct indexing"
A bit access must not be assigned to a VAR_IN_OUT variable!
Bitaccess via a global constant:
If you have declared a global constant, which defines the bit-index, you can use this
constant for a bitaccess.
Note!
The project option 'Replace constants' (category Build) must be activated !
Zobrazit stránku 511
1 2 ... 507 508 509 510 511 512 513 514 515 516 517 ... 843 844

Komentáře k této Příručce

Žádné komentáře