2 local structure parser variables, Local structure parser variables – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual
Page 103

Teledyne LeCroy
Voyager USB 3.0 Exerciser Generation Script Language Reference Manual
94
10.2 Local Structure Parser Variables
You can declare a local "structure" parser variable, which is seen only inside the generation
procedure, and use it in a Send Packet instruction and field assignments.
Format
[ Local
]
$var = template_or_var_name
[ Local
]
$var = $variable_name
Note: The Local keyword is required if you already have a global variable with the same name.
Using this keyword explicitly instructs the script parser to declare a local variable with the same
name.
Example
Main
{
# Declare a variable X as a packet of type MY_TX_PACKET.
$X = MY_TX_PACKET
# Note: Packet variables can be declared/redeclared and
# used many times.
# Declare a variable Y and change the default packet.
$Y = MY_TX_PACKET
# Template field values
{
DevAddr =
0x10
Endp =
2
}
# Declare a variable Z using the packet variable Y as a prototype.
$Z = Y
{
DevAddr =
0x10
Endp =
2
}
Local
$Z = Y
# Explicitly declare a local variable.
# Declare a structure variable having the same name as one of the
# templates.
$MY_TX_PACKET = MY_TX_PACKET
{
DevAddr =
0x10
Endp =
2
}