Rockwell-automation 1746-BAS BASIC LANGUAGE User Manual Page 215

  • Download
  • Add to my manuals
  • Print
  • Page
    / 280
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 214
Publication 1746-RM001A-US-P
Input Functions 13-25
Example
>1 REM EXAMPLE PROGRAM
>30 PUSH 1 : REM REMOTE NODE ADDRESS = 1
>40 PUSH 0 : REM OFFSET = 0
>50 PUSH 10 : REM WORD LENGTH = 10
>60 PUSH 5 REM TIME-OUT VALUE = 0.5 SECONDS
>70 CALL 92
>80 POP R : REM GET THE OUTPUT ARGUMENT
>90 IF (R<>0) THEN PRINT “READ ERROR CODE IS”,R : REM PRINT
ERROR
READY
>RUN
READ ERROR CODE IS 5
CALL 117 – Get DF1
Packet Length
Purpose
Use CALL 117 to get the length of the DF1 data packet. This routine has no input
arguments and one output argument. The output argument returns the length of
the oldest DF1 packet queued up in the DF1 receive buffer.
.
When CALL 117 is read in a program, the module checks to see if DF1
communications has been enabled through CALL 108. If DF1 communications
have not been enabled, an error message is printed to the console device and the
module enters Command mode.
After the length of the DF1 packet has been retrieved, it must be used in
conjunction with the GET statement to retrieve the data in the received DF1
packet.
Syntax
CALL 117
POP [length of DF1 packet]
Example
>1 REM EXAMPLE PROGRAM
>10 CALL 117
>20 POP X
>30 END
IMPORTANT
If the receive buffer is found empty, then 0000 is returned to the
argument stack.
Page view 214
1 2 ... 210 211 212 213 214 215 216 217 218 219 220 ... 279 280

Comments to this Manuals

No comments