Addressing-Flag Variables
A Flag is a pre-defined memory location that indicates the real time operation, state, and vital information of the XMC. These are designed to give the programmer quick access to important information and are extremely useful for ease of programming.
-
Each flag is defined with a descriptive tag name that begins with an underscore (“_”).
-
The tag name is aliased to a memory address located in the %F and %K area.
Category | Function |
---|---|
System | Common functions of the CPU:Run status, errors, clock, scan. |
Data Log | State and data for Data logging functionality. |
Memory Card | State and data for SD memory card. |
Encoder | Data for the built-in Encoder inputs. |
Motion Common | Common Status flags of the Motion controller. |
Motion Axis | Axis specific motion state and data. |
Motion Axis Group | Motion group state and data. |
EtherCAT Master | EtherCAT master motion state and data. |
EtherCAT Slave | EtherCAT slave motion state and data. |
NC Channel | NC Channel state and data. |
NC Ch/Axis | Displays the state of the axis configured for the NC Channel. |
System flags provide useful information for programming. Some helpful tags are highlighted below:
Provides high pulse for first half of time interval and low pulse for last half of time interval.
Provides ON/OFF or toggles by scan
Real Time Clock tags
Some of the System Flag Types can filter out specific entries. This is done by unchecking the All selection.
Step | Action |
---|---|
1 |
Right-click on the flag variable to be used. This example show _ENC1_POS. Select Copy from the menu.
|
2 |
Double-click on the LD code section to add the variable. This example show the IN parameter of a MOVE function.
|
3 |
Paste the copied flag variable. Press OK.
|
Step | Action |
---|---|
1 |
Left-click on the Black square and drag down to select multiple flag variables.
|
2 |
Right-click on the select flag variables. Select a Variable Monitor window to add them to. This example shows Variable Monitor 1.
|
LM102