EasyManua.ls Logo

Nidec SM-Applications Series - Page 89

Nidec SM-Applications Series
132 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SM-Applications Modules & Motion Processors User Guide 89
Issue Number: 4
Safety
Information
Introduction Installation
Getting
Started
Parameters
DPL
Programming
Communications
Freeze and
Marker
CTSync
Inter-option
Synchronization
Diagnostics
Migration
Guide
Quick
Reference
Index
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:

Table of Contents

Related product manuals