beautypg.com

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

Page 25

background image

LeCroy Corporation

UWBTrainer Exerciser - Generation Script Language Reference Manual

17

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,
then the field is filled with zeros based on the field length.

Note: When a value is assigned to a variable length field, then 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 frame template 'SomeTemplate.

Frame

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.

}