
BASIC commands
PROGRAMMING MANUAL
111
R
e
vi
si
o
n
1
.0
/i
/i
/i
/i
Description
The
HLM_READ
command reads data from a Host Link Slave by sending a
Host link command string containing the specified node of the Slave to the
serial port. The received response data will be written to either VR or TABLE
variables. Each word of data will be transferred to one variable. The maximum
data length is 30 words (single frame transfer).
Program execution will be paused until the response string has been received
or the timeout time has elapsed. The timeout time is specified by using the
HLM_TIMEOUT
parameter. The status of the transfer can be monitored with
the
HLM_STATUS
parameter.
Notes:
•
When using the
HLM_READ
, be sure to set-up the Host Link Master pro-
tocol by using the
SETCOM
command.
•
The Host Link Master commands are required to be executed from one
program task only to avoid any multi-task timing problems.
Arguments
•
port
The specified serial port. 1 = RS-232C serial port 1; 2 = RS-422A serial
port 2.
•
node
The Slave node number to send the Host link command to. Range: [0,
31].
•
plc_area
The PLC memory selection for the Host link command. See the table
below.
pc_area value
Data area
Host link command
PLC_DM
(or value 0)
DM area
RD
PLC_IR
(or value 1)
CIO/IR area
RR
PLC_LR
(or value 2)
LR area
RL
PLC_HR
(or value 3)
HR area
RH
PLC_AR
(or value 4)
AR area
RJ
PLC_EM
(or value 6)
EM area
RE
•
plc_offset
The address of the specified PC memory area to read from. Range: [0,
9999].
•
length
The number of words of data to be transferred. Range: [1, 30].
•
mc_area
The memory selection of the TJ2-MC64 to read the send data from. See
the table below.
mc_area value
Data area
MC_TABLE
(or value 8)
TABLE variable array
MC_VR
(or value 9)
Global (VR) variable array
•
mc_offset
The address of the specified TJ2-MC64 memory area to write to. Range
for VR variables: [0, 63999]. Range for TABLE variables: [0, 499999].
Example
HLM_READ(2,17,PLC_DM,120,20,MC_TABLE,4000)
This example shows how to read 20 words from the PLC DM area addresses
120-139 to TJ2-MC64 TABLE addresses 4000-4019. The PC has Slave node
address 17 and is connected to the RS-422A port.
See also
HLM_COMMAND
,
HLM_STATUS
,
HLM_TIMEOUT
,
HLS_NODE
,
HLM_WRITE
,
SETCOM
.
pc_area value
Data area
Host link command