4 - 2 4 - 2
MELSEC-Q
4 THE EXCHANGE BETWEEN THE PLC AND BUFFER MEMORY
4
4.2 The Exchange with the PLC
The following data exchange is performed between the PLC CPU and BASIC.
• Read and write of devices within the PLC CPU
• Read and write of the buffer memory within the special function module
• Read and write of the control of the PLC CPU
• Read and write of the sequence programs and parameters, etc.
The PCRD and PCWT instructions are used to perform these processes.
AD51H-BASIC can use floating decimal point data used by
AnA/AnU/AnUSCPU.
For details, see CVSMBF and MKSMBF functions.
4.2.1 Control tables
The idea of “Control Tables” is used since many parameters are required to execute
the PCRD and PCWT instructions. The control tables are a type of memory used to
hand over parameters that are used to notify the process contents to the system when
the above processes are performed by the BASIC program.
The BASIC program stores the necessary parameters in one array, and the
parameters are handed to the system by specifying only the array name during
execution.
For example, to read the device descriptions of the PLC CPU, the PLC station number,
device read designation, bit/word designation, read head device, number of points
read, and the parameter settings of the data storage variable must be set. If many
parameters are arranged following the instruction, the program becomes hard to read.
When the control tables are used, the actual instruction become easier to see, and the
parameters can be written so that they are understood easily.
Using Control Tables
100 RD%(0)=1
:’
Station Number
110 RD%(1)=1
:’
Read Designation
120 RD%(2)=2
:’
Word Unit
130 RD%(3)=1
:’
Device Code
140 RD%(4)=&H10
:’
Head Device No,
150 RD%(5)=1
:’
Reads 1 word
200 PCRD RD%( ), A%( )
Содержание 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...