![LiCONiC StoreX Series Скачать руководство пользователя страница 72](http://html1.mh-extra.com/html/liconic/storex-series/storex-series_operating-manual_1907204072.webp)
StoreX
Series
STX_V078.doc
71
CMa,
23.11.2009
These examples show how simple communication becomes when using the
“STX_ReadBack” procedure. The following example explains how often used
sequences are programmed. The ‘Set-‘procedure sets an internal relay (or flag).
The value of the flag becomes ‘1’. The ‘Reset-‘procedure resets an internal relay
(or flag) . The value of the flag becomes ‘0’. Flags can be set, reset or read.
FUNCTION STX_Set(pN,rel:INTEGER):STRING;
VAR sR:STRING;
BEGIN
Str(rel,sR);
STX_Set:=STX_ReadBackStr(pN,'ST '+sR)
END;
FUNCTION KV_Reset(pN,rel:INTEGER):STRING;
VAR sR:STRING;
BEGIN
Str(rel,sR);
STX_Reset:=STX_ReadBackStr(pN,'RS '+sR)
END;
FUNCTION STX_Read(pN,rel:INTEGER):STRING;
VAR sR:STRING;
BEGIN
Str(rel,sR);
STX_Read:=STX_ReadBackStr(pN,'RD '+ sR)
END;
The Set and Reset will return an ‘OK’-response if operation is successful. The
Read-procedure will return a ‘0’ or ‘1’.
Data memories are 16 bit oriented. They can be read or written. The following
examples show how to use the data memories.
FUNCTION STX_ReadDataMemory(pN,nbr:INTEGER):STRING;
VAR sR:STRING;
BEGIN
Str(nbr,sR);
STX_ReadDataMemory:=STX_ReadBackStr(pN,'RD DM'+ sR)
END;
FUNCTION STX_WriteDataMemory(pN,nbr:INTEGER; valu:WORD):STRING;
VAR sR,sV:STRING;
BEGIN
Str(nbr,sR); Str(valu,sV);
STX_ReadDataMemory:=STX_ReadBackStr(pN,'WR DM'+ sR + ' ' + sV)
END;
Note that the Response on the above Write procedure is always ‘OK’. The Read
procedure will return a five-character-string.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com