11 - 421 11 - 421
MELSEC-Q
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)
:
' Defines arrays
30 CH%=1
:
' Specifies the communication channel
40 TBL1%(0)=9600
50 TBL1%(1)=&H108
60 TBL1%(2)=&H1
70 ZOPEN #CH%,TBL1%( )
:
' Opens the communication channel
80 TBL2%(0)=33
:
' Specifies to read the status
90 ZCNTL #CH%,0,TBL2%( )
:
' Executes the read operation
100 A=RDSET(0,TBL2%(1))
:
' Reads the bit
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: ";
:
' Displays the status
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%
:
' Closes the communication channel
260 END
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...