User Manual

50
5.2 Appendix B: Command set of CaMate
Protocol:
To avoid communication conflicts when several devices trying to send data at the same time, all
transmission and reception are controlled by the host computer. The basic form is a
command/response protocol with the host initiating the sequence. When the CaMate devices are not
transmitting, they are in the listening mode. The host sends a command to CaMate with a specified
address and waits a certain amount of time for the CaMate devices to respond.
The format for a command is:
Byte1
Byte2
Byte3
Byte4
Byte5
Byte6
Byte7
Byte8
Sync Byte
Address
Command
Data1
Data2
Data3
Data4
Checksum
All values below are shown in hexadecimal.
The synchronization byte is always 0xFF.
The address is the logical address of the CaMate being controlled.
The checksum is the 8-bit sum of the payload bytes (bytes2 through 7) in the command.
Command set Table: default address is 0x01
Command Name
Command Syntax
Description
Software Reset
FF 01 10 00 00 00 01 12
Read Serial No
FF 01 14 00 00 00 00 15
Reply: FF 01 14 (data) chks, data: 16-bytes
Read Model ID
FF 01 15 00 00 00 00 16
Reply: FF 01 15 dd dd dd dd chks, dddd dddd = model ID
Read F/W version
FF 01 16 00 00 00 00 17
Reply: FF 01 16 dd dd cc cc chks, dddd: version, cccc: checksum
Read Max/Default
current
FF 01 17 00 00 00 00 18
Reply: FF 01 17 00 mm 00 cc chks, mm: percentage of max current ,
cc: percentage of default current
Read Lens angle
FF 01 18 00 00 00 00 19
Reply: FF 01 18 pp qq rr ss chks, unit: degree
pp: Lens1 tele angle, qq: Lens1 wide angle
rr: Lens2 tele angle, ss: Lens2 wide angle
Read Factory date
FF 01 19 00 00 00 00 1A
Reply: FF 01 19 yy yy mm dd chks,
yyyy/mm/dd = year/month/day
Read Factory time
FF 01 1A 00 00 00 00 1B
Reply: FF 01 1A 00 hh mm ss chks,
hh/mm/ss = hours/minutes/seconds
Read Configuration
Data
FF 01 20 00 00 00 00 21
Reply: FF 01 20 dd dd dd dd chks,
dddd dddd: 32-bit configuration data
Write Configuration
Data
FF 01 21 dd dd dd dd chks
configuration data dddd dddd: (bold font is default value)
bit 31~24: Device ID (01)~(127)
bit 23~21: Baudrate (bps)