18 global numeric and structure variables, Global numeric and structure variables – Teledyne LeCroy UWBTrainer Exerciser Script Language User Manual
Page 101

LeCroy Corporation
UWBTrainer Exerciser - Generation Script Language Reference Manual
93
10.18 Global Numeric and Structure Variables
You can declare global numeric and structure variables that can be used in different generation
procedures during parsing. Such global variables can be changed in one generation procedure,
and then the changes are used in other generation procedures.
Example
Const
MY_CONST =
77
x =
0xAA
# Declare global numeric variable 'x'.
y =
0x12
# Declare global numeric variable 'y'.
z = MY_CONST
# Declare global numeric variable 'z'.
# Declare a global structure variable 'Z' based on the template
# 'TX_FRAME'.
TX_FRAME $Z
# Declare a global structure variable 'Y' based on the template
# 'TX_FRAME'and change the default template field values.
TX_FRAME $Y
{
DestAddr =
0xAABB
}
# Another way to declare global structure variables:
# Declare the global structure variable 'Z' based on the template
#'TX_FRAME'
$Z = TX_FRAME
# Declare the global structure variable 'Y' based on the template
# 'TX_FRAME' and change the default template field values.
$Y = TX_FRAME
{
DestAddr =
0xAABB
}
Main
{
Send $Z
# Send a frame based on the global structure variable Z.
Send SOME_PKT_TEMPLATE
{
Field0 = y
# Use the global numeric variable 'y' to change the
# default template field values.
}
}
For more examples of using global variables, see the examples for the CALL directive.