====== Command:RDSBYTE (RB) ======
--> MS2000 or RM2000 syntax ^
^Shortcut |RB |
^Format |RDSBYTE [axis] = [status_byte]… |
<--
--> Tiger syntax ^
^Shortcut |RB |
^Format |RDSBYTE [axis] = [status_byte]… |
^Type |Axis-Specific |
<--
Requests the TG-1000 and MS-2000 to respond with the ''Status Byte'' (see definition below). Similar to [[commands:rdstat|RDSTAT]] but returns the raw byte.
**Note:** If you don't see the serial response, it may be because the reply is in raw bytes, see the [[#python_helper_script|Python script]] below for an example of how to parse the data. Or use the [[commands:rdstat|RDSTAT]] command without any modifier, which returns the same byte in decimal form.
== Status Byte Format ==
''76543210'' -> bit position (''0'' is ''LSB'') \\
''00001010'' -> bit pattern for hex ''0x0A'', decimal ''10'' \\
''MSB::LSB'' -> most significant bit - least significant bit
The number is one byte, which can be broken down into 8 bits that represent the following internal flags:
^Bit 0|0 = No commanded move is in progress. \\ 1 = A commanded move is in progress. \\ This bit is synonymous with the ''STATUS'' command. If the bit is set, then ''STATUS'' returns ''B'', otherwise ''STATUS'' returns ''N''.|
^Bit 1|0 = The axis is disabled. \\ 1 = The axis is enabled. \\ Axes can be re-enabled using one of the following: \\ High Level command ''MC +'', cycles the clutch switch for the Z-axis, Low Level Start Motor command (hex 47), or a system reset.\\ |
^Bit 2|0 = Motor is inactive (off) \\ 1 = Motor is active (on).|
^Bit 3|0 = Joystick/Knob disabled \\ 1 = Joystick/Knob enabled |
^Bit 4|0 = Motor not ramping \\ 1 = Motor ramping |
^Bit 5|0 = Ramping down \\ 1 = Ramping up |
^Bit 6|Upper Limit Switch: \\ 0 = Open \\ 1 = Closed |
^Bit 7|Lower Limit Switch: \\ 0 = Open \\ 1 = Closed |
== Reply ==
: in the examples below
<0x3A><0x0D><0x0A> as raw bytes
The reply should be read as raw bytes, a common pattern for the ''Status Byte'' is ''0x0A'', which is '''' when interpreted as ASCII. There is a Python script at the bottom of this page as an example.
The total length of the reply will be the number of axes sent in the command plus 3. \\
For example ''RB X Y Z'' will reply with 6 bytes.
The response '':<0x0A><0x0A>'' below is ''[58, 10, 10, 13, 10]'' in raw bytes. \\
''58 = ':', 13 = '\r', 10 = '\n''' are always a part of the response.
== MS-2000 Example ==
$ RB X
:<0x8A>
$ RB X Y
:<0x8A><0x0A>
$ RB X Y Z
:<0x8A><0x0A><0x0A>
== TG-1000 Example ==
$ 1RB X Y
:<0x8A><0x0A>
\\ The X-axis example value of ''0x8A'' means the following: \\
''Bit7: 1'' - X Axis is at its lower limit \\
''Bit6: 0'' - X Axis upper limit switch open \\
''Bit5: 0'' - Ramping down, if ramping \\
''Bit4: 0'' - Motor not ramping \\
''Bit3: 1'' - Joystick/Knob is enabled \\
''Bit2: 0'' - Motor power is off \\
''Bit1: 1'' - X Axis is enabled \\
''Bit0: 0'' - No commanded move is in progress \\
**Note:** Motor power can be on while a commanded move is not in progress and the stage appears not to be moving. This happens when the motor is either making a final adjustment to a commanded move or when it is applying a force to maintain the stage position.
=== Python Helper Script ===
{{section>:python_code#status_byte&noheader&nofooter}}
{{tag>commands tiger ms2000}}