Download User Manual
Transcript
SERIAL PROTOCOL To communicate with AMS III means sending and receiving messages, typically only text messages in ASCII format. We said “typically” since the user can define the protocol, so it is possible that he will use nottext characters for communication. What we are going to describe is the protocol default set during the final testing of the device. The serial protocol uses three types of fields: 1. Control, this type is used for: a. Identity, it indicates the basic address identifying the AMS corresponding to the message destination; it generally consists of maximum two digits. b. Separator, it is a character utilized to logically separate the fields between them. c. End of the message, it is a character indicating the end of the message. 2. Command, it is composed by three ASCII characters and it identify the command the AMS has to run. 3. Parameter/s Zero or a maximum 15 specifics parameters of the command to run. Here below a practical example of how a command sent to AMS can be composed: IDENTITY CONTROL SEPARATOR CONTROL COMMAND SEPARATOR CONTROL PARAMETER 1 SEPARATOR CONTROL ... SEPARATOR CONTROL PARAMETER N END OF MESSAGE CONTROL Let’s see a real message: 0,REVCR in C language the string is defined as follows: “0,REV\r” Analyzing it: The character ‘0’ is the identifying number of AMS, the character ‘,’ is the separator, ‘REV’ is the command, ‘\r’ e’ is the character of control of end string. If you are using only one AMS by the serial port, it is possible to skip the CONTROL IDENTITY, so the previous message becomes: “REV\r” AMS III User Manual © 2010 DTA srl 11