beautypg.com

2 field definitions, 1 defining a field at a specific offset, Field definitions – Teledyne LeCroy UWBTrainer Exerciser Script Language User Manual

Page 22: Defining a field at a specific offset, Fields_def

background image

LeCroy Corporation

UWBTrainer Exerciser - Generation Script Language Reference Manual

14

8.2 Field Definitions

You can define template fields using the following syntax:

Field_Name :

[

offset,

]

length

[

(Byte Order attribute)

]

[

= Field_Value

]

[

[ list of possible values ]

]

or

Field_Name

[

: length

]

{ Subfield definitions }

[

(Byte Order attribute)

[

= Field_Value

]

[

[ list of

possible values ]

]

Note

1

: Specify all field offsets and lengths in bits. Numeric expressions with declared constants

are allowed in field offset and length definitions. All field and subfield names must be unique
inside a template.

Note

2

: You can define local fields for packet variable instances, register condition instructions,

and when sending a frame. See sections “Changing Structure Parser Variables” and
“Send Frame Instruction” for more information.

8.2.1 Defining a Field at a Specific Offset

If the offset parameter is in a field definition, then the field is bound to a specific offset.

Examples

const

F3_OFFSET =

16

const

F3_LEN =

8

# Declare the frame template 'SomeTemplate.

Frame

SomeTemplate

{

F1 :

0

,

16

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

F2 :

64

,

32

# Declare the 32-bit field 'F2' at offset 64.

F3 :

F3_OFFSET,

F3_LEN

# Declare the 8-bit field 'F2' at offset 16.

F4 :

F3_OFFSET + F3_LEN,

16

# Declare the 16-bit field 'F4' at

# offset 16+8.

}