Example, Purpose – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual
Page 168

Publication 1746-RM001A-US-P
12-18 Output Functions
Example
>1
REM EXAMPLE PROGRAM
>40 PUSH 31 : REM OFFSET ADDRESS = 31
>50 PUSH 3 : REM WORD LENGTH = 3
>60 CALL 85 : REM TRANSFER DATA TO DH485 COMMON INTERFACE
FILE
>70 POP R
>80 IF R<>0 PRINT “TRANSFER ERROR CODE = ”,R : REM PRINT
ERROR
READY
>RUN
READY
>
CALL 91 – Write BASIC
Output Buffer to Remote
DH485 Data File
Purpose
Use CALL 91 to write up to 40 words starting at word 0 of the module output
buffer to the remote DH485 data file at the designated node address, file number,
file type, and element offset. This routine has six input arguments and one output
argument.
The first input argument is the node address of the remote device (0 to 31). If the
number is not within the range 0 to 31, then the output argument equals 10, and
the write message does not take place.
The second input argument is the file number on the remote device (0 to 255). If
the number is not within the range 0 to 255, then the output argument equals 11,
and the write message does not take place.
The third input argument is the file type written to the remote device. Valid type
codes are ASC(N), ASC(S), ASC(C), ASC(T), ASC(B), and ASC(R). If the file
type is not one of these valid types, then the output argument equals 241, and the
write message does not take place.
The fourth input argument is the starting element offset within the file on the
remote device (0 to 32767). If the number is not within the range (0 to 32767),
then the output argument equals 12, and the transfer does not take place.
Table 12.4 File Type Written to the Remote Device
File Type
File Type Code
Words/Element
Integer File
ASC(N)
1 word/element
Status File
ASC(S)
1 word/element
Counter File
ASC(C)
3 words/element
Timer File
ASC(T)
3 words/element
Bit File
ASC(B)
1 word/element
Control File
ASC(R)
3 words/element