beautypg.com

4 defining a default field value, Defining a default field value – Teledyne LeCroy Voyager Exerciser Generation Script Language Manual User Manual

Page 44

background image

Teledyne LeCroy

Voyager USB 3.0 Exerciser Generation Script Language Reference Manual

35

8.2.4 Defining a Default Field Value

When defining a field, you can specify a default field value. If the default value is not provided, the
field is filled with zeros based on the field length.

Note: When a value is assigned to a variable length field, the field's length is changed based on

the difference between the previous and current values. In this case, the offsets of following fields
not bound to fixed offsets are shifted by the difference.

Example

const

F3_OFFSET =

64

const

F3_LEN =

8

# Declare the packet template 'SomeTemplate.

Packet

SomeTemplate

{
F1 :

16

# Declare the 16-bit field 'F1' at offset 0.

F2 :

32

=

123456

# Declare the 32-bit field 'F2' with default

# value 123456.

F3 :

* =

{

AA BB

}

# Declare a variable length field and assign

# hex value {AA BB} to it.

# Now its length is 16 bits.

}