and the Error Response is always the string:
!ERR<CR><LF>
Byparsingonlytheprexcharacters‘+’and‘!’,aprogrammercanchosetoignoretheerror
codesandsimplylookattherstcharactersoftheresponsestringsandusethemasapass/
fail indicator when issuing a command.
All response strings always end with a <CR><LF>.
A Query Response string always starts with the ‘=’ characters and is followed by a command
string indicating the parameter being returned. This is better explained in an example.
Here’s an example of a querying a device for its light intensity settings:
LI?<CR> Sent: Light Intensity Query command
+<CR><LF> Received: Acknowledgement of command
=LI 2,13<CR><LF> Received: Light Intensity Query Response
Note that a “+<CR><LF>” followed the command string. A command string is always followed
by either an Acknowledgment (as in this case) or an Error Response. This consistency allows
a driver to use a single routine to issue a command and check for an Acknowledgement or an
Error Response String, whether or not the command queries for a response.
An example of an error response:
IL?<CR> Sent: Command characters transposed, no such command
!2<CR><LF> Received: Error Response indicating unknown command
In this case the Error Response string “!2<CR><LF>” was issued instead of the acknowledg-
ment string since the command was not recognized.
Response String Checksums and CRC-8 Checkcodes
ResponsestringscanbeprogrammedtohavechecksumsorCRC-8checkcodesappendedto
them,thesyntaxisidenticaltotheCommandStructure’schecksumandCRC-8handling.
ChecksumandCRC-8areturnedonandoffbyissuingthepropercommand.Onmostdevices
this is the “Control Settings” command.
Only the Error Response and The Query Response strings will have checksum and CRC-
8checkcodesappendedtothem.TheAcknowledgmentResponsewillalwaysconsistof
“+<CR><LF>”.Anythingelsemustbeassumedtobeacommunicationerror.
An example with checksumming enabled, while querying for LED intensities is:
LI?<CR>
+<CR><LF>
=LI 2,13;239<CR><LF>
AnexamplewithCRC-8responsesenabledis:
LI?:194<CR>
+<CR><LF>
=LI 2,13:87<CR><LF>
Noticethatintherstexampleachecksumwasnotappendedtothe“LI?” command. When
issuingacommandthechecksumandCRC-8codesaresentonacommandbycommand
basis.AnytimeachecksumoraCRC-8codeisappendedtoacommanditwillbecheckedand
validatedbythedevice,regardlessofthe“ResponseChecksum/CRC-8”settings.
WhenResponseChecksums,orResponseCRC-8Checkcodesareenabled,ErrorResponse
stringswillalsohavechecksumandCRC-8codesappendedtothem.
Master / Slave and Asynchronous Modes of Operation
TheK.I.S.S.™protocolcanbeusedinaMaster/Slavemode,whereresponsesareonlysent
when requested, or in an Asynchronous mode, where responses are sent whenever the opera-
tional state of the device changes, such as a front panel button being pressed.
The Master / Slave Mode of Operation
IntheMaster/Slavemode,thecontrollerrequestsinformationfromthedeviceatpolled
intervals. The control program assumes the role of the master, and the device is operated in the
slavemode.Noinformationwillbesentfromthedevicewithoutrstreceivingarequestfromthe
controller.
For controllers that cannot handle having information being sent to them in the background, or at
unspeciedtimes,theMaster/Slavesettingisideal,sinceallstatechangeswillbeloggedbut
not sent until requested by the controller.
ToallowformoreefcientMaster/Slaveoperations,thereisaQueryStatuscommandavailable
tothecontrollerthatreturnthestatusstateofthedeviceasabitmapofagsindicatingwhich
states have changed and need querying. This allows the controller to poll, using a single com-
mand,andthenbasedonthoseagsettings,issueonlythecommandsneededtoreadthenew
state(s) of the device.
TheMaster/Slavemodealsoallowsforapredictablecommunicationsow.Acommunication
sequence is always started by the controller by issuing a command. The response will always be
either the Acknowledgement Response, or an Error Response, followed by (if a query command
was issued) the Query Response. For instance:
LI ?<CR> Sent: Controller issues a query command.
+<CR><LF> Received: Acknowledgment (or possible Error) Response.
=LI 2,13<CR><LF> Received: Query Response.
IntheMaster/Slavemode,theAcknowledgementorErrorResponsewillalwaysbethenextre-
K.I.S.S.™ (Continued) K.I.S.S.™ (Continued)