UpTo

Description:

This method returns the number of bits specified. Two parameters are used, a count and a unit specifier. The latter may be any of:

"Bit" or "Bits" = 1-bit units

"Nibble" or "Nibbles" = 4-bit units

"Byte" or "Bytes" = 8-bit units

"Octet" or "Octets" = 8-bit units

"Word" or "Words" = 16-bit units

"Dword" or "Dwords" = 32-bit units (double words)

"Qword" or "Qwords" = 64-bit units (quad words)

The singular and plural forms are distinguished only for readability; for instance, the method will return 8 whether you write "(Fixed 1 Byte)" or "(Fixed 1 Bytes)". The units parameter is optional and, if omitted, will default to "Bytes".

This is the same as the "Fixed" method, except that if there are not enough bits remaining in the frame, the total number of bits remaining is used.

Parameters:

[Required]

Int

"Number (in units)"


[Optional]

List

"Units"

(Default value: Bytes)

List values:

Bit

Bits

Times

Nibble

Nibbles

Byte

Bytes

Octet

Octets

Word

Words

Dword

Dwords

Qword

Qwords

Example:

FIELD peek_self_contained (UpTo 4) IF (FieldIs EqualTo 1 is_first) (Hex) SUPPRESS_DETAIL NO_ MOVE