Mitsubishi QD51 Programming Manual page 591

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' This program reads the ON/OFF status of the CS, DR, RS, ER, and CD control signals
20 DIM TBL1%(2),TBL2%(3)
30 CH%=1
40 TBL1%(0)=9600
50 TBL1%(1)=&H108
60 TBL1%(2)=&H1
70 ZOPEN #CH%,TBL1%( )
80 TBL2%(0)=33
90 ZCNTL #CH%,0,TBL2%( )
100 A=RDSET(0,TBL2%(1))
110 B=RDSET(8,TBL2%(1))
120 C=RDSET(0,TBL2%(2))
130 D=RDSET(8,TBL2%(2))
140 E=RDSET(0,TBL2%(3))
150 PRINT "CS control signal: ";
160 IF A=1 THEN PRINT "ON" ELSE PRINT "OFF"
170 PRINT "DR control signal: ";
180 IF B=1 THEN PRINT "ON" ELSE PRINT "OFF"
190 PRINT "RS control signal: ";
200 IF C=1 THEN PRINT "ON" ELSE PRINT "OFF"
210 PRINT "ER control signal: ";
220 IF D=1 THEN PRINT "ON" ELSE PRINT "OFF"
230 PRINT "CD control signal: ";
240 IF E=1 THEN PRINT "ON" ELSE PRINT "OFF"
250 ZCLOSE #CH%
260 END
11 - 421
:
' Defines arrays
:
' Specifies the communication channel
:
' Opens the communication channel
:
' Specifies to read the status
:
' Executes the read operation
:
' Reads the bit
:
' Displays the status
:
' Closes the communication channel
MELSEC-Q
11 - 421

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents