37
MAS-6100 / MAS-6100A
MAS-6100 RS232 CONTROL SPECIFICATION
This section outlines how to control a unit via RS232 using ASCII-based commands. It details how to send and
receive serial data to perform many of the functions that a user has access to on the unit.
COMMUNICATION PROTOCOL BASICS
Packets of ASCII data containing hexadecimal numbers are exchanged between the unit and controller via an
RS232 or IP link (you cannot use both at the same time).
The RS232 standard is 57600 baud, 8 bits, no parity and 1 stop bit, although this can be changed by the user.
No fl ow control is used - however all control packets start with an ASCII ‘F’, end with carriage-return (13
decimal, 0x0D hex) and all such packets sent to the unit will be acknowledged (thereby providing software
handshaking). Note that a line-feed (LF 10 decimal, 0x00A hex) should not be sent.
It may take around 30ms (0.03 seconds) for an RS232 command to be actioned and acknowledged.
ASCII-hex data is used where a number is encoded into its hexadecimal equivalent with leading zeros – e.g.
Where ‘00’ is decimal value 0, ‘80’ is decimal 128 and ‘FF’ is decimal 255. In other words, two characters are
sent for each byte encoded.
Any gap of more than 1 second between the characters of a control command sent will cause a time-out - and
previous characters sent will be lost.
Write packets (sending command functions to the unit) are always 20 characters long (including a carriage
return at the end). The unit will respond with a full 20 character message indicating what has changed. This
returned payload will refl ect the actual value of the parameter changed. If the user requests a value out of
bounds then the limit value is used, and the payload will then refl ect the limited value used.
Read packets (sent to request information from the unit) are always 14 characters long (including a carriage
return at the end), the response from the unit will be a 20 byte message with the Write fl ag (since it is ‘writing’
the value back to the host) and the ACK fl ag set.
The ACK fl ag will be returned as 0 if the command is invalid for some reason – for example a bad FUNCTION,
WINDOW, OUTPUT or PAYLOAD value. An ACK=0 message will be otherwise identical to the one you sent,
so you know exactly which message has the error.
Any changes made to the unit using the front panel controls will also cause the full 20 byte message to be sent
indicating the change that has occurred, thus enabling a program to stay ‘in-sync’ with the unit. In some cases
(such as the execution of a macro) multiple 20 bytes messages will be sent indicating all the parameters that
have been changed.
Only one message should be sent to the unit, another message can’t be sent until a specifi c response is received
from the unit (the user should look for a message with the same WINDOW, OUTPUT and FUNCTION values
as they sent). If no message is received back within 1 second, there is likely to be a hardware communication
problem (or wrong baud rate, etc.).
If absolutely required, to simplify programming the user may send packets one after the other with around
100ms (100 milliseconds) between each one. However, this will not work for all packets (such as Zooming
into Testcards or changing Logos) since this will cause the unit’s micro-controller to be busy, so the user must
Содержание MAS-6100
Страница 36: ...36 MAS 6100 MAS 6100A...
Страница 50: ...50 MAS 6100 MAS 6100A...
Страница 53: ...MAS 6200...
Страница 54: ...MAS 6200...