VXI SM8000 Convert decimal step number to hexadecimal, Convert to HIGHBYTE and LOWBYTE format

Models: SM8000

1 74
Download 74 pages 4.14 Kb
Page 62
Image 62
Convert decimal step number to hexadecimal.

 

 

 

 

VXI Technology, Inc.

 

 

 

30h

 

 

 

 

 

 

Command Name

Move to Absolute Step

 

 

 

 

 

 

 

Command Format

30h HIGH_BYTE LOW_BYTE

 

 

 

 

 

Description

The Move to Absolute Step command sets the position of the stepper motor. The valid

 

 

range is 0 - 3200, written in a 2-byte (16-bit) format.

 

 

 

 

Example

The following example converts a integer decimal step to a HIGH_BYTE-LOW_BYTE

 

 

format:

 

Convert decimal step number to hexadecimal.

 

 

1.

2485 = 0B1Dh

 

 

2.

HIGH_BYTE = 0Bh

Convert to HIGH_BYTE and LOW_BYTE format.

 

 

 

LOW_BYTE = 1Dh

 

 

 

 

 

 

 

 

 

31h

 

 

 

 

 

 

Command Name

Query Current Step

 

 

 

 

 

 

 

Command Format

31h

 

 

 

 

 

 

Description

The Query Current Step command returns the current location of the stepper motor as

 

 

a 2-byte (16-bit) value.

 

 

 

 

 

Example

The following example shows how to translate the HIGH_BYTE-LOW_BYTE

 

 

returned value into a integer decimal step number:

 

 

1.

0Bh & 1Dh = 0B1Dh

HIGH_BYTE and LOW_BYTE value to

 

 

 

 

hexadecimal value.

 

 

2.

0B1Dh = 2845

Convert hexadecimal value to an integer decimal

 

 

 

 

value.

62

SM8000 Series Programming

Page 62
Image 62
VXI SM8000 Convert decimal step number to hexadecimal, Convert to HIGHBYTE and LOWBYTE format, hexadecimal value