Writing To Pc Cpu Bit Device Memory (Bit Units Batch Write) - Mitsubishi Electric AJ71QC24 Manual

Melsec qna serial communications module
Table of Contents

Advertisement

4. COMMUNICATIONS USING A DEDICATED
PROTOCOL
MELSEC
QnA
Writing to PC CPU Bit Device Memory (Bit Units Batch Write)
1000
1010
1020
1030
1040
1050
1060
1070
1080
1090
1100
1110
1120
1130
1140
1150
1160
1170
L1S0
1190
1230
1210
1220
1230
1240
1250
1260
1270
1280
1290
1300
1310
1320
1330
1 3 1 0
1350
1360
1370
1330
1390
1400
1410
1420
1430
1440
1450
1460
1470
1430
1490
1500
1510
1520
1530
This section inputs O(OFF)/l (ON) from an external device and writes them to PC CPLl bit devices
Y70 to Y77 (8 points).
4.8.1
External device Droclram
AJ71QC24 Comcand 1401 Sanple Program
ASCII Mode
(Batch write to Sit devices Y73
-
Y77j
*ST1
C L S
WTCNT%
=
10
DLCNT%=1000
ACCNT%=11
NACNT%=15
ERFLG%=O
RVCNT%
=
0
CH%
=1
EKQ$
=CHR$
! & H 5 j
ACK$
=CHR$!&H6)
NAK$
=CHR$!&H15)
:'Clear screen
:'Data receive wait retry counter
:
'Counter for data receive wait time adjustment
:
'Receive data length when ACK received
:'Receive data length when KAK received
:'Error flag storage at end of reception
:'Receive request data count storage
:'Channel No.
:
'ENQ code
:
'
ACK code
:
'NAK code
*REC1
IF BUF$=ACK$ TEEN 3.VCNT%=ACCNT%-1
:'Set receive request character count to 10.
IF BUF$=NAK$ TEEN RVCTJT%=NACNT%-l
:'Set receive request character count to 14.
GOSUB *JYUSIN
:'Receive request
IF ERFLG%=99
THEN
*ERFIN
:'Not received
EU?$=BUF$+RCV$
:'Storage all receive data to BUF$.
CHK$=ACK$+"F9000OFFOO"
:'Normal
erd response
message
structure
4
-
31

Advertisement

Table of Contents
loading

This manual is also suitable for:

Aj71qc24-r2Aj71qc24-r4

Table of Contents