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