VXI SM8000 Convert hexadecimal value to an integer, Divide by 100 to convert to dB value

Models: SM8000

1 74
Download 74 pages 4.14 Kb
Page 65
Image 65
Convert hexadecimal value to an integer

VXI Technology, Inc.

 

 

 

81h

 

 

 

 

 

 

Command Name

Query Attenuation

 

 

 

 

 

 

 

Command Format

81h

 

 

 

 

 

 

Description

The Query Attenuation command returns the current attenuation value as a 2-byte (16-

 

 

bit) value.

 

 

 

 

 

Example

The following example shows how to translate the HIGH_BYTE-LOW_BYTE

 

 

returned value into a dB attenuation value:

 

 

1.

0Dh & 6Fh = 0D6Fh

HIGH_BYTE and LOW_BYTE value to

 

 

 

 

hexadecimal value.

 

 

2.

0D6Fh = 3439

Convert hexadecimal value to an integer

 

 

 

 

decimal value.

 

 

3.

3439 / 100 = 34.39

Divide by 100 to convert to dB value.

 

 

 

 

 

 

 

 

82h

 

 

 

 

 

 

Command Name

Query Minimum Attenuation

 

 

 

 

 

 

 

Command Format

82h

 

 

 

 

 

 

Description

The Query Minimum Attenuation command returns the minimum attenuation setting

 

 

in a 2-byte (16-bit) format.

 

 

 

 

 

Example

The following example shows how to translate the HIGH_BYTE-LOW_BYTE

 

 

returned value into a dB attenuation value:

 

 

1.

0Dh & 6Fh = 0D6Fh

HIGH_BYTE and LOW_BYTE value to

 

 

 

 

hexadecimal value.

 

 

2.

0D6Fh = 3439

Convert hexadecimal value to an integer

 

 

 

 

decimal value.

 

 

3.

3439 / 100 = 34.39

Divide by 100 to convert to dB value.

 

 

 

 

 

SM8000 Series Programming

65

Page 65
Image 65
VXI SM8000 Convert hexadecimal value to an integer, Divide by 100 to convert to dB value, HIGHBYTE and LOWBYTE value to