Call 28 – write to remote dh485 slc data file, Call 28 – write to remote dh485 slc data file -6, Example – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 156: Purpose

Advertising
background image

Publication 1746-RM001A-US-P

12-6 Output Functions

Example

>1

REM EXAMPLE PROGRAM

>10 REM ENABLE CALL 23 INTERRUPTS

>20 PUSH 2 : REM SEND DATA TO PRT1

>30 PUSH 1 : REM GET DATA FROM M0 FILE

>40 PUSH 0 : REM WORD OFFSET INTO M0 FILE

>50 PUSH 0 : REM STRING NUMBER/NOT USED HERE

>60 PUSH 1 : REM ENABLE BYTE SWAPPING

>70 CALL 23

>80 POP S : REM STATUS OF CALL SETUP

>90 IF (S<>0) THEN PRINT “UNSUCCESSFUL CALL 23 SETUP”

Below is a sample ladder logic program for CALL 23. The module is located in slot
1 of the SLC chassis. At rung 0000, copy data to the M0 file and set the handshake
bit (O:1.0/6) to inform the module that new data is available for port PRT1. Do
not send more data until the previous data has been acknowledged by the module.
The data file for the module begins with the byte count (40 in this example) at
N7:0. The data follows in N7:1-N7:20. The data byte count word is not included
in the data byte count. The copy instruction word length is 21. The byte count
maximum is 40 bytes (20 words) for this example.

At rung 2:1, unlatch the handshake bit from the SLC (O:1.0/6) for port PRT1
when the handshake bit from the module is set indicating the module has received
the data.

CALL 28 – Write to
Remote DH485 SLC Data
File

Purpose

Use CALL 28 to write up to 40 words of data from the CPU output image file,
CPU M0 file, and/or a string within the module to the remote DH485 file at the
designated node address.

0000

I:2

0

O:1

6

OSR

B3:0

0

B3

COP

Copy File
Source

#N7:0

Dest

#MO:1.0

Length

21

L

O:1

6

Input Switch

Handshake Bit from SLC
Processor to Module

Byte Count is located at N7:0.

Handshake Bit from SLC
Processor to Module

0001

I:1

6

U

O:1

6

0002

END

Handshake Bit from
Module to SLC Processor

Handshake Bit from SLC
Processor to Module

Advertising