Zaber T-JOY User manual

T-JOY Joystick
User’s Manual
Firmware Version 5.00 and up
This manual covers only model T-JOY
Document Revision: 2006-11-23
Visit www.zaber.com for more recent updates
Zaber Technologies Inc.
2891 Steveston Hwy
Richmond, BC, V7E 2J1
Canada

Copyright © Zaber Technologies Inc.
1ZABER T-SERIES PRODUCTS....................................................................................................... 3
1.1 T-SERIES SPECIFICATIONS............................................................................................................ 4
1.2 T-JOY SPECIFICATIONS ............................................................................................................... 4
2FIRMWARE VERSION INFORMATION...................................................................................... 4
3CAUTION............................................................................................................................................ 4
4INITIAL SETUP AND TESTING..................................................................................................... 5
5INSTALLATION................................................................................................................................6
6CONTROL THROUGH THE RS-232 PORT.................................................................................. 7
7COMMAND QUICK REFERENCE ................................................................................................ 8
8DETAILED COMMAND REFERENCE....................................................................................... 10
8.1 RESET (#0)................................................................................................................................. 10
8.2 RENUMBER (#2)......................................................................................................................... 10
8.3 SET ACTIVE AXIS (#25).............................................................................................................. 11
8.4 SET AXIS UNIT NUMBER (#26)................................................................................................... 12
8.5 SET AXIS INVERSION (#27) ........................................................................................................ 13
8.6 SET AXIS VELOCITY PROFILE (#28)........................................................................................... 14
8.7 SET AXIS VELOCITY SCALE (#29).............................................................................................. 15
8.8 LOAD EVENT-TRIGGERED INSTRUCTION (#30) .......................................................................... 16
8.9 RETURN EVENT-TRIGGERED INSTRUCTION (#31) ...................................................................... 20
8.10 CALIBRATE JOYSTICK (#33)....................................................................................................... 21
8.11 RESTORE /LOCK /UNLOCK SETTINGS (#36) .............................................................................. 22
8.12 SET DEVICE MODE (#40) ........................................................................................................... 23
8.13 SET ALIAS (#48)......................................................................................................................... 24
8.14 RETURN DEVICE ID (#50).......................................................................................................... 25
8.15 RETURN FIRMWARE VERSION (#51)........................................................................................... 25
8.16 RETURN POWER SUPPLY VOLTAGE (#52) .................................................................................. 25
8.17 RETURN SETTING (#53).............................................................................................................. 25
8.18 ECHO DATA (#55)...................................................................................................................... 26
9REPLY-ONLY REFERENCE......................................................................................................... 27
9.1 REPLY #255 –ERROR................................................................................................................. 27
10 ERROR CODES............................................................................................................................... 28
11 LED INDICATORS.......................................................................................................................... 28
12 TROUBLESHOOTING................................................................................................................... 29
12.1 T-SERIES GENERAL TROUBLESHOOTING TIPS............................................................................ 29
12.2 T-JOY SPECIFIC TROUBLESHOOTING TIPS................................................................................. 30
13 DATA CABLE PINTOUT DIAGRAM .......................................................................................... 31
14 WARRANTY .................................................................................................................................... 32
15 REPAIRS AND RETURNS ............................................................................................................. 32
16 EMAIL UPDATES ........................................................................................................................... 32
17 DISCLAIMER .................................................................................................................................. 32
18 TECHNICAL SUPPORT AND CONTACT .................................................................................. 32
Page 2 of 32

Copyright © Zaber Technologies Inc.
1 ZABER T-SERIES PRODUCTS
T-JOY Joystick Controller T-CON3 – Stand Alone Device Controller
Customers may use either of the above products or a computer with RS232 serial communications to
control various combinations of the devices below.
T-LA Series – Linear Actuators T-CD Series – 2 Phase Stepper Motor Controllers
T-LS Series – Linear Stages T-LLS Series – Long Travel Linear Slides
T-MM Series – Motorized Mirror Mounts T-NM Series – Steppers with built-in Controllers
For more information on any of these products or to sign up for our quarterly email newsletter with product
updates and promotions, please visit http://www.zaber.com.
Page 3 of 32

Copyright © Zaber Technologies Inc.
1.1 T-Series Specifications
The following specifications apply to all T-Series devices:
Power Supply: 12V nominal (10V to 16V acceptable) DC unregulated supply on 2.1 mm, center
positive power connector.
Communications: RS232, 9600 baud, no parity, one stop bit on 6-pin mini din cable, male towards the
computer, female towards the next unit
1.2 T-JOY Specifications
The following specifications are specific to T-JOY devices
Current Draw: 50 mA
Joystick Controllable Axes: 3
User Configurable Buttons: 5
Visual Feedback: Power LED (green) and Com LED (yellow)
Dimensions: 200 x 122 x 102 mm (L x W x H)
Weight: 350g
Compatibility
Device Firmware version Compatibility
T-CON All None
All T-Series
except T-CON 1.00 to 4.99 None
All T-Series
except T-CON 5.00 to 5.03 Partial *
All T-Series
except T-CON 5.04 and up Full
* T-Series devices with firmware version 5.00 to 5.03 may be used with the T-JOY, however their
command set lacks two useful instructions that were added in version 5.04: Save Current Postion, and Go
To Saved Position. These instructions are particularly useful in conjunction with the T-JOY since any
button on the T-JOY may be programmed to issue these instructions to all connected units in order to store
and recall a position in 3 dimensional space.
2 FIRMWARE VERSION INFORMATION
The version of firmware installed on any Zaber T-Series device can be determined by issuing command
#51. A three-digit number will be returned. Assume 2 decimal places (ex a reply of 504 indicates firmware
version 5.04). This user’s manual applies only to T-JOY devices with firmware version 5.04 and up. This is
the most recent version as of this printing; however newer firmware versions may have since been released.
Due to the addition of new features, newer versions of firmware may not be 100% compatible with older
versions. For more information on firmware versions that may have been released since the printing of this
manual, please check the support section of Zaber’s website where user’s manuals for all versions of
firmware are posted for download.
3 CAUTION
Zaber devices are precision instruments and must be handled with care. Avoid using excessive force or
rapid motion when manipulating the joystick or buttons. Do not force the connectors; when properly
aligned, only a gentle force should be needed to achieve connection.
Page 4 of 32

Copyright © Zaber Technologies Inc.
4 INITIAL SETUP AND TESTING
When you first receive your T-JOY, you may wish to perform a few simple steps to familiarize yourself
with its operation. First you will need a power supply. If you did not order one with your device, you will
require a power supply with output voltage between 10 and 16V DC. The power input accepts a standard
2.1mm center positive connector. Most unregulated 12V AC-to-DC adapters output around 16V under light
current draw, dropping to 12V at their rated current. Some may output higher voltages and will not be
suitable. The chosen power supply must also be rated to handle the maximum total current draw of the
devices connected to it. For example, if you have one T-JOY joystick and 2 T-LA28A actuators daisy-
chained together with a single power supply, you will need at least 690 mA (50mA for the joystick and 320
mA for each actuator). The current draw of each device is given in the specifications section of the user’s
manual for the device. When powering long chains of devices, we recommend connecting a power supply
to every second or third device in the chain to reduce the current through the data cables.
Once you have a working power supply, you can test the operation of the T-JOY. Connect the power
supply to the joystick and ensure that the green LED turns on indicating power. Move the joystick from left
to right, forward and back, and rotate the handle counterclockwise and clockwise. Also try pressing the
buttons. As you perform each of these actions you should notice the yellow LED blinking indicating
communications are taking place. Each blink corresponds to a single instruction being sent by the joystick.
This is the extent of the testing you can perform without connecting other devices to interpret and execute
the instructions being sent by the T-JOY, or connecting a computer to communicate with the T-JOY.
Page 5 of 32

Copyright © Zaber Technologies Inc.
5 INSTALLATION
During normal operation, the T-JOY joystick does not need to be connected to a computer, however, it
must be connected to a computer initially in order to change it’s settings (for example to change button
functions from the defaults or to change what additional devices will be controlled by each axis of the
joystick). Devices that will be used with the joystick must also be connected so that the computer may issue
a renumber instruction which assigns all connected devices a unique unit number. This is necessary so that
the T-JOY can direct instructions to the appropriate device to control the correct axis of motion.
Step 1. Plug the Mini-DIN to D-Sub serial adapter into your
computer’s serial port and plug the longer T-JOY data cable (male
end) into the adapter. You may need to use a cable extension to reach
your computer.
There is no need to power-down or reboot the computer. USB-to-
RS232 converters are available if you have no RS232 serial port.
Step 2. Connect at least one additional T-Series device to the shorter
T-JOY data cable (female end). Connect the power plug of your
power supply (2.1mm center positive) to the power connector of the
T-JOY. The green LED should light on the T-JOY and any connected
T-Series devices (note: not all T-Series devices have LEDs).
Depending on the number of devices connected, you may need to
connect additional power supplies. We recommend connecting a
power supply to every second or third unit to reduce current draw
through the data cables.
Step 3. Install a demo program from the included CD, or download
one from the support section of our website http://www.zaber.com.
Follow the instructions in the readme file to install and run the
program.
As a simple first test, try entering these instructions:
Unit Cmd Data Description
0 2 0 Renumber all units
2 1 0 Home unit number 2
Page 6 of 32

Copyright © Zaber Technologies Inc.
6 CONTROL THROUGH THE RS-232 PORT
Your communications settings must be: 9600 baud, no hand shaking, 8 data bits, no parity, one stop bit.
The amber LED will light when there is activity on the RS232 lines. When the yellow LED on the T-JOY
blinks it indicates either the computer has sent an instruction, or the T-JOY has sent an instruction (due to
movement of the joystick or the buttons). We recommend using the sample Visual Basic 6 program
included with Zaber products. It also contains source code that you can use as an example for writing your
own code to control your specific system.
Important: After daisy-chaining new devices to the T-JOY, or rearranging the order of the devices, you
must assign each unit a unique identifier by issuing a renumber instruction after all the units in the chain are
powered up. You must not transmit any instructions while the daisy-chain is renumbering or the
renumbering routine may be corrupted. Renumbering takes less than a second, after which you may start
issuing instructions to the T-JOY and any additional devices in the daisy-chain.
All instructions consist of a group of 6 bytes. They must be transmitted with less than 10 ms between each
byte. If the unit has received less than 6 bytes and then a period longer than 10 ms passes, it ignores the
bytes already received. We recommended that your software behave similarly when receiving data from the
devices, especially in a noisy environment like a pulsed laser lab.
The following table shows the instruction format:
Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6
Unit # Command # Data (Least
Significant
Byte, LSB)
Data Data Data (Most
Significant
Byte, MSB)
The first byte is the unit number in the chain. After renumbering, unit number 1 is the closest unit to the
computer and unit number 2 is next and so forth. If an instruction is sent to unit number 0 (byte1 = 0) all
the units in the chain will execute the accompanying command simultaneously.
The second byte is the command number. Bytes 3, 4, 5, and 6 are data. How the data bytes are interpreted
depends on the command. Complete details are given in the command reference on the following page.
Examples: Renumber all units: 0, 2, 0, 0, 0, 0
Home unit number 2: 2, 1, 0, 0, 0, 0
If you are using Zaber’s demo software, you will only see 3 entry fields: Unit#, Command#, and Data. The
Unit# and Command# fields accept integer values while the value you enter into the Data field can be
signed. The value in the data field is converted by the software to generate bytes 3, 4, 5 and 6 and then all 6
bytes are sent to the unit in sequence.
Most instructions cause the unit to reply with a return code. It is also a group of 6 bytes. The first byte is the
unit number. Byte 2 is the instruction just completed or 255 (0xFF) if an error occurs. Bytes 3, 4, 5 and 6
are data bytes in the same format as the instruction data byte.
Page 7 of 32

Copyright © Zaber Technologies Inc.
7 COMMAND QUICK REFERENCE
The command quick references below provides a list of available T-JOY commands at a glance. A Detailed
description of each command is given in the following section.
Note that a computer may also be used to control additional units in the daisy-chain. For a list of
instructions applicable to other devices, please consult the appropriate user’s manual.
Command Reference for the T-JOY:
# Command Data Bytes Reply Data Page
0 Reset Ignored None 10
2 Renumber* 0 or desired Device Address Device ID 10
25 Set Active Axis* 1, 2, or 3 or 0 to select all Echo of Command Data 11
26 Set Axis Unit Number* Unit number to control Echo of Command Data 12
27 Set Axis Inversion* 1, -1, or 0 to toggle 1 or -1 13
28 Set Axis Velocity Profile* 1, 2, 3, or 0 to toggle 1, 2, or 3 14
29 Set Axis Velocity Scale* Maximum Velocity
0 to disable axis Echo of Command Data 15
30 Set Key Trigger* Trigger number Echo of Command Data 16
31 Return Key Trigger Trigger number Stored function (the
complete command) 20
33 Calibration* 0, 1, or 2 Echo of Command Data 21
36 Restore Default Settings* 0 Echo of Command Data 22
40 Set Device Mode* Mode Configuration (see
below) Echo of Command Data 23
48 Set Alias* Alias Unit Number Echo of Command Data 24
50 Return Device ID Ignored Device ID 25
51 Return Firmware Version Ignored Firmware Version 25
52 Return Power Supply voltage Ignored Power Supply Voltage 25
53 Return Setting Setting Number Setting Value 25
55 Echo Data User defined Echo of Command Data 26
* The settings for these commands are saved in non-volatile memory, i.e. the setting persists even if the
device is powered down. To restore all settings to factory default, use command 36.
Page 8 of 32

Copyright © Zaber Technologies Inc.
Command #40, “Set Mode” Options for the T-JOY:
Data Bits Option Name Effect
0 (1s) Disable Auto-reply Disable ALL replies except to command 50 and
higher.
1 (2s) Reserved This bit is reserved. Do not modify.
2 (4s) Reserved This bit is reserved. Do not modify.
3 (8s) Reserved This bit is reserved. Do not modify.
4 (16s) Reserved This bit is reserved. Do not modify.
5 (32s) Reserved This bit is reserved. Do not modify.
6 (64s) Enable Logical Channels
Communication Mode Enable the Logical Channels Communication
Mode (see manual for more details).
7 (128s) Reserved This bit is reserved. Do not modify.
8 (256s) Reserved This bit is reserved. Do not modify.
9 (512s) Reserved This bit is reserved. Do not modify.
10 (1,024s) Reserved This bit is reserved. Do not modify.
11 (2,048s) Reserved This bit is reserved. Do not modify.
12 (4,096s) Reserved This bit is reserved. Do not modify.
13 (8,192s) Reserved This bit is reserved. Do not modify.
14 (16,384s) Disable Power (Green) LED Disables the power LED during operations.
15 (32,768s) Disable Serial (Yellow) LED Disables the serial LED during operations.
Reply-Only Reference for the T-JOY:
Reply # Data Bytes Reply Data Page
Error 255 N/A. Reply-only. Error code 27
Page 9 of 32

Copyright © Zaber Technologies Inc.
8 DETAILED COMMAND REFERENCE
Note that these commands apply only to T-JOY series firmware versions 5.00 and up. To determine which
version of firmware you have simply issue the “return firmware version” (command 51). Many of the
commands described below will work with other firmware versions, however behavior may differ. See the
appropriate user’s manual for the version of firmware on your device.
8.1 Reset (#0)
Firmware Version: Version 5.00 and up
Command Number: 0
Data Bytes: Ignored
Reply Data: None
This sets the device to its power-up condition. It has the same effect as unplugging and restarting the unit.
All non-volatile settings (i.e. Unit Number, Joystick Calibration, etc.) are saved and are not affected by
reset or power-down.
8.2 Renumber (#2)
Firmware Version: Version 5.00 and up
Command Number: 2
Data Bytes: If issued to all units: Ignored.
If issued to a single unit: new number.
Reply Data: Each unit affected replies with its device ID after renumbering.
Note: The unit number is stored in non-volatile memory and will persist after power-
down or reset.
If issued with a 0 in Byte 1, the data bytes are ignored and all units will renumber. The unit closest to the
computer becomes number 1. The next unit becomes number 2 and so forth. If issued with a number other
than 0 in byte 1, the specified unit will reassign itself the unit number specified in the data bytes.
Renumbering takes less than a second during which time the computer must not send any further data. The
unit number is stored in non-volatile memory so you can renumber once and not worry about issuing the
renumber instruction on each power-up. Even if the order of devices in the daisy-chain is physically
changed, the unit numbers most recently assigned to each device will persist.
Page 10 of 32

Copyright © Zaber Technologies Inc.
8.3 Set Active Axis (#25)
Firmware Version: Version 5.04 and up
Command Number: 25
Data Bytes: 1, 2, or 3 to select the corresponding axis to be the active axis
Reply Data: Reply data is simply an echo of command data.
Note: 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.
This instruction selects one of the three axes of manipulation to be the active axis. Subsequent “Set
Axis…” instructions will apply only to the active axis. The “Set Axis…” instructions are:
-Set Axis Unit Number (#26)
-Set Axis Inversion (#27)
-Set Axis Velocity Profile (#28)
-Set Axis Velocity Scale (#29)
The three axes on the joystick are defined as follows:
Axis #1
Right is the positive direction of manipulation.
Left is the negative direction of manipulation.
Axis #2
Forward is the positive direction of manipulation.
Back is the negative direction of manipulation.
Axis #3
Clockwise is the positive direction of manipulation.
Counter-clockwise is the negative direction of
manipulation.
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, or powers off the joystick.
The joystick’s current active axis can be returned by issuing the Return Setting (#53) command, with data
of 25.
Page 11 of 32

Copyright © Zaber Technologies Inc.
8.4 Set Axis Unit Number (#26)
Firmware Version: Version 5.04 and up
Command Number: 26
Data Bytes: Byte 3 is the unit number. Valid numbers are between 0 and 254.
Reply Data: Reply data is simply an echo of the command data.
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.
This command sets what unit number you wish to control using the active axis. For example, suppose you
would like to assemble a 3-axis system where:
-Joystick axis 1 (right / left) controls unit #3.
-Joystick axis 2 (forward / back) controls unit #4, but with the motion inverted.
-Joystick axis 3 (clockwise / counterclockwise) controls unit #2.
First, connect the joystick and the three additional T-Series units (we have shown three T-LS units 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 unit #1, and the remaining units will become units #2, #3, and #4. Now commands may be
issued to the joystick to set the desired behavior. The command sequence is as follows:
Unit Command Data Explanation of command
0 2 0 Renumber. After connecting the daisy chain as shown above,
issue this command to all units. Each unit should reply. The T-
JOY3 will be unit #1, and subsequent units 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 unit #3.
1 25 2 Set axis number 2 to be the active axis.
1 26 4 Set the active axis (#2) to control unit #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 unit #2.
Page 12 of 32

Copyright © Zaber Technologies Inc.
Command #36, may be used to restore factory default settings. The factory default settings for axis control
are as follows:
-Axis #1 controls Unit #2
-Axis #2 controls Unit #3
-Axis #3 controls Unit #4
8.5 Set Axis Inversion (#27)
Firmware Version: Version 5.04 and up
Command Number: 27
Data Bytes: 1 to set the current axis to non-inverted
-1 to set the current axis to inverted
0 to toggle between invert and non-invert
Reply Data: 1 or -1, indicating the inversion status of the active axis.
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.
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 inversion status of the active 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.
Direction of Manipulation of Joystick Direction of Motion of Affected Unit
Axis Manipulation Non-inverted Inverted
1 Left (negative) Negative Positive
1 Right (positive) Positive Negative
2 Back (negative) Negative Positive
2 Forward (positive) Positive Negative
3 Counter-Clockwise (negative) Negative Positive
3 Clockwise (positive) Positive Negative
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 (data = 1).
Page 13 of 32

Copyright © Zaber Technologies Inc.
8.6 Set Axis Velocity Profile (#28)
Firmware Version: Version 5.04 and up
Command Number: 28
Data Bytes: 1 to use linear profile
2 to use squared profile
3 to use cubed profile
0 to toggle through the different profiles
Reply Data: 1, 2, or 3 depending on the current velocity profile.
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.
This setting allows the user to select the desired relationship between the angular displacement of the active
joystick axis and the velocity of the unit controlled by that axis.
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 units should be instructed to move. There are
three different profiles that can be selected:
-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.
Page 14 of 32

Copyright © Zaber Technologies Inc.
8.7 Set Axis Velocity Scale (#29)
Firmware Version: Version 5.04 and up
Command Number: 29
Data Bytes: Desired maximum velocity of the T-Series unit controlled by the active axis.
If data is 0, then the active axis will be disabled.
Reply Data: The reply data is simply an echo of the command data.
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.
This command is used to set 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 unit 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.
Page 15 of 32

Copyright © Zaber Technologies Inc.
8.8 Load Event-Triggered Instruction (#30)
Firmware Version: Version 5.04 and up
Command Number: 30
Data Bytes: Indicates the event number with which the next instruction should be associated.
Reply Data: The reply data is simply an echo of the command data.
Note: The next command received after command 30 is 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 the joystick to send any arbitrary instruction. There are five
keys on the joystick. There are 4 key events that the joystick will detect:
-Key Event 1 - Key depressed
-Key Event 2 - Key released before hold time
-Key Event 3 - Key not yet released when hold time elapses
-Key Event 4 - Key released after hold time
These key events are displayed graphically below. 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 unit to all T-Series units
downstream (away from the computer) in the daisy-chain.
If an event-triggered instruction is addressed to unit 0 (all units) or is addressed to the unit number of the T-
JOY, then the T-JOY will execute the instruction itself. If the instruction is addressed to unit 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 data value required is:
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
Page 16 of 32

Copyright © Zaber Technologies Inc.
The instruction received immediately after the Load Event-Triggered Instruction (#30) 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 un-hindered to any units that may be downstream (away from the
computer) from the T-JOY. For this reason, we recommended disconnecting downstream units from the
joystick before loading or returning event-triggered instructions.
The following table shows the data value necessary
to select a particular key event with which to
associate the next instruction.
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
The following table shows the default event-triggered instructions associated with each key event:
Key Event Key Event Default Instruction
(Unit, Command, Data) Description
1 1 11 (255, 255, 0) -
1 2 12 (0, 23, 0) Stop all units
1 3 13 (0, 1, 0) Home all units
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) -
Page 17 of 32

Copyright © Zaber Technologies Inc.
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) -
Having four different key events for each key makes the T-JOY very flexible. Here are a few examples.
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 unit #1, the programming sequence to program key 3 to provide this
functionality would be as follows:
Unit 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 units, Go To Stored Position, in slot #6”
1 30 33 Program key 3, event 3 to trigger the instruction…
0 16 6 …“All units, Store Current Position, in slot #6”
1 30 34 Program key 3, event 4 to trigger the instruction…
255 0 0 …”do nothing”
Page 18 of 32

Copyright © Zaber Technologies Inc.
Example 2: Programming two keys to control the motion of an additional unit:
You can program two keys to control the motion of an additional unit. In the following sequence of
commands, key 1 and key 2 are programmed to control unit 5, an additional unit beyond units 2, 3, and 4
which are controlled by joystick manipulation. After executing this sequence of instructions, key 1 can be
used to move unit 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 unit #1, the programming sequence
is as follows:
Unit Command Data Explanation of command
1 30 11 Program key 1, event 1 to trigger the instruction…
5 22 1000 …“Unit 5, Move at Constant Velocity, 1000”
1 30 12 Program key 1, event 2 to trigger the instruction…
5 23 0 …“Unit 5, Stop”
1 30 13 Program key 1, event 3 to trigger the instruction…
5 22 4000 …“Unit 5, Move at Constant Velocity, 4000”
1 30 14 Program key 1, event 4 to trigger the instruction…
1 23 0 …“Unit 5, Stop”
1 30 21 Program key 2, event 1 to trigger the instruction…
5 22 -1000 …“Unit 5, Move at Constant Velocity, -1000”
1 30 22 Program key 2, event 2 to trigger the instruction…
5 23 0 …“Unit 5, Stop”
1 30 23 Program key 2, event 3 to trigger the instruction…
5 22 -4000 …“Unit 5, Move at Constant Velocity, -4000”
1 30 24 Program key 2, event 4 to trigger the instruction…
5 23 0 …“Unit 5, Stop”
Page 19 of 32

Copyright © Zaber Technologies Inc.
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 unit 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
units and 2. it will attempt to process the instruction itself. If the instruction is addressed to the unit number
of the T-JOY, then none of the downstream units 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).
8.9 Return Event-Triggered Instruction (#31)
Firmware Version: Version 5.04 and up
Command Number: 31
Data Bytes: Indicates the event number for which to return the associated instruction.
Reply Data: The reply data is the event-triggered instruction (unit, command, data) associated
with the event specified by the data.
Note:
This command is used to return to the user the event-triggered instruction currently associated with a
particular 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-
Triggered Instruction (#31) command to the joystick with data as follows:
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 unit, 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 unit the event-triggered instruction is addressed to, which may not be the joystick. We
recommend that all additional units be disconnected from the joystick before loading or returning event-
triggered instructions to avoid confusion.
Page 20 of 32
Table of contents