ASCII
This document contains the specifications for the ASCII protocol in development for A-Series Zaber devices.
Contents |
Revision History
Firmware 6.02
ASCII protocol support can be unlocked in firmware for alpha testing.
Initial Configuration
Communication Port Settings
9600 8-N-1
- Default Baudrate
- 9600 bit/s
- Data Bit
- 8
- Hardware/Software Flow control
- None
- Stop Bit
- 1
Terminal Software
- Local echo
- On (Recommended)
- Note: Zaber device does not echo received bytes. If local echo is disabled in the terminal software, user input data will not be shown on the screen.
- End of Line
- DOS or UNIX
- Note: Zaber device supports receiving end of line consisting one of Carriage Return ('\r', CHAR(13)) or Line Feed ('\n', CHAR(10)), or a combination of the two
- Note: Zaber device always replies DOS end of line: "\r\n"
Zaber Device
ASCII protocol support must be first unlocked. Please contact Zaber technical support for instructions.
Protocol Specifications
- Command Header
- All commands start with the character '/'
- Note: a second '/' before a command footer will be treated as a character within the command
- Command Footer
- All commands end with one of either '\r' or '\n', or a combination of the two
- Upon receiving a command footer character, the command is completed and the device will begin parsing the command
- Backspace
- The backspace character '\b' is supported.
- Each backspace received will erase the most recent byte in the command
- Delete
- Upon receiving the delete character CHAR(127), the incomplete command currently being received will be discarded
- Supported Characters
- The protocol supports all printable characters (CHAR(32-126))
- The protocol supports the following control characters: '\r', '\n', '\b', ESC (CHAR(13,10,127))
- Any unsupported characters received will cause the device to discard the incomplete command being received
Command Set
All ASCII commands are in one of the following formats
Addressing all devices connected:
/command\n * Command footer can be one of \n, \r, \r\n
When a command is received without a device number, all devices will respond.
Addressing a specific device by device number:
/device_number command\n * Command footer can be one of \n, \r, \r\n
Only devices with matching device number or alias will respond. If the request unit number is 0, all devices will respond.
Number formats
For all numerical parameters, the protocol supports the following numerical formats.
0 1 2 3 4 5 6 7 8 9 10 11 ... Decimal (no prefix) 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB ... Hexadecimal (prefix: 0x or 0X, case-insensitive) 00 01 02 03 04 05 06 07 010 011 012 013 ... Octal (prefix: 0)
Negative value:
-number where number follows one of the above formats
Addressing Connected Devices
Device Number
To renumber all connected devices:
/renum\n
When completed, devices will be assigned consecutive device numbers starting from 1, with 1 being the first device in the chain.
/1 move abs 1000 # unit 1: move to absolution position 1000 /2 move rel 640 # unit 2: move to relative position 1000 /3 stop # unit 3: stop
All devices must have unique device numbers. Otherwise, it is not possible to distinguish responses from various devices with the same device number assigned.
Alias
In addition to device numbers. Each device can be assigned to an alias number. Device will response to a command if the specified device number matches the device's device number or alias. Alias numbers can be repeated. Thus, they can be employed to address a group of devices in groups.
To clear all alias numbers
/set alias 0\n
To assign alias 100 to both device unit 2 and unit 3. Then, command both units to stop.
/2 set alias 100\n # unit 2: set alias to 100 /3 set alias 100\n # unit 3: set alias to 100 /100 stop\n # both units stop
Commands
/\n # list all connected device /renum\n # renumber all connected devices from 1 to N /get id\n # list device IDs /get version\n # list firmware versions /l\n # repeat last command /home\n # home device /move abs x\n # move to absolute position x /move rel x\n # move by relative position x /move spd v\n # move at velocity v /stop\n # stop device /get status\n # get device status (command executing) /t cmd\n # send T-Series command: command number cmd, data value 0 /t cmd data\n # send T-Series command: command number cmd, data value data /get\n # list all get-able settings /get name\n # query value for setting name /set\n # list all set-able settings /set name value\n # set value for setting name to value /reset settings\n # restore common settings to default /reset reboot\n # reboot device (similar to power-cycling the device) /help\n # list supported commands /help topic\n # print help text for command topic /echo text\n # reply with given text (for connection testing)
Replies
For each received command, device sends ONE reply in one of the following formats
<device_number OK \r\n <device_number OK data\r\n <device_number ER error_code1 error_code2\r\n
Device may respond with one or more comments in the form of
#device_number comments\r\n