11 - 429 11 - 429
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' This program outputs Kanji code to a printer connected to CH1
20 DIM TBL%(15)
:
' Defines an array
30 CH%=1
40 TBL%(0)=9600
50 TBL%(1)=&H108
60 TBL%(2)=&H1
70 ZOPEN #CH%,TBL%( )
:
' Opens the communication channel
80 TBL%(0)=18
:
' Specifies to set the communication control
parameters
90 TBL%(1)=0
100 TBL%(3)=1024
110 ZCNTL #CH%,0,TBL%( )
:
' Executes the setting
120 TBL%(0)=32
:
' Specifies to set the RS and ER control
signals to ON/OFF
130 TBL%(1)=&H101
140 ZCNTL #CH%,0,TBL%( )
:
' Executes the setting
150 TBL%(0)=100
:
' Specifies to set Kanji shift in/shift out
codes
160 TBL%(1)=1
:
' Specifies to change the codes
170 TBL%(2)=3
:
' Specifies the number of characters for
shift in codes
180 TBL%(3)=3
:
' Specifies the number of characters for
shift out codes
190 TBL%(4)=&H241B:TBL%(5)=&H40
:
' Specifies the shift in codes
200 TBL%(9)=&H481C:TBL%(10)=&H18
:
' Specifies the shift out codes
210 ZCNTL #CH%,0,TBL%( )
:
' Executes the setting
220 TBL%(0)=96
:
' Specifies to set Kanji code conversion
230 TBL%(1)=1
:
' Enables the Kanji code conversion
240 ZCNTL #CH%,0,TBL%( )
:
' Executes the setting
250 KMODE 1
:
' Kanji code conversion
260 ZLDV 1
270 SD$="Kanji"+CHR$(13)
:
' Defines data
280 PRINT SD$
290 LPRINT SD$
:
' Outputs to the printer
300 ZCLOSE #CH%
:
' Closes the communication channel
310 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...