Using CitectSCADA > Defining and Drawing Graphics Pages > Defining Commands and Controls > Using variable data input

Using variable data input

You can configure a keyboard command to accept variable data at run time. When the system is running, an operator can enter a value with the command, and the value is passed as an argument (or arguments) into the Cicode command. You can therefore define a single keyboard command that your operators use with different values. For example, you could define the following command to set the variable SP1 at run time:

Key Sequence

F3 ### Enter

Command

SP1 = Arg1;

In this example, an operator can set the variable SP1 to a new value by first pressing the F3 function key, entering the new value, and pressing the Enter key, for example:

sets the value of SP1 to 10.

Each `#' character (in the Key Sequence) represents one keyboard character that an operator can enter in the command. In the above example, the operator can enter up to three keyboard characters when issuing the command. (The number of # characters determines the maximum number of characters that an operator can enter for the argument; if the operator enters more than three characters, an "Invalid Command" alert message displays.)

The command in the above example could be issued as follows:

or

or

When the command is issued (the operator presses the Enter key), the value is passed to the command at Arg1.

Note: If an operator does not enter any data (i.e., the key sequence:

is used), the value of Arg1 is zero, and the variable is set to zero. To prevent this from happening, use the ArgValue1 label, for example:

Command SP1 = ArgValue1;

The ArgValue1 label checks for illegal input; if the input is invalid, the value of the variable is not changed. You can also use the StrToValue() function.

Be aware that the ArgValue1 label and the StrToValue() function halts the command. Any instructions following either the ArgValue1 label or the StrToValue() function do not execute.

See Also