BASIC commands
PROGRAMMING MANUAL
110
R
e
vi
si
o
n
1
.0
/i
/i
/i
3.2.152 HLM_READ
/i
HLM_INIT
(or value 3)
This performs the Host Link
INITIALIZE
(
**
) command to initialize the
transmission control procedure of all Slave Units.
HLM_STWR
(or value 4)
This performs the Host Link
STATUS WRITE
(
SC
) command to change
the operating mode of the CPU Unit.
•
port
The specified serial port. 1 = RS-232C serial port 1; 2 = RS-422A serial
port 2.
•
node
(for
HLM_MREAD
,
HLM_TEST
,
HLM_ABORT
and
HLM_STWR
)
The Slave node number to send the Host link command to. Range: [0,
31].
•
mode
(for
HLM_STWR
)
The specified CPU Unit operating mode. 0 = PROGRAM mode; 2 =
MONITOR mode; 3 = RUN mode.
•
mc_area
(for
HLM_MREAD
)
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
(for
HLM_MREAD
)
The address of the specified TJ2-MC64 memory area to read from.
Range for VR variables: [0, 1023]. Range for TABLE variables: [0,
63999].
command value Description
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)