T-Series/Compilation/Commands for T-JOY
From ZaberWiki
Warning: This is an "include" page. As such, its contents may be included in multiple other pages. To see a list of all pages that include this page, click on "What links here" in the bottom left navbar. If you make changes to this page, be sure that your changes are appropriate to all pages on which this content will be included. You are also encouraged to review our Zaber Wiki Editing Guidelines. This header will not be included in other pages.
[edit] Detailed Command Reference
[edit] Reset - Cmd 0
| Instruction Name | Reset |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 0 |
| Command Type | Command |
| Command Data | Ignored |
| Reply Data | None |
| Persistence | n/a |
| Summary | Sets the device to its power-up condition. |
This has the same effect as unplugging and restarting the device.
[edit] Special Note
All non-volatile settings (i.e. Device Number, Joystick Calibration, etc.) are saved and are not affected by reset or power-down.
[edit] Renumber - Cmd 2
| Instruction Name | Renumber |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 2 |
| Command Type | Command |
| Command Data | New Number |
| Reply Data | Device Id |
| Persistence | Non-Volatile |
| Summary | Assigns new numbers to all the devices in the order in which they are connected. |
If sent to device number 0, the command data is ignored and all devices will renumber. The device closest to the computer becomes device number 1. The next device becomes number 2 and so forth. If sent to a device number other than 0, then specified device will reassign itself the device number in the command data. Renumbering takes about 1/2 a second during which time the computer must not send any further data. The device number is stored in non-volatile memory so you can renumber once and not worry about issuing the renumber instruction again after each power-up.
[edit] Set Active Axis - Cmd 25
| Instruction Name | Set Active Axis |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 25 |
| Command Type | Setting |
| Command Data | Axis |
| Reply Data | Axis |
| Persistence | Non-Volatile |
| Summary | Sets the active axis. |
Valid Axis values are:
- 1 - Axis 1
- 2 - Axis 2
- 3 - Axis 3
Subsequent changes to any axis settings will apply only to the active axis. Axis settings for the active axis can be changed with the following instructions:
- Set Axis Device Number (Command #26)
- Set Axis Inversion (Command #27)
- Set Axis Velocity Profile (Command #28)
- Set Axis Velocity Scale (Command #29)
The three axes on the joystick are defined as follows:
- On axis 1, left is negative and right is positive.
- On axis 2, down is negative and up is positive.
- On axis 3, counter-clockwise is negative and clockwise is positive.
For example, to set the maximum velocity of axis number 2, first issue the Set Active Axis (#25) command with data of 2 to make axis number 2 the active axis. Then issue the Set Axis Velocity Scale (#29) command using the desired maximum velocity as data. Subsequent “Set Axis…” commands will also apply to the axis number 2 until the user sets a different axis to be the active axis. The joystick’s current active axis can be returned by issuing the Return Setting (#53) command, with data of 25.
The active axis affects the behavior of commands 26 through 29. This setting is stored in non-volatile memory and will persist after power-down or reset.
[edit] Set Axis Device Number - Cmd 26
| Instruction Name | Set Axis Device Number |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 26 |
| Command Type | Setting |
| Command Data | Device Number |
| Reply Data | Device Number |
| Persistence | Non-Volatile |
| Summary | Sets the device number to be controlled using the active axis. |
For example, suppose you would like to assemble a 3-axis system where:
- Joystick axis 1 (right / left) controls device #3.
- Joystick axis 2 (up / down) controls device #4, but with the motion inverted.
- Joystick axis 3 (clockwise / counterclockwise) controls device #2.
First, connect the joystick and the three additional T-Series devices (we have shown three T-LS devices below) in a daisy-chain as follows:
Issue the Renumber (#2) command from the computer. After renumbering (less than 1 second) the joystick will become device #1, and the remaining devices will become devices #2, #3, and #4. Now commands may be issued to the joystick to set the desired behavior. The command sequence is as follows:
| Device | Command | Data | Explanation of command |
| 0 | 2 | 0 | Renumber. After connecting the daisy chain as shown above, issue this command to all devices. Each device should reply. The T-JOY3 will be device #1, and subsequent devices will be #2, #3 and #4. |
| 1 | 25 | 1 | Set axis number 1 to be the active axis. Subsequent “Set Axis…” commands will apply to the active axis. |
| 1 | 26 | 3 | Set the active axis (#1) to control device #3. |
| 1 | 25 | 2 | Set axis number 2 to be the active axis. |
| 1 | 26 | 4 | Set the active axis (#2) to control device #4. |
| 1 | 27 | -1 | Set the active axis (#2) to be inverted. Forward will become the negative direction, and backward will become the positive direction. |
| 1 | 25 | 3 | Set axis number 3 to be the active axis. |
| 1 | 26 | 2 | Set the current axis (#3) to control device #2. |
Note: This setting affects only the active axis. See the Set Active Axis (#25) command for instruction on how to select an axis. This setting is stored in non-volatile memory and will persist after power-down or reset. Valid command data numbers are between 0 and 254; Byte 3 is the device number.
Command #36, may be used to restore factory default settings. The factory default settings for axis control are as follows:
- Axis #1 controls Device #2
- Axis #2 controls Device #3
- Axis #3 controls Device #4
[edit] Set Axis Inversion - Cmd 27
| Instruction Name | Set Axis Inversion |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 27 |
| Command Type | Setting |
| Command Data | Invert Status |
| Reply Data | Invert Status |
| Persistence | Non-Volatile |
| Summary | Inverts the active joystick axis. |
Sometimes it is desirable to invert one or more axes to create a more intuitive user interface. The Set Axis Inversion (#27) command allows the user to set the invert status of the active axis. Use Invert Status = 1 to set the current axis to non-inverted, use Invert Status = -1 to set the current axis to inverted. Use Invert Status = 0 to toggle between invert and non-invert (the Invert Status of the reply will still be either 1 or -1).
See the Set Active Axis (#25) instruction for information on how to select an axis. Each axis can be inverted independently of the other two axis. See command #26 for an example of how to invert a particular axis.
Here are the default directions for each axis (not inverted):
- On axis 1, left is negative and right is positive.
- On axis 2, down is negative and up is positive.
- On axis 3, counter-clockwise is negative and clockwise is positive.
What constitutes positive or negative motion depends on the device; see the user’s manual for the device in question. The default axis inversion setting for all joystick axes is non-inverted.
[edit] Set Axis Velocity Profile - Cmd 28
| Instruction Name | Set Axis Velocity Profile |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 28 |
| Command Type | Setting |
| Command Data | Profile Number |
| Reply Data | Profile Number |
| Persistence | Non-Volatile |
| Summary | Sets the relationship between the angle of the active joystick axis and the velocity of the device. |
When the joystick is displaced from the neutral position, the T-JOY3 reads the angular position and calculates how fast and in which direction the corresponding devices should be instructed to move. There are three different velocity profile numbers that can be requested:
- 1 – Linear
- 2 – Squared (factory default)
- 3 – Cubed
The maximum velocity is set by the Set Axis Velocity Scale (#29) command. Squared and cubed curves offer finer control at slow speeds, but still allow maximum velocity when the joystick is fully deflected.
[edit] Set Axis Velocity Scale - Cmd 29
| Instruction Name | Set Axis Velocity Scale |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 29 |
| Command Type | Setting |
| Command Data | Maximum Velocity |
| Reply Data | Maximum Velocity |
| Persistence | Non-Volatile |
| Summary | Sets the velocity scale of the active axis. |
The data represents the desired maximum velocity corresponding to full displacement of the joystick. When the joystick is moved away from the neutral position, the displacement is translated into Move At Constant Velocity instruction which is sent to the device associated with the displaced axis. See the user’s manual for the device in question for more information on the Move At Constant Velocity instruction.
The velocity scale setting works in conjunction with the velocity profile setting. See the Set Axis Velocity Profile (#28) command for more detail.
Setting the velocity scale to 0, will disable the active axis. This prevents the joystick from sending any instructions in response to displacement of that axis. This is useful when the user wants to execute a program from the computer, and does not want the joystick to be accidentally moved.
The default velocity scale for all three axes is 2922.
[edit] Load Event Instruction - Cmd 30
| Instruction Name | Load Event Instruction |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 30 |
| Command Type | Command |
| Command Data | Key Event |
| Reply Data | Key Event |
| Persistence | Non-Volatile |
| Summary | Loads the next instruction as the event-triggered instruction specified in the Command Data. |
After issuing this instruction, the next instruction received will be saved in non-volatile memory and will persist as the event-triggered instruction associated with the indicated key event even after power-down or reset.
This command is used to program the keys on a joystick to send any arbitrary instruction. There are five keys on the joystick. There are 4 key events that the joystick will detect:
- Event 1 - Key depressed
- Event 2 - Key released before hold time
- Event 3 - Key not yet released when hold time elapses
- Event 4 - Key released after hold time
The hold time is preset to 1 second and cannot be changed by the user.
Each of the 4 key events may be programmed to trigger a single instruction. It can be seen that pressing and releasing a key will result in a sequence of key events that will be either 1-2 or 1-3-4 depending when the key is released. Instructions associated with key events are called event-triggered instructions. When any key event occurs, an event-triggered instruction will be sent by the T-JOY device to all T-Series devices downstream (away from the computer) in the daisy-chain.
If an event-triggered instruction is addressed to device 0 (all devices) or is addressed to the device number of the T-JOY, then the T-JOY will execute the instruction itself. If the instruction is addressed to device 255, then the T-JOY will neither send nor execute the instruction. This provides a method for disabling a key event.
The Load Event-Triggered Instruction (#30) command is used to specify the key event that you wish to attach an instruction to. The Command Data required is:
- Command Data = Key * 10 + Event
Where:
- Key is a number from 1 to 5 corresponding to the Key location
- Event is a number from 1 to 4 corresponding to the Key Event
The instruction received immediately after the Load Event Triggered Instruction command will be the event-triggered instruction associated with the specified key event. Note that this next instruction will not be executed by the T-JOY, but will be stored for execution whenever the corresponding key event is detected. This instruction will also pass unhindered to any devices that may be downstream (away from the computer) from the T-JOY. For this reason, we recommend disconnecting downstream devices from the joystick before loading or returning event-triggered instructions.
If you are using message ids, we recommend that you disable them while programming the joystick. That way, the programmed instructions will work whether the target device has message ids enabled or not.
The instructions loaded for each button event are non-volatile and persist after the joystick is turned off. The loading state is volatile, so if you issue this command, but don't send any other instructions before turning off the power, then when power is restored it will not be waiting for an instruction.
The following table shows the default event-triggered instructions associated with each key event:
| Key | Event 1 | Event 2 | Event 3 | Event 4 |
| 1 | 11 | 12 | 13 | 14 |
| 2 | 21 | 22 | 23 | 24 |
| 3 | 31 | 32 | 33 | 34 |
| 4 | 41 | 42 | 43 | 44 |
| 5 | 51 | 52 | 53 | 54 |
Having four different key events for each key makes the T-JOY very flexible. Here are a few examples.
| Key | Event | Key Event | Default Instruction | Description |
| (Device, Command, Data) | ||||
| 1 | 1 | 11 | (255, 255, 0) | - |
| 1 | 2 | 12 | (0, 23, 0) | Stop all devices |
| 1 | 3 | 13 | (0, 1, 0) | Home all devices |
| 1 | 4 | 14 | (255, 255, 0) | - |
| 2 | 1 | 21 | (1, 55, 0) | Echo the number 0 |
| 2 | 2 | 22 | (1, 55, 1) | Echo the number 1 |
| 2 | 3 | 23 | (1, 55, 2) | Echo the number 2 |
| 2 | 4 | 24 | (1, 55, 3) | Echo the number 3 |
| 3 | 1 | 31 | (255, 255, 0) | - |
| 3 | 2 | 32 | (0, 18, 0) | Go to stored position 0 |
| 3 | 3 | 33 | (0, 16, 0) | Store current position 0 |
| 3 | 4 | 34 | (255, 255, 0) | - |
| 4 | 1 | 41 | (255, 255, 0) | - |
| 4 | 2 | 42 | (0, 18, 1) | Go to stored position 1 |
| 4 | 3 | 43 | (0, 16, 1) | Store current position 1 |
| 4 | 4 | 44 | (255, 255, 0) | - |
| 5 | 1 | 51 | (255, 255, 0) | - |
| 5 | 2 | 52 | (0, 18, 2) | Go to stored position 2 |
| 5 | 3 | 53 | (0, 16, 2) | Store current position 2 |
| 5 | 4 | 54 | (255, 255, 0) | - |
Example 1: Programming a single key to store and return to a position:
Each key can be programmed to provide different functionality depending on how long the key is held down. Key event 3 can be programmed to trigger the “Store Current Position” instruction, and key event 2 can be programmed to trigger the “Go To Stored Position” instruction. With such a setup, the user can use the joystick to move an XYZ stage to a desired position, then hold down the key for more than 1 second to store the current position of the stage. After moving the stage around some more, the user can return to the stored position by quickly pressing and releasing the same key. For a description of the “Store Current Position” and “Go To Stored Position” instructions, please see the user’s manual of the product in question. Assuming that the joystick is device #1, the programming sequence to program key 3 to provide this functionality would be as follows:
| Device | Command | Data | Explanation of command |
| 1 | 30 | 31 | Program key 3, event 1 to trigger the instruction… |
| 255 | 0 | 0 | …“do nothing” |
| 1 | 30 | 32 | Program key 3, event 2 to trigger the instruction… |
| 0 | 18 | 6 | …“All devices, Go To Stored Position, in slot #6” |
| 1 | 30 | 33 | Program key 3, event 3 to trigger the instruction… |
| 0 | 16 | 6 | …“All devices, Store Current Position, in slot #6” |
| 1 | 30 | 34 | Program key 3, event 4 to trigger the instruction… |
| 255 | 0 | 0 | …”do nothing” |
Example 2: Programming two keys to control the motion of an additional device:
You can program two keys to control the motion of an additional device. In the following sequence of commands, key 1 and key 2 are programmed to control device 5, an additional device beyond devices 2, 3, and 4 which are controlled by joystick manipulation. After executing this sequence of instructions, key 1 can be used to move device 5 in the positive direction, slowly at first, but faster if you hold the key down for longer than 1 second. Key 2 will exhibit the identical behavior but with motion in the negative direction. When either key is released the motion will stop. Assuming that the joystick is device #1, the programming sequence is as follows:
| Device | Command | Data | Explanation of command |
| 1 | 30 | 11 | Program key 1, event 1 to trigger the instruction… |
| 5 | 22 | 1000 | …“Device 5, Move at Constant Velocity, 1000” |
| 1 | 30 | 12 | Program key 1, event 2 to trigger the instruction… |
| 5 | 23 | 0 | …“Device 5, Stop” |
| 1 | 30 | 13 | Program key 1, event 3 to trigger the instruction… |
| 5 | 22 | 4000 | …“Device 5, Move at Constant Velocity, 4000” |
| 1 | 30 | 14 | Program key 1, event 4 to trigger the instruction… |
| 1 | 23 | 0 | …“Device 5, Stop” |
| 1 | 30 | 21 | Program key 2, event 1 to trigger the instruction… |
| 5 | 22 | -1000 | …“Device 5, Move at Constant Velocity, -1000” |
| 1 | 30 | 22 | Program key 2, event 2 to trigger the instruction… |
| 5 | 23 | 0 | …“Device 5, Stop” |
| 1 | 30 | 23 | Program key 2, event 3 to trigger the instruction… |
| 5 | 22 | -4000 | …“Device 5, Move at Constant Velocity, -4000” |
| 1 | 30 | 24 | Program key 2, event 4 to trigger the instruction… |
| 5 | 23 | 0 | …“Device 5, Stop” |
Example 3: Programming keys to trigger an action on the computer
Sometimes you may want a key event on the joystick to trigger more complicated tasks than just sending a single instruction. You may also wish to have a key event on the joystick trigger certain actions on the computer (if one is connected). The Echo Data (#55) command exists for this purpose.
When the T-JOY receives the Echo Data (#55) command with any arbitrary data, the T-JOY will send a reply that is simply an echo of the instruction, including data. If you program one of the joystick’s key events to trigger an Echo Data command addressed to the device number of the joystick itself, then when the key event occurs, the joystick will do two things: 1. it will send the Echo Data instruction to downstream devices and 2. it will attempt to process the instruction itself. If the instruction is addressed to the device number of the T-JOY, then none of the downstream devices will respond to it. The T-JOY however will send an Echo Data reply (with the same data as the instruction) to the computer.
The user can write an application to run on the computer which will interpret the Echo Data reply as an indication that a key event has occurred. Different key events can trigger Echo Data instructions with different data so the user’s application on the computer can detect individual key events and take appropriate action (whatever the user decides that may be).
[edit] Return Event Instruction - Cmd 31
| Instruction Name | Return Event Instruction |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 31 |
| Command Type | Command |
| Command Data | Key Event |
| Reply Data | n/a |
| Persistence | n/a |
| Summary | Returns the the event-triggered instruction associated with the key-event. |
See the Load Event-Triggered Instruction (#30) for more information on definition of key events and event-triggered instructions.
To return the event-triggered instruction associated with a particular key event, issue the Return Event Instruction (#31) command to the joystick with data as follows:
- Command Data = Key * 10 + Trigger
Where:
- Key is a number from 1 to 5 corresponding to the key location
- Event is a number from 1 to 4 corresponding to the key event
The reply will be comprised of the device, command and data of the event-triggered instruction associated with the specified key event. Note that as far as the computer is concerned, the reply will appear to come from whatever device the event-triggered instruction is addressed to, which may not be the joystick. We recommend that all additional devices be disconnected from the joystick before loading or returning event-triggered instructions to avoid confusion.
[edit] Set Calibration Mode - Cmd 33
| Instruction Name | Set Calibration Mode |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 33 |
| Command Type | Setting |
| Command Data | Calibration Mode |
| Reply Data | Calibration Mode |
| Persistence | n/a |
| Summary | Calibrates the joystick by adjusting the limits and the deadbands. |
There are two sets of calibration variables: limits and deadbands. Limits define the maximum angular displacement of all axes of manipulation. Deadbands define the area around the neutral position of the joystick where no action should occur. Deadbands are useful to adjust the sensitivity of the joystick to vibration or accidental movement from the neutral position. Acceptable Calibration Mode values are: 0, 1, or 2. Mode 1 is for calibrating the maximum limits. Mode 2 is for calibrating the deadbands. Mode 0 exits the calibration routine.
The T-JOY is pre-calibrated before shipping so that it should work well right out of the box. Note that restoring default settings using command #36 will have no affect on the joystick calibration. There is no default calibration since each joystick has slightly different properties that prevent a single set of settings from working well on all devices.
The joystick should work well as calibrated. We do not recommend re-calibrating it unless you encounter problems such as motion occurring while the joystick is in the neutral position, or an inability to reach maximum velocity even with the joystick fully displaced.
To calibrate the limits, follow these steps:
- Issue command 33, data 1 to put joystick in “calibrate limits” mode
- Move joystick all the way to the left and all the way to the right
- Move joystick all the way up and all the way down
- Turn joystick knob all the way counter-clockwise and all the way clockwise
- Issue command 33, data 0 to save the measured limit parameters
To calibrate the deadbands, follow these steps:
- Issue command 33, data 2 to put joystick in “calibrate deadbands” mode
- Wiggle joystick slightly to the left and right of the neutral position. Try to move only within the limits of the slack. Do not move past the point where resistance begins.
- Wiggle joystick slightly up and down from the neutral position
- Turn joystick knob slightly counter-clockwise and clockwise from the neutral position
- Issue command 33, data 0 to save the measured limit parameters
[edit] Restore Settings - Cmd 36
| Instruction Name | Restore Settings |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 36 |
| Command Type | Command |
| Command Data | Peripheral Id |
| Reply Data | Peripheral Id |
| Persistence | Non-Volatile |
| Summary | Restores the device settings to the factory defaults. |
This command should be issued with a Peripheral Id of 0 to return the device to factory default settings. This instruction is very useful for troubleshooting. If the device does not appear to function properly, it may be because some of the settings have been changed. This instruction will restore the settings to default values. For a table of default settings, see Appendix A. All settings affected by this instruction are stored in non-volatile memory and will persist after power-down or reset.
[edit] Special Note
This command should be issued with Data of 0 to return the device to factory default settings. This command is very useful for troubleshooting. If the unit does not appear to function properly, it may be because some of the settings have been changed. Command 36 will restore the settings to default values.
[edit] Set Device Mode - Cmd 40
| Instruction Name | Set Device Mode |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 40 |
| Command Type | Setting |
| Command Data | Mode |
| Reply Data | Mode |
| Persistence | Non-Volatile |
| Summary | Sets the Mode for the given device. |
[edit] Special Note
This command allows setting several options. Each option is controlled by a single bit within the command data. Most software you will encounter, including most of our demo software, represents all 4 data bytes as a single decimal value rather than specifying each bit individually. To determine what decimal value to use requires a basic understanding of how the data is represented in binary. The command data may be considered as a single 32-bit binary value. The least significant bit is bit_0, the next is bit_1, the next is bit_2, and so on up to the most significant bit_31. Each bit may have a value of either 1 or 0.
The corresponding decimal representation of this 32-bit data is given by:
- Decimal value = (bit_0 * 1) + (bit_1 * 2) + … + (bit_n * 2n) + … + (bit_31 * 2^31)
Each bit controls a single mode option as described in the table below. To determine the data value to use with the Set Device Mode command, simply determine the desired value of each bit (1 or 0), and calculate the decimal value using the above formula. Note that not all 32 bits are currently used. Any unused or reserved bits should be left as 0.
For example, suppose you want all mode bits to be 0 except for bit_0 (disable autoreply), bit_14 (disable power LED), and bit_15 (disable serial LED). The Set Device Mode instruction should be sent with data calculated as follows:
- Command Data
- = 2^20 + 2^214 + 2^215
- = 1 + 16384 + 32768
- = 49153
Note that each instance of the Set Device Mode command overwrites ALL previous mode bits. Repeated commands do not have a cumulative effect. For example, suppose you send a Set Device Mode command with data of 1 to disable auto-replies. If you then send another Set Device Mode command with data of 16384 to disable the power LED, you will re-enable auto-replies since bit_0 in the 2nd instruction is 0.
The T-JOY has a default mode setting of 0 (all bits are 0).
| Bit_n | 2n | Description |
| bit_0 | 1 | Disable Auto-reply A value of 1 disables ALL replies except those to “return” commands (commands 50 and higher). The default value is 0 on all devices. |
| bit_1 | 2 | Reserved |
| bit_2 | 4 | Reserved |
| bit_3 | 8 | Reserved |
| bit_4 | 16 | Reserved |
| bit_5 | 32 | Reserved |
| bit_6 | 64 | Enable Logical Channels Mode A value of 1 enables the Logical Channels Mode. In this mode of communication, only bytes 3 through 5 are used for data. Byte 6 is used as an Id byte that the user can set to any value they wish. It will be returned unchanged in the reply. Logic Channel Mode allows the user application to monitor communication packets individually to implement error detection and recovery. The default value is 0 on all devices. |
| bit_7 | 128 | Reserved |
| bit_8 | 256 | Reserved |
| bit_9 | 512 | Reserved |
| bit_10 | 1,024 | Reserved |
| bit_11 | 2,048 | Reserved |
| bit_12 | 4,096 | Reserved |
| bit_13 | 8,192 | Reserved |
| bit_14 | 16,384 | Disable Power LED A value of 1 turns off the green power LED. It will still blink briefly, immediately after powerup. |
| bit_15 | 32,768 | Disable Serial LED A value of 1 turns off the yellow serial LED. |
[edit] Set Alias Number - Cmd 48
| Instruction Name | Set Alias Number |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 48 |
| Command Type | Setting |
| Command Data | Alias Number |
| Reply Data | Alias Number |
| Persistence | Non-Volatile |
| Summary | Sets an alternate device number for a device. |
This setting specifies an alternate device number for a device (in addition to its actual device number). By setting several devices to the same alias number, you can control a group of devices with a single instruction. When you send an instruction to an alias number, all devices with that alias number will execute the instruction and reply using their actual device numbers. To remove an alias, simply set the device's alias number to zero. Valid alias numbers are between 0 and 254. To avoid confusion, it is best to choose an alias greater than the number of devices connected.
This setting is stored in non-volatile memory and will persist after power-down or reset.
[edit] Set Lock State - Cmd 49
| Instruction Name | Set Lock State |
|---|---|
| Firmware Version | 5.07 and up |
| Command Number | 49 |
| Command Type | Setting |
| Command Data | Lock State |
| Reply Data | Lock State |
| Persistence | Non-Volatile |
| Summary | Locks or unlocks all non-volatile settings. |
Sometimes it is desirable to lock all non-volatile settings to prevent them from being changed inadvertently. After changing all settings as desired, settings can be locked by setting the Lock State to 1. Subsequent attempts to change any non-volatile setting (e.g., Set Target Speed, command 42) will result in an Error Response with an error code of 3600 (settings locked).
How the Restore Settings instruction behaves when the settings are locked depends on the firmware version. In version 5.07 issuing a Restore Settings instruction while the settings are locked will result in an Error Response with an error code of 3600 (settings locked). This behavior was found to confuse many customers so in version 5.08 and up, the behavior was changed such that regardless of the current lock state, issuing a Restore Settings instruction will always return setting values to factory default values and leave settings in an unlocked state.
Settings can also be unlocked by setting the Lock State to 0.
[edit] Return Device Id - Cmd 50
| Instruction Name | Return Device Id |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 50 |
| Command Type | Read-Only Setting |
| Command Data | Ignored |
| Reply Data | Device Id |
| Persistence | n/a |
| Summary | Returns the id number for the type of device connected. |
See the T-Series/Device_Ids wiki page for a table of device Ids for all Zaber products.
[edit] Return Firmware Version - Cmd 51
| Instruction Name | Return Firmware Version |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 51 |
| Command Type | Read-Only Setting |
| Command Data | Ignored |
| Reply Data | Version |
| Persistence | n/a |
| Summary | Returns the firmware version installed on the device. |
A decimal is assumed before the last two digits. For example, 502 indicates firmware version 5.02.
[edit] Return Power Supply Voltage - Cmd 52
| Instruction Name | Return Power Supply Voltage |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 52 |
| Command Type | Read-Only Setting |
| Command Data | Ignored |
| Reply Data | Voltage |
| Persistence | n/a |
| Summary | Returns the voltage level of the device's power supply. |
A decimal is assumed before the last digit. For example, a value of 127 indicates 12.7 V. Note that the internal voltage measurement is not very accurate. Don't be alarmed if the indicated voltage is slightly different from your measurements.
[edit] Return Setting - Cmd 53
| Instruction Name | Return Setting |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 53 |
| Command Type | Command |
| Command Data | Setting Number |
| Reply Data | Setting Value |
| Persistence | n/a |
| Summary | Returns the current value of the setting specified in the Command Data. |
Valid setting numbers are the command numbers of any "Set..." instruction. The device will reply using the command number of the specified setting (as if a command to change the setting had just been issued) but the setting will not be changed.
For example, command #48 is the "Set Alias" instruction. Therefore if you wish to return the current value of the alias number, simply send the Return Setting instruction with data of 48. The device will reply with command #48 and data equal to the setting value.
[edit] Echo Data - Cmd 55
| Instruction Name | Echo Data |
|---|---|
| Firmware Version | 5.04 and up |
| Command Number | 55 |
| Command Type | Command |
| Command Data | Data |
| Reply Data | Data |
| Persistence | n/a |
| Summary | Echoes back the same Command Data that was sent. |
This command is useful for testing communication, similar to a network "ping".
[edit] Special Note
This instruction is a useful one to use as an event-triggered instruction associated with a key event. It can be used to allow the computer (if one is connected) to detect a key press on the joystick. For more details see the Load Event-Triggered Instruction (#30) command.
[edit] Reply-only Reference
In general, a T-series device will reply to an instruction using the same command number as the instruction itself. However, there are occasions (such as when the user turns the potentiometer) when the device may transmit data without first receiving a request from the controlling computer. This type of reply may be considered to be a triggered reply as opposed to a requested reply. In this case the device uses a “reply-only” command number to distinguish the reply from those requested by the controlling computer. The meanings of these replies and their corresponding data are given below.
[edit] Error - Cmd 255
| Instruction Name | Error |
|---|---|
| Firmware Version | 5.00 and up |
| Command Number | 255 |
| Command Type | Reply |
| Command Data | n/a |
| Reply Data | Error Code |
| Persistence | n/a |
| Summary | Indicates to the user that an error has occurred. |
This reply indicates that an error has occurred. The error code returned in the data indicates the type of error. The device may send an error code as a reply to an invalid instruction, or it may autonomously send an error code as a triggered reply (i.e. not in response to an instruction). The error code is typically the command number of the instruction that caused the error, but not always.
[edit] Error Codes for T-Joy
| Code | Name | Description |
|---|---|---|
| 2 | Device Number Invalid | Renumbering data out of range. Data (Device number) must be between 1 and 254 inclusive. |
| 14 | Voltage Low | Power supply voltage too low. |
| 15 | Voltage High | Power supply voltage too high. |
| 25 | Axis Invalid | Set Active Axis - Data out of range. Must be 1, 2, or 3. |
| 26 | Axis Device Number Invalid | Set Axis Device Number - Data out of range. Must be between 0 and 254 inclusive. |
| 27 | Inversion Invalid | Set Axis Inversion - Data out of range. Must be 0, 1, or -1. |
| 28 | Velocity Profile Invalid | Set Axis Velocity Profile - Data out of range. Must be 0, 1, 2, or 3. |
| 29 | Velocity Scale Invalid | Set Axis Velocity Scale - Data out of range. Must be between 0 and 65535. |
| 30 | Load Event Invalid | Load Event-Triggered Instruction - Data out of range. See command #30 for valid range. |
| 31 | Return Event Invalid | Return Event-Triggered Instruction - Data out of range. See command #31 and #30 for valid range. |
| 33 | Calibration Mode Invalid | Must be 0, 1, or 2. |
| 36 | Peripheral Id Invalid | Restore Settings - peripheral id is invalid. Please use one of the peripheral ids listed in the user manual, or 0 for default. |
| 40 | Mode Invalid | Set Device Mode - one or more of the mode bits is invalid. |
| 48 | Alias Invalid | Alias out of range. Alias must be between 0 and 254 inclusive. |
| 49 | Lock State Invalid | Lock state must be 1 (locked) or 0 (unlocked). |
| 53 | Setting Invalid | Return Setting - data entered is not a valid setting command number. Valid setting command numbers are the command numbers of any "Set ..." instructions. |
| 64 | Command Invalid | Command number not valid in this firmware version. |
| 3600 | Settings Locked | Must clear Lock State (command 49) first. See the Set Lock State command for details. |

