BASIC commands
PROGRAMMING MANUAL
91
Revi
si
on 3.0
/i
/i
3.2.140 HLM_READ
/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 C200HX PC, the VR(233) will contain value 12
(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_COMMAND
,
HLM_STATUS
,
HLM_TIMEOUT
,
HLS_NODE
,
HLM_WRITE
,
SETCOM
.
command value Description
HLM_MREAD
(or value 0)
This performs the Host Link PC
MODEL READ
(
MM
) command to read
the CPU Unit model code. The result is written to the TJ1-MC__ variable
specified by
mc_area
and
mc_offset
.
HLM_TEST
(or value 1)
This performs the Host Link
TEST
(
TS
) command to check correct com-
munication by sending string "MCW151 TEST STRING" and checking the
echoed string. Check the
HLM_STATUS
parameter for the result.
HLM_ABORT
(or value 2)
This performs the Host Link
ABORT
(
XZ
) command to abort the Host link
command that is currently being processed. The
ABORT
command does
not receive a response.
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.
mc_area value Data area
MC_TABLE
(or value 8)
TABLE variable array
MC_VR
(or value 9)
Global (VR) variable array
Type
Communication command
Syntax
HLM_READ(port, node, pc_area, pc_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.
command value Description
I52E-EN-03.book Seite 91 Freitag, 29. Juni 2007 11:55 11