CreateVar
Hint: This command can be used in a FOR loop.
Syntax:
CreateVar <name> <type>
Arguments:
name : name of the variable - see notes
type : data type (can be a function block to create an instance)
|
This function is used for declaring a variable, or for adding an item to a data structure. The name of the variable must be prefixed with its group name and the '.' separator. The variable is considered as GLOBAL if no prefix is specified. Some examples are attached below. |
Examples:
|
|
|
Argument |
Description |
|
VarName |
A global variable. |
|
RETAIN.VarName |
A RETAIN variable. |
|
ProgName.LocVarName |
A variable local to a program. |
|
UDFBName.ParamName |
A parameter of a UDFB. |
|
StructName.Item |
An item of a data structure. |
|
|
|
|
CreateInParam - Create an input parameter CreateOutParam - Create an output parameter DimVar - Set variables dimensions DeleteVar - Delete a variable InitVar - Set variable initial value SybVar - Specifies whether the symbol of a variable must be embedded ProfileVar - Set variable profile and embedded properties EnumVar - Enumerate variables GetVar - Get information about a variable GetVarProp - Get variable embedded properties
Managing program folders Managing data types (structures)
|
|
CreateVar |
IEC 61131-3 Automation platform > IEC 61131-3 Programming Environment > Tools > The console > Managing variables > CreateVar |
Created with the Personal Edition of HelpNDoc: How to Protect Your PDFs with Encryption and Passwords