
7-6
Section
Details of BASIC Commands
195
<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 write from the specified starting
address. The maximum number of data words that can be transferred using
PC
QWRITE
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) will result.
<pc format> gives the format of the variables that are retrieved. For full details of
these formats see the
PC READ
statement.
<numerical expression> is any valid BASIC is any valid numerical expression
with an integer result in the range : [-32768…32767]. If the numerical expression
is not an integer it will be rounded to an integer before transfer.
The
PC QWRITE
command can optionally return a <result>. This <result> indicates
the success, or otherwise of the
PC QWRITE
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 QWRITE
could not be carried out because another data
transfer was active.
The
PC QWRITE
statement should be used in conjunction with the CPU Unit’s
IORD (#FD00) instruction. By executing the
PC QWRITE
statement, the ASCII
Unit requests execution of the IORD instruction (through bit 14 of IR n+5) in
preparation for the transmission of the data from the specified variables. The data
will be read from the ASCII Unit when the IORD (#FD00) instruction is executed.
The ASCII Unit will wait from the time the
PC QWRITE
command is executed until
the data is transferred by the IORD (#FD00) instruction.
The data area, starting address, and number of bytes must be the same in both the
PC QWRITE
statement and the IORD instruction. If the starting address settings are
different, the setting in the IORD 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 QWRITE
statement.
The words specified for PC QWRITE@ 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 IORD will be
transferred. (PC QWRITE@ differs in this point from PC WRITE@, which
actually uses the addresses specified for it.)
If the addresses specified for IORD cannot be used in PC QWRITE @, specify
dummy addresses (in which case the CPU Unit will not monitor the specified
words).
Examples:
See also:
PC QREAD
,
PC WRITE
,
WAIT
PC QWRITE “@D, 200, 5, 1H4 1H4 1H4 1H4 1H4”; A(1), A(2), A(3), A(4), A(5)
Содержание C200H-ASC11
Страница 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Страница 2: ...iv...
Страница 4: ...vi...