Omron CQM1H - PROGRAM Programming Manual page 77

Programmable controllers; inner boards
Table of Contents

Advertisement

Communications Functions
Communications
Procedure
1,2,3...
Application Example
52
This section explains how to use the Host Link to execute data transmissions
from the CQM1H. Using this method enables automatic data transmission
from the CQM1H when data is changed, and thus simplifies the communica-
tions process by eliminating the need for constant monitoring by the computer.
1. Check to see that AR 0805 (RS-232C Port Transmission Enabled Flag) is
ON.
2. Use the TXD(48) instruction to transmit the data.
(@)TXD(48)
S
C
From the time this instruction is executed until the data transmission is com-
plete, AR 0805 (or AR 0813 for the peripheral port) will remain OFF. It will turn
ON again upon completion of the data transmission. The TXD(48) instruction
does not provide a response, so in order to receive confirmation that the com-
puter has received the data, the computer's program must be written so that it
gives notification when data is written from the CQM1H.
The transmission data frame is as shown below for data transmitted in the
Host Link Mode by means of the TXD(48) instruction.
1
0
@
E
X
x 10
x 10
Node
Header code
No.
(Must be "EX")
To reset the RS-232C port (i.e., to restore the initial status), turn ON SR
25209. To reset the peripheral port, turn ON SR 25208. These bits will turn
OFF automatically after the reset.
If the TXD(48) instruction is executed while the CQM1H is in the middle of
responding to a command from the computer, the response transmission will
first be completed before the transmission is executed according to the
TXD(48) instruction. In all other cases, data transmission based on a TXD(48)
instruction will be given first priority.
This example shows a program for using the RS-232C port in the Host Link
Mode to transmit 10 bytes of data (DM 0000 to DM 0004) to the computer.
The default values are assumed for all the PC Setup (i.e., the RS-232C port is
used in Host Link Mode, the node number is 00, and the standard communi-
cations conditions are used.) From DM 0000 to DM 0004, "1234" is stored in
every word. From the computer, execute a program to receive CQM1H data
with the standard communications conditions.
00100 AR0805
The following type of program must be prepared in the host computer to
receive the data. This program allows the computer to read and display the
data received from the PC while a Host Link read command is being executed
to read data from the PC.
S: Beginning word address of transmission data
C: Control data
0000: RS-232C port
1000: Peripheral port
N: Number of bytes of data to be sent (4 digits BCD)
0000 to 0061
Data (up to 122 characters)
@TXD(48)
If AR 0805 (the Transmission Enabled Flag)
DM 0000
is ON when IR 00100 turns ON, the ten bytes
#0000
of data (DM 0000 to DM 0004) will be trans-
mitted.
#0010
Section 1-6
*
FCS
Terminator

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents