Mitsubishi QD51 Programming Manual page 681

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

APPENDIX
Appendix 7.3 Break Control
Appendix 7.3.1 Break character specifying side
10 DIM TBL1%(2),TBL2%(4),TBL3%(2)
20 TBL1%(0)=9600
30 TBL1%(1)=&H108
40 TBL1%(2)=&H1
50 ZOPEN #2,TBL1%( )
60 TBL2%(0)=22
70 TBL2%(1)=2
80 TBL2%(2)=&H30D
90 ZCNTL #2,0,TBL2%( )
100 RD$=SPACE$(100)
110 TBL3%(0)=100
120 TBL3%(2)=200
130 ZRECEIVE #2,0,TBL3%( ),RD$
Memory addresses for
data stored in RVBUF$
(offset address)
App - 36
If a BASIC program in the communication module receives data from an external
device, only data up to the break character specified by the control interface is stored
in the variable.
If the break character is not detected within the number of characters requested at a
receive request, reception data for the number of requested characters is stored in the
variable.
The break character can be specified in the ZRECEIVE instruction used to request
data reception.
(Depending on the character length at the time of transmission, any data
corresponding to the codes from 00h to FFh can be specified as the break character.)
The following is an example where character data corresponding to codes 03h and
0Dh is specified as the break character in the ZRECEIVE instruction and the received
data is entered. It is assumed that the communication channel is already open.
In this case, the amount of received data (number of bytes) returned to the BASIC
program is returned to TBL%(1). Also, when the break character is detected by the
system program, the detected break character is included in the last data received
within RVBUF$.
(Example)
indicates a space (20
When the reception data "0123456
The content of RVBUF$ prior to the
execution of the ZRECEIVE instruction
The content of RVBUF$ after the
execution of the ZRECEIVE instruction
RVBUF$
: ' Opens the channel
: ' Specifies to set the break character
: ' Specifies the number of break characters (2 types)
: ' Specifies the break characters (&H03 and &H0D data)
: ' Executes the break character setting
: ' Stores a dummy
: ' Number of requested bytes (100 byte)
: ' Timeout value (20 seconds)
: ' Executes the reception operation
C
) and
the carriage return (0D
H
R
C
" is returned:
R
• • •
"
• • •
"0123456
Prior to reception
0
20
H
1
20
H
2
20
H
3
20
H
4
20
H
5
20
H
6
20
H
7
20
H
8
20
H
99
20
H
MELSEC-Q
) code.
H
• • • •
"
(for 100 bytes)
C
" (for 100 bytes)
• •
R
After reception
30
H
31
H
32
The value 8 is returned
H
in TBL%(1).
33
H
34
H
35
H
36
H
0D
H
20
H
Data prior to reception
is stored as is.
20
H
App - 36

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents