EasyManuals Logo

Control Techniques UD70 User Manual

Control Techniques UD70
154 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #76 background imageLoading...
Page #76 background image
UD70
Issue code: 70nu2
6-16 Serial communications
6.6 Example ANSI instructions
The following program fragment gives an example of reading a speed
reference from a Unidrive, and writing it to a CD Drive.
Both Drives are connected to the RS485 bus. The Unidrive is at address 11;
the CD Drive is at address 12.
For this program to operate, the RS485 mode should be set at 6.
BACKGROUND{
top:
// send read command to read parameter #1.21
result% = ANSIREAD(11, “0121”)
IF result% = 0 THEN
PRINT “Message could not be sent”
GOTO top:
ENDIF
CALL get
_reply: // get reply from read command
IF reply% <= –65536 THEN // valid reply?
PRINT “Error in reading data from Unidrive”
GOTO top:
ENDIF
// send write command to CD, using 1 decimal place
result% = ANSIWRITE(12,”SP”, reply%, 1)
IF result% = 0 THEN
PRINT “Message could not be sent”
GOTO top:
ENDIF
CALL get
_reply: // write accepted?
IF reply% <> -65540 THEN // –65540 is ACK
PRINT “Error in sending message to CD
ENDIF
GOTO top:
}
get_reply: { // sub-routine to wait for a reply
timeout% = 0 // reset timer
DO
// returns –65536 if the reply has not been received yet
reply% = ANSIREPLY
LOOP WHILE reply% = –65536 AND timeout% < 50
// loop exits only when a reply has been received, or
// a time-out has occurred.
// if the clock task is set at 5ms, the timeout will be 250ms
}
CLOCK {
timeout% = timeout% + 1 // increment timeout variable
}
Note
Refer to the help file in the DPL Toolkit for further
examples of the ANSI commands.

Table of Contents

Other manuals for Control Techniques UD70

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Control Techniques UD70 and is the answer not in the manual?

Control Techniques UD70 Specifications

General IconGeneral
BrandControl Techniques
ModelUD70
CategoryControl Unit
LanguageEnglish

Related product manuals