12.4.1         @

Description:   Returns contents of a tag. Works only with ACTION commands.  Mostly commonly used to pass the value of a tag to another command.  @ is similar to GETVAL.

Syntax:

Tcl:              ACTION Command @tagname

JScript:         ACTION Command("@tagname");

VB Script:      ACTION Command "@tagname"

Argument:     tagname

Returns:        Value of an analog, digital or text IO tag, Constant Point Tag, Calculation Tag, Accumulation Tag, local Screen Tag or Daq Tag.

See Also:        GETVAL

The @ is a shortcut for GETVAL used with ACTION commands only. (Hint - If the command selected from the script dialog box is in CAPITALS, then @ will work.)  

The @ does not work with tcl, JScript or VB Script keywords alone (i.e. built-in tcl commands like expr). The @ must be combined with an ACTION command if used with a tcl, JScript or VB Script.  (Hint - If the command selected from the script dialog box is in lower-case, you must use [GETVAL ].)

Examples:     

# tcl

LOGACT @Textag1

SETVAL AO101=@AO102

SETVAL {tag1=%ROTATEPLUS @speed}

 

// JScript

LOGACT("@Textag1");

SETVAL("AO101=@AO102");

 

Rem VB Script

LOGACT "@Textag1"

SETVAL "AO101=@AO102"

See 12.10.1 Transfer the value of a tag to another tag

      12.10.5 Perform math on Tags

 

Note about math (use GETVAL not @):

If you are using math, then you will have to use GETVAL instead of @, because @ can't be interpreted by Tcl, JScript or VB Script.  The math is part of the script language. For example to Set a tag to 1/2 the value of another:

# tcl

SETVAL AO101=[expr [GETVAL AO102] * 0.5]

 

// JScript

var value1

value1 = GETVAL("AO102") * 0.5;

SETVAL("AO101=" + value1);

 

Rem VB Script

Dim value1

value1 = GETVAL("AO102") * 0.5

SETVAL "AO101=" & value1