11 - 67 11 - 67
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
FIELD
Instruction
FIELD
• Assigns the area for the specified variable to the random file buffer.
FIELD <#> <file number> , <field length> AS <character string variable> [, <field length>
AS <character string value> ] …
file number
• • • •
Specify the file number of the random file specified
by the OPEN instruction.
field length
• • • •
Specify the number of characters to assign to the
buffer.
Syntax
character string variable
• • • •
Specify the character string variable that
corresponds to the part specified by the field length.
Examples
FIELD #1, 128 AS A$, 128
AS B$
• • • •
Defines variables A$ and B$, which are used in the
program, in the random file buffer of file number 1,
and specifies 128 bytes as the assigned number of
bytes for each.
Buffer in the random file
A$
B$
128 bytes
128 bytes
Description
• The FIELD instruction assigns an area of the specified variable in the random file buffer
that is specified by <file number>. The program writes and reads data with the random file
buffer through these variables.
• The FIELD instruction has to be executed before reading data by the GET instruction or
writing data by the PUT instruction.
• Use the LSET instruction and RSET instruction to write data to the random file buffer.
• The total number of bytes (total of <field length>) retained by one FIELD instruction should
not exceed the buffer size (256 bytes). A “Field overflow” error occurs if the total number of
retained bytes exceeds 256.
REMARK
• Multiple FIELD instructions can be executed in the random file buffer of the same
file number. Each FIELD instruction assigns the variable from the beginning of the
random file buffer, so all assignments become valid simultaneously.
• See the OPEN instruction and Chapter 6.
Содержание 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...