cvar

Purpose:

Create and initialize variables from the command line or from within a script.

The arguments vary, depending on the data type REAL variable.

Enter:

cvar REAL <label> <initial_value> <units> <resolution> <true event name> <false event name> <event_name>

Where:

label

Specify the variable label to be created.

initial_value

Specify the value to which the variable will be set when created. Valid values are:

TRUE
FALSE
ON
OFF
1
0

units

Specify a valid cyflex units string.

resolution

Specify the display resolution.

true_event_name

Optionally, specify the name of an event that will be set when the variable value transitions from FALSE to TRUE.

false_event_name

Optionally specify the name of an event that will be set when the variable value transitions from TRUE to FALSE.

event_name

Optionally specify a transition event name which will be set if the string value is changed.

Examples:

REAL variable Example: 
Enter: cvar REAL xyz 100 psi 2
The preceding creates a real variable named “xyz” and set the units to [psi] and the initial value to 100[psi] and the display resolution to 2 places.

INTEGER variable Example:  
Enter:  cvar INT  my_int 99  none 
The preceding creates an integer variable named “my_int” with an initial value of 99 and the units string of none.
     
LOGICAL variable Example:  
Enter:   cvar LOGI  pump  ON  pump-turned-on  pump-turned_off    
The preceding creates a logical variable named “pump” with initial_value ON, true_event_name “pump_turned_on”, and false_event_name “pump_turned_off”.
 
STRING variable Example:  
Enter: cvar STRING  my_name  ‘Joe Random’    
The preceding creates a string variable named “my_name” and sets the value to ‘Joe Random’.

Notes:

cvar disallows type changes of variables. A REAL that was created cannot be recreated as an INT type.

See Also: