Professional Documents
Culture Documents
Implicit Address
Implicit Address
Online display of implicitly addressed variables and handling in the Logic Analyzer..............6
i
Implicit addressing of ANY_BIT variables
This feature is an IEC extension and allows to access specific parts of an already declared variable
of the data type ANY_BIT by implicit addressing. Since ANY_BIT variables could be compared to
"bit structures", it is possible to access (read or write) only one specific Bit, Byte or Word of the
variable (depending on the length of the accessed variable).
Implicit addressing is easily done by entering the variable name followed by a suffix specifying the
part of the bit structure to be read or written. (In principle this is similar to the access of array
elements.)
Example
Let us assume, you have a variable named 'MyVar' of the data type DWORD. The DWORD data
type consists of two words or four bytes or 32 bits. If you want for example access bit 7 of the
DWORD, you have to address this specific bit by the string 'MyVar.X6' (suffix '.X6' addresses bit 7).
To access the first Byte, enter 'MyVar.B0' and to address the second word use 'MyVar.W1'
accordingly.
The following table shows which suffixes have to be used to access the specific parts of a variable
that is of data type DWORD. The same way the parts of the other data types WORD, BYTE or
BOOL have to be addressed.
Word MyVar.W0, '.W0' addresses the least significant word and '.W1' the
MyVar.W1 most significant word of the variable 'MyVar'.
Byte MyVar.B0, '.B0' addresses the least significant byte and '.B3' the most
MyVar.B1, ..., significant byte of the variable 'MyVar'.
MyVar.B3
Bit MyVar.X0, '.X0' addresses the least significant bit and '.X31' the most
MyVar.X1, ..., significant bit of the variable 'MyVar'.
MyVar.X31
Implicit addressing is independent of the used PLC type, i.e. it doesn't matter whether the byte
order is Little Endian or Big Endian. In both cases always the correct part of a variable is accessed.
Implicit addressing can be used in the graphical editor as well as in the text editor and is therefore
available in all IEC programming languages. Even online display and the use in the Logic Analyzer
are supported.
1
Implicit addressing in graphical worksheets
Implicit addressing, i.e. accessing a specific part of a variable of the data type ANY_BIT, is done in
graphical worksheets using the properties dialog of the variable or contact/coil. Here, the variable
name followed by the suffix specifying the component of the data type to be accessed has to be
entered in the format 'VarName.Component' (for example 'VarName.X0', addresses the first bit of
the variable 'VarName').
Information about the suffixes used to access the individual components of the ANY_BIT data type
is available in the topic Implicit addressing of ANY_BIT variables.
The following procedures, which describe how to access a specific part of a variable in graphical
worksheets, assume that you have an already declared variable named 'MyWordVar' of the data
type WORD. The declaration of this variable is represented as follows in the variables grid
worksheet:
• In the list box 'Name' you can select all variables with the matching data type including the
suitable ANY_BIT variables for implicit addressing.
Select the variable as usual.
• Press the <.> key to open the IntelliSense list box and then select the desired part of the
bit structure (alternatively you can of course type in the bit suffix, e.g. 'X2', 'B1', 'W0').
In our example we implicitly address the third bit of the bit structure, i.e. the name
'MyWordVar.X2' has to be entered.
2
Implicit addressing for LD objects
When inserting a variable for a contact or coil, it is possible to assign one bit of a DWORD, WORD
or BYTE variable to the LD object:
• In the list box 'Name' you can now select not only Boolean variables but also all declared
ANY_BIT variables.
Select the variable as usual.
• Press the <.> key to open the IntelliSense list box and then select the desired Bit
(alternatively you can of course type in the bit suffix, e.g. 'X2' ).
3
Implicit addressing for LD objects
4
Implicit addressing in textual worksheets
Implicit addressing, i.e. accessing a specific part of a variable of the data type ANY_BIT, is done in
textual worksheets either using the properties dialog of the variable or by typing the component to
be accessed. The variable name followed by the suffix specifying the component of the data type to
be accessed has to be entered in the format 'VarName.Component' (for example 'VarName.X0',
addresses the first bit of the variable 'VarName').
Information about the suffixes used to access the individual components of the ANY_BIT data type
is available in the topic Implicit addressing of ANY_BIT variables.
The following procedure, which describes how to access a specific part of a variable in textual
worksheets, assumes that you have an already declared variable named 'MyWordVar' of the data
type WORD. The declaration of this variable is represented as follows in the variables grid
worksheet:
• Press the <.> key to open the IntelliSense list box and then select the desired part of the
bit structure (alternatively you can of course key in the bit suffix, e.g. 'X2', 'B1', 'W0').
In our example we implicitly address the first byte of the WORD variable, i.e. the name
'MyWordVar.B0' has to be entered.
You can of course directly type the variable name followed by the <.> key and the desired part of
the bit structure into the textual worksheet. Also in this case the IntelliSense list box appears when
you type the <.> key as shown in the following figure.
5
Online display of implicitly addressed variables and
handling in the Logic Analyzer
Online display of implicitly addressed variables
In online mode, the value of an implicitly addressed Bit, Byte or Word of the ANY_BIT variable is
displayed.
Example: If you have addressed the first bit of the variable 'MyWordVar' (data type WORD) using
the access name 'MyWordVar.X0', the value of the bit is displayed in online mode but not the online
value of the Word.
Implicitly addressed variables used to access a specific Bit, Byte or Word of the ANY_BIT variable
can be inserted from textual or graphical worksheets into the Logic Analyzer in the usual way, i.e.
by switching the system to online mode, displaying the Logic Analyzer window and selecting the
context menu item 'Add to Logic Analyzer' of the variable concerning.