Specifications

BASIC commands
PROGRAMMING MANUAL 97
Revision 5.0
3.2.142 HLM_READ
/i
/i
Example HLM_COMMAND(HLM_MREAD,1,12,MC_VR,233)
This command reads the CPU Unit model code of the Host Link Slave with
node address 12 connected to the RS-232C port. The result is written to
VR(233).
If the connected Slave is a any OMRON CJ/CS PLC model, the VR(233) will
contain value 30 (hex) after successful execution.
Example HLM_COMMAND(HLM_TEST,2,23)
PRINT HLM_STATUS PORT(2)
This command will check the Host Link communication with the Host Link
Slave (node 23) connected to the RS-422A port.
If the HLM_STATUS parameter contains value 0, the communication is func-
tional.
Example HLM_COMMAND(HLM_INIT,2)
HLM_COMMAND(HLM_ABORT,2,4)
These two commands perform the Host Link INITIALIZE and ABORT opera-
tions on the RS-422A port 2. The Slave has node number 4.
Example HLM_COMMAND(HLM_STWR,2,0,2)
When data has to be written to a PC using Host Link, the CPU Unit can not be
in RUN mode. The HLM_COMMAND command can be used to set it to
MONITOR mode. The Slave has node address 0 and is connected to the RS-
232C port.
See also HLM_READ, HLM_STATUS, HLM_TIMEOUT, HLS_NODE, HLM_WRITE,
SETCOM.
Type Communication command
Syntax HLM_READ(port, node, plc_area, plc_offset, length, mc_area,
mc_offset)
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