![YOKOGAWA F3RS22-0N User Manual Download Page 56](http://html1.mh-extra.com/html/yokogawa/f3rs22-0n/f3rs22-0n_user-manual_3494923056.webp)
5-3
IM 34M6H21-01E
2nd Edition : Aug, 2001-00
5.3
Sample
Programs
The following shows an example for F3RS22-0N. The program can be used similarly for
F3RS41-0N (point-to-point) by declaring the use of RS41 in the ASSIGN statement.
z
Explanations for the sample programs
Send (1)
: Send with complete return access using the OUTPUT statement.
Send (2)
: Send with proceeding access using the TRANSFER / ON EOT
statements.
Receive (1) : Receive text input with complete return access using only the ENTER
statement.
Receive (2) : Receive text input with interrupt input using ENTER, ON INT / ENABLE
INTER statements.
100
! F3RS22-0N Example SEND (1)
110
!
120
DIM
SENDBUF$256
130
SLOT = 3 : PORT = 2
140
!
150
! Set communication conditions
160
ASSIGN RS22 = SLOT
:! Assign card
170
CONTROL SLOT, PORT, 14; 7
:! 9600bps
180
CONTROL SLOT, PORT, 13; 2
:! Even parity
190
SET TIMEOUT SLOT. PORT; 3000
:! Timeout 3 seconds
200
RESET SLOT, PORT, 1
:! Reset buffer
210
!
220
! Send Data
230
SENDBUF$ = “ABCDEFGhijkl – 0123456789”
240
OUTPUT SLOT, PORT; SENDBUF$
:! complete return access
(Type I)
250
END BSC : LIST
100
! F3RS22-0N Example SEND (2)
110
!
120
DEFINT
I
130
DIM SENDBUF$256, OUT$256
140
SLOT = 3 : PORT = 2
150
!
160
! Set communication conditions
170
ASSIGN RS22 = SLOT
:! Assign card
180
CONTROL SLOT, PORT, 14; 7
:! 9600bps
190
CONTROL SLOT, PORT, 12; 2
:! 2 stop bits
200
SET TIMEOUT SLOT. PORT; 3000
:! Timeout 3 seconds
210
RESET SLOT, PORT, 1
:! Reset buffer
220
!
230
! Send Data
240
SENDBUF$ = “ABCDEFGhijkl – 0123456789”
250
OUTPUT OUT$; SENDBUF$
:! Output to buffer
260
ON EOT SLOT, PORT GOSUB EOT@
:! Interrupt for end of transfer
270
TRANSFER SLOT, PORT FORMAT FROM OUT$
:! Start (type I)
280
!
290
! Other processing
300
WHILE IEND = 0
310
WAIT
320
END
WHILE
330
STOP
Summary of Contents for F3RS22-0N
Page 11: ...Blank Page...
Page 15: ...Blank Page...
Page 28: ...3 3 IM 34M6H21 01E 2nd Edition Aug 2001 00 External Dimensions Unit mm 83 2 28 9 2 12 1 100...
Page 31: ...Blank Page...
Page 59: ...Blank Page...
Page 63: ...Appx 3 2 IM 34M6H21 01E 2nd Edition Aug 2001 00 Blank Page...
Page 65: ...Blank Page...