Sunteți pe pagina 1din 6

Application Note

Note: This technote is not for use outside of Rockwell Automation.


Use this information as a guideline only.
A5246 - CALL 22 and CALL 23 Application Example
Previously Released as #A767

Product Category:
Product(s):
Catalog #s:
Series / Revision:
RA Only
Topic (Keyphrases):
Summary of Technote
Information:

Software Products - Other


PBase
N/A
Status: Released on 12/02/2000 (Modified on: 12/02/2000)

This example demonstrates the basic I/O capabilities of the


1746-BAS BASIC module when used in conjunction with the
SLC-500 processor M files.
Notes:
A 1747-CP3 cable is connected between PRT1 and PRT2 of the
BASIC module to provide instantaneous feedback into ST12:0 when
data is entered into ST11:0.
BASIC Module PRT1 = Input port
BASIC Module PRT2 = Output port

Note that the BASIC module is located in slot 2 of a 4-slot rack, as


shown in the I/O Configuration below.

Application Note Technote: CALL 22 and CALL 23 Application Example1

01/10/2005

The data test is entered into ST11:0 as shown below.

CALL 23 Operation:

Application Note Technote: CALL 22 and CALL 23 Application Example2

01/10/2005

ASCII data "test" is copied from ST11:0 into the M0 file. Once the
data is copied to the M0 file, the handshake bit O:2.0/7 it set. This
informs the BASIC module that new data is available for PRT2. The
data is then sent out PRT2 via CALL 23 in the BASIC module. No
new data will be sent until the previous data has been acknowledged
by the BASIC module.

CALL 22 Operation:
ASCII data coming into PRT1 of the BASIC module is transferred into
the SLC's M1 file via CALL 22 in the BASIC Module. When data is
available in the M1 file, the BASIC module sets handshake bit I:2.0/8.
The data is then copied from the M1 file to the ST12:0 string file.
Once the data has been copied, the SLC sets handshake bit O:2.0/8,
which tells the BASIC module to turn off bit I:2.0/8.

Application Note Technote: CALL 22 and CALL 23 Application Example3

01/10/2005

The data copied into ST12:0 shows exactly what was entered into
ST11:0 which proves that the CALL 22 and CALL 23 operations
executed properly.

The following code was used in the BASIC module:


10 MODE (PRT1,19200,N,8,1,N,R)
20 MODE (PRT2,19200,N,8,1,N,R)
30 PUSH 3 : REM SELECTS BASIC MODULE'S I/O BUFFERS TO
BE CLEARED
40 CALL 120 : REM CLEARS M0 AND M1 I/O BUFFERS
50 PUSH 4 : REM PRT2 IS SELECTED AS THE OUTPUT PORT

Application Note Technote: CALL 22 and CALL 23 Application Example4

01/10/2005

60 PUSH 1 : REM CPU M0 FILE IS SELECTED AS DATA SOURCE


70 PUSH 0 : REM WORD OFFSET WITHIN THE M0 FILE
80 PUSH 0 : REM IGNORE INTERNAL STRING
90 PUSH 1 : REM ENABLE BYTE SWAPPING
100 CALL 23 : REM TRANSFERS DATA FROM M0 TO PRT2
110 POP S : REM RETURNS STATUS OF CALL 23
120 PRINT S : REM PRINTS CALL 23 STATUS TO THE SCREEN
130 PUSH 1 : REM PRT1 IS SELECTED AS THE INPUT PORT
140 PUSH 126 : REM ALLOWS 126 CHARACTERS(MAX) TO BE
SENT TO THE M1 FILE
150 PUSH 13 : REM SELECTS CARRAIGE RETURN AS
DELIMITER(13=0D)
160 PUSH 1 : REM SELECTS M1 FILE AS DESTINATION FOR
THE DATA
170 PUSH 0 : REM SETS THE OFFSET INTO THE M1 FILE
180 PUSH 0 : REM IGNORE INTERNAL STRING
190 PUSH 1 : REM ENABLES BYTE SWAPPING
200 CALL 22 : REM TRANSFERS DATA FROM PRT1 TO THE M1
FILE
210 POP S : REM RETURNS STATUS OF CALL22,
0=SUCCESSFUL
220 IF (S<>0) THEN PRINT "CALL 22 WAS UNSUCCESSFUL"
230 GOTO 230 : LOOP FOR CONTINUOUS RUN

Documents Requiring Click-Wrap Agreements:

RA Internal Use Only:


History and Comments:
06/24/98 Joseph C Zappitelli - Created this technote
07/15/98 Joseph C Zappitelli - Changed from Unpublished to RSI
07/18/98 Scott A Herrick - changed status of all RSI & Corporate technotes to RA with an agent
10/31/98 Joseph C Zappitelli - Changed from RA to Unpublished (changing from RA to public)
10/31/98 Joseph C Zappitelli - Changed from Unpublished to Public
03/11/99 Joseph C Zappitelli - Changed from Public to Unpublished
12/01/2000 - Last update as RSI Support Library Technote
11/5/01 - Technote imported into combined Knowledge Base from RSI Support Library Technote
11/5/01 Agent Modified - Added General Category Software Products - Other.
11/13/01 - Agent modified - Status changed from Draft-Revision to Released, Internal Only
Edit Information:
Assigned
To:
Author:

Additional
Authors:
Author

Application Note Technote: CALL 22 and CALL 23 Application Example5

01/10/2005

Joseph C Zappitelli
Date
Created:

06/24/1998

Most
12/02/2000
Recent
Publish
Date:
Reviewers:

Name:
Original
Publish
Date(s):
Last
Modified
Date:

Application Note Technote: CALL 22 and CALL 23 Application Example6

Joseph C Zappitelli/Rockwell Software/US


12/02/2000 05:58:35 AM
12/02/2000

01/10/2005

S-ar putea să vă placă și