
7-6
Section
Details of BASIC Commands
193
<address> specifies the starting address of data transfer within the specified data area. The starting
address must be consistent with the address range of the specified data area. If the address given
lies outside the allowable range then a “FORMAT ERROR” (code B067) will result.
<number> specifies the number of data words to be read from the starting address given. The
maximum number of data words that can be transferred using
PC QREAD
is 128 words. This is only
possible with a C200HE/HG/HX PLC with no remote I/O. If any of the data to be read lie outside
the allowable range then a “FORMAT ERROR” (code B067) error will result.
<pc format> gives the format of the variables that are retrieved. For full details of these formats
see the
PC READ
statement.
<variable> is any valid variable name. It must be of the same type as that specified in the format
string otherwise a “FORMAT ERROR” will result.
The
PC QREAD
command can optionally return a <result> that can be assigned to a variable. This
<result> indicates the success, or otherwise of the
PC QREAD
command. If the <result> is 0 then
the command was successfully carried out and the data is written successfully. If the <result> is -1
then the
PC QREAD
could not be carried out because another data transfer was active.
The
PC QREAD
statement should be used in conjunction with the CPU Unit’s IOWR (#FD00)
instruction. By executing the
PC QREAD
statement, the ASCII Unit requests execution of the
IOWR instruction (through bit 15 of IR n+5); the requested data will be stored in the specified
variables when it is transferred by the IOWR (#FD00) instruction. The ASCII Unit will wait for
the data transfer by the IOWR (#FD00) instruction.
The data area, starting address, and number of bytes must be the same in both the
PC QREAD
statement and the IOWR instruction. If the starting address settings are different, the setting in the
IOWR instruction will be used. If the settings for the number of bytes are different, an error (code
0081) will occur.
Refer to Section 6 Data Exchange with the CPU Unit for more details on how to use the
PC
QREAD
statement.
The words specified for PC QREAD@ are not necessarily the words that will be transferred. The
addresses of the words are stored in words n+8 and n+9 and used for monitoring by the CPU Unit.
The words specified for IOWR will be transferred. (PC QREAD@ differs in this point from PC
READ@, which actually uses the addresses specified for it.)
If the addresses specified for IOWR cannot be used in PC QREAD@, specify dummy addresses
(in which case the CPU Unit will not monitor the specified words).
Examples:
See also:
PC QWRITE
,
PC READ
,
WAIT
PC QREAD “@D, 200, 10, S10H4”; A(1)
Содержание C200H-ASC11
Страница 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Страница 2: ...iv...
Страница 4: ...vi...