beautypg.com

ProSoft Technology MVI56-BAS User Manual

Page 186

background image

BASIC CALLs Syntax

MVI56-BAS ♦ ControlLogix Platform

User Manual

BASIC Module (DB/BAS Compatible)

Page 186 of 234

ProSoft Technology, Inc.

December 13, 2011

H = CALL status
0 = successful setup
1 = disabled
2 = invalid parameter
3 = PRT2 already enabled for DF1 protocol
4 = string too small
5 = string not dimensioned

Example:

10 PUSH 1: REM PRT1 active for CALL 22
20 PUSH 10: REM Receiving 10 bytes of data maximum
30 PUSH 13: REM used as termination character
40 PUSH 1: REM send data to MSG instruction
50 PUSH 0: REM Offset into MSG instruction data
60 PUSH 0: REM String number (not used)
70 PUSH 1: REM Byte swapping enabled
80 CALL 22
90 POP S: REM Status of CALL 22 setup
100 IF(S<>0) THEN PRINT "Unsuccessful CALL 22 setup"
110 IF(S<>0) THEN END
120 GOTO 120
or
10 PUSH 1,10,13,1,0,0,1: CALL 22: POP S
20 IF(S<>0) THEN PRINT "Unsuccessful CALL 22 setup"
30 IF(S<>0) THEN END
40 GOTO 40