
SM-Applications Modules & Motion Processors User Guide
89
Issue Number: 4
S
Info
rm
In
Inst
al
G
Pa
ra
DP
L
Pr
Co
m
F
CT
S
In
S
D
M
Q
In
ANSIREPLY examples:
The first output argument returns the status of the ANSIREPLY command and can be
one of the following values:
-65536 = No reply received yet
-65537 = Reply received, but with bad checksum
-65538 = EOT received (i.e. parameter does not exist)
-65539 = NAK received
-65540 = ACK received
Result% = ANSIREADN(12, 1811) //perform ansi read
//has message been sent successfully
IF Result% = 0 THEN
//message not sent successfully
goto top:
ENDIF
Timeout% = 0 //message sent successfully so intialise timeout
DO
(status%, reply%) = ANSIREPLY()// get status and value of read
DELAY(1)
// delay 100ms
LOOP WHILE Status% = -65536 AND Timeout% < 50 //Timeout=50xclock timebase
Background{
top:
Value% = #18.11
Result% = ANSIWRITEN(12, 1811, Value%, 1);write value to remote drive
IF Result% = 0 THEN
//message not sent successfully
goto top:
ENDIF
CALL get_reply: //get reply
GOTO top:
} //Background
get_reply:{
Timeout% = 0
DO
(Status%, Reply%) = ANSIREPLY()
LOOP WHILE Status% = -65536 AND Timeout% < 50
} //get_reply:
Содержание Digitax ST Indexer
Страница 131: ......
Страница 132: ...0471 0062 04...