Using the User Data Type in Global/Direct Variables
| Step | Action |
|---|---|
| 1 | Open your project that contains the User Data Type. |
| 2 |
Open the Global/Direct Variable window.
|
| 3 |
In the blank line for adding a Global Variable, select the Variable kind of your variable.
Variable Kinds:
|
| 4 |
Give the global variable a name in the Variable column.
|
| 5 |
Select the User Data type for the variable in the Type column.
|
| 6 |
To setup initial values of the elements of the User Data Type, double-click on the space in the Initial Value column. A window will open to allow you to set initial values for the elements of the User Data Type. Note: This step is optional.
|
| 7 |
Check the Retain box if the variable should store its value on power cycle of the PLC. Note: This step is optional.
|
| 8 |
Add a comment to provide a description of the variable.
|
| 9 |
Use your variable in your code. ‘variable_name.element_name’ is the method for using elements of the User Data Type.
|
LM124-2