T-Series/RS-232 Communications Protocol/T-JOY

From ZaberWiki
Jump to: navigation, search

Control Through The RS-232 Serial Port

All T-Series devices use the same RS232 communications protocol. Your communications settings must be: 9600 baud, no hand shaking, 8 data bits, no parity, one stop bit. The yellow LED will light when there is activity on the RS232 lines. You may use this feature to determine which COM port you are connected to. We recommend using the Zaber Console that you can download from our web site. The source code is also available for you to use as an example for writing your own custom code. See the troubleshooting section later in this manual if you have trouble communicating with the device.

Important: The first time you connect a device to your computer you must issue a renumber instruction to assign each device a unique identifier. This should be done after all the devices in the daisy-chain are powered up. In older firmware versions (prior to version 5xx) you must issue a renumber instruction after each powerup. In firmware 5xx and up, the device number is stored in non-volatile memory and will persist after powerdown, so you need only issue the renumber instruction when you add new devices to the chain, or rearrange the order of the devices, however it does no harm to issue the renumber instruction after every powerup. You must not transmit any instructions while the chain is renumbering or the renumbering routine may be corrupted. Renumbering takes less than a second, after which you may start issuing instructions over the RS232 connection.

All instructions consist of a group of 6 bytes. They must be transmitted with less than 10 ms between each byte. If the device 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 - Device #
  • Byte 2 - Command #
  • Byte 3 - Data - Least Significant Byte (LSB)
  • Byte 4 - Data
  • Byte 5 - Data
  • Byte 6 - Data - Most Significant Byte (MSB)

The first byte is the device number in the daisy-chain. Device number 1 is the closest device to the computer and device number 2 is next and so on. If the number 0 is used, all the devices in the chain will process the accompanying command simultaneously.

The second byte is the command number. Bytes 3, 4, 5, and 6 are data in long integer, 2’s complement format with the least significant byte transmitted first. How the command data are interpreted depends on the command. Complete details are given in the command reference on the following page.

Examples:

  • Renumber all devices: 0x00, 0x02, 0x00, 0x00, 0x00, 0x00
  • Set Active Axis (command #25): 0x00, 0x1C, 0x01, 0x00, 0x00, 0x00
  • Set Axis Velocity Profile (command #28): 0x00, 0x19, 0x02, 0x00, 0x00, 0x00

If you are using Zaber’s demo software, you will only see 3 entry fields: Device#, Command#, and Data. The Device# 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 4 separate bytes and then gets sent to the device.

Most instructions cause the device to reply with a return code. It is also a group of 6 bytes. The first byte is the device #. 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 command data.

Personal tools
Zaber Website