beautypg.com

6 data pattern declarations, 1 constants and data patterns in declarations, 2 leading zeroes – Teledyne LeCroy UWBTrainer Exerciser Script Language User Manual

Page 14: Data pattern declarations, Constants and data patterns in declarations, Leading zeroes, Datapattern in, 6data pattern declarations

background image

LeCroy Corporation

UWBTrainer Exerciser - Generation Script Language Reference Manual

6

6

Data Pattern Declarations

Data pattern declarations declare named byte strings to use where you use byte vectors. Data
pattern declaration starts with the DataPattern keyword.

DataPattern

Pattern_Name = {

hex_stream

}

Example

# Declare a data pattern containing the byte string:

# AA BB CC DD DD EE FF 11 22 33 44 55

DataPattern

PATTERN_1 = {

AA BB CC DD EE FF 11 22 33 44 55

}

6.1 Constants and Data Patterns in Declarations

You can use constants and previously defined data patterns in data pattern declarations. Place
constants and data patterns inside a

[]

block. (You can omit a

[]

block for constant insertion,

but for code clarity it is recommended that you use a

[]

block.)

Note: When inserting constants into a data pattern, the script parser uses only the least
significant byte of the constant. For example, if constant 0xAABBCCDD is inserted, only the
0xDD is put into the data pattern.

Examples

Const

MY_CONST =

0xCC

Const

"MY CONST" =

0xDD

# Declare a data pattern containing the byte string:

# AA AA BB BB CC CC DD DD

DataPattern

PATTERN_1 = {

AA AA BB BB

[MY_CONST]

CC DD

["MY CONST"] }

# Declare a data pattern containing the byte string:

# 11 AA AA BB BB CC CC DD DD 88

DataPattern

PATTERN_2 = {

11

[ PATTERN_1 ]

88

}

6.2 Leading Zeroes

For bytes less than 0x10, it is not necessary to add a leading 0.

Example

DataPattern

PATTERN_4 = {

B B 6 B B

}

# Is the same as 0B 0B 06 0B 0B.