Syntax, Example – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 204

Advertising
background image

Publication 1746-RM001A-US-P

13-14 Input Functions

When CALL 29 is executed, the transfer is attempted. If the selected CALL (27,
28, 122, or 123) is not executed before CALL 29, a 1 is returned in the status
POPped. When CALL 29 is executed successfully, the value in the first character of
the string (transaction number) is incremented to designate that the transfer
occurred. The range of this character is 0 through 255.

After CALL 29 is executed, one word is POPped. This word is the status of the
transaction:

0 – Successful completion

1 – The chosen CALL (27, 28, 122, or 123) is not active

255 – SLC buffer is chosen for CALL 27, 28, 122, or 123 and CALL 29 is
ignored

All other codes are identical to CALL 90/92

Syntax

PUSH [27, 28, 122, or 123 for the CALL you want activated]

CALL 29

POP [status of transaction]

Example

CALL 122 must be enabled with internal string only prior to executing CALL 29
in this example. Upon execution of CALL 29, an attempt is made to transfer one
element from integer file 10, starting at element 0 of the PLC-5 at node 3, to the
internal string $(1) of the module.

>1

REM EXAMPLE PROGRAM

>10

REM EXECUTE DF1 PLC REMOTE READ FROM INTERNAL

>20

REM STRING WITH NO SLC INTERVENTION

>21

REM SET UP CALL 122

>25

PUSH 5, 3, 10, ASC(N), 0, 10, 10, 1, 1, 1: CALL 122: POP

STATUS

>30

PUSH 122

>40

CALL 29

>50

POP S

>60

IF (S=1) THEN PRINT “CALL 122 NOT ACTIVE”

>70

IF (S=255) THEN PRINT “SLC FILE CHOSEN FOR CALL 122”

>80

IF (S=0) THEN PRINT “SUCCESSFUL TRANSFER”

>90

IF (S<>0) THEN PRINT “UNSUCCESSFUL TRANSFER”

>100 END

CALL 29 replaces the handshaking bit function in CALLs 27, 28, 122, and 123
when using an SLC file or module string.

Advertising