Omron CQM1H-SCB41 Operation Manual page 64

Sysmac cqm1h series serial communications board
Hide thumbs Also See for CQM1H-SCB41:
Table of Contents

Advertisement

Host Link Communications
Note
TXD( ) Application
Example
Communications Control
Signals and
Communications Timing
480 Q=ASC(MID$(RESPONSE$,I,1)) XOR Q
490 NEXT I
500 FCSD$=HEX$(Q)
510 IF LEN(FCSD$)=1 THEN FCSD$="0"+FCSD$ 'FCS result
520 IF FCSD$<>FCSP$ THEN FCSCK$="ERR"
530 PRINT"FCSD$=";FCSD$,"FCSP$=";FCSP$,"FCSCK$=";FCSCK$
540 RETURN
1. Normal reception data includes the FCS, delimiter or terminator, and so
on. When an error occurs in transmission, however the FCS or some other
data may not be included. Be sure to program the system to cover this pos-
sibility.
2. In this program example, the CR code (CHR$(13)) is not entered for RE-
SPONSE$. When including the CR code, make the changes in lines 430
and 450.
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 a computer. From
DM 0000 to DM 0004, "1234" is stored in every word.
The default values are assumed for all of the PC Setup (i.e., the RS-232C port
is used in Host Link mode, the node number is 00, and the standard commu-
nications parameters are used.)
00100 20105
@TXD( )
The PC Setup has a setting that can be used to enable CTS control. If CTS
control is enabled, processing will be placed on standby until the CS input
turns ON after the RS output ON signal is sent for a transmission from the
Serial Communications Board. Connect the RS output from the host to the CS
input on the Board and perform flow control at the host.
If SR 20105 (the Transmission Ready Flag) is
DM 0000
ON when IR 00100 turns ON, ten bytes of
#0100
data (DM 0000 to DM 0004) will be trans-
mitted.
#0010
The transmitted data will appear on the host
computer's screen as follows, assuming the
text being sent is "1234" in all specified words:
@00EX1234123412341234123459*CR
Section 4-4
49

Advertisement

Table of Contents
loading

Table of Contents