![LiCONiC StoreX Series Скачать руководство пользователя страница 70](http://html1.mh-extra.com/html/liconic/storex-series/storex-series_operating-manual_1907204070.webp)
StoreX
Series
STX_V078.doc
69
CMa,
23.11.2009
8.2.2 Command
Syntax
For communication only a few commands are required. A command is an ASCII-
string which is sent to the controller. Response is an ASCII string sent by the
controller. Note that each command is prompted by a Response string.
A command consists of command segments. The first command segment defines
the intention of the command. Command segments are separated by Space
(ASCII 20h). Response Segments are separated by comma (ASCII 1Ch). The
table below gives a list of abbreviations used later on.
Command Segment
Mnemonics
Communication Request
CR
Communication Quit
CQ
Communication Clear
CC
Communication Finished
CF
Set ST
Reset RS
Read RD
Write WR
Write Set
WS
Data Memory
DM
Timer T
Space ASCII 20h
sp
Line Feed ASCII 0Ah
lf
Carriage Return ASCII 0Dh
cr
The following example program shows how a string sent to the StoreX controller
can be generated and sent. The “STX_SendStr” will allow a string “s” to be sent
through port “pN”. The result of the function may be used for error handling. Note
that the string “s” does not require any delimiter. The delimiter is added inside the
function. The “auxStrAut” may be any low level or DOS procedure that supports
the transmission through the comport.
FUNCTION STX_SendStr(pN:INTEGER; s:STRING):INTEGER;
VAR ss:STRING;
BEGIN
STX_SendStr:=0;
ss:=Concat(s,cr);
auxStrOut(pN,ss)
END;
Since every command is prompted by the StoreX it makes sense to introduce a
procedure that handles this send-receive sequence. A possible solution is given
below.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com