EasyManuals Logo

Omron CQM1H - PROGRAM User Manual

Omron CQM1H - PROGRAM
602 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #471 background imageLoading...
Page #471 background image
446
Command and Response Formats Section 6-4
Example Program for FCS This example shows a BASIC subroutine program for executing an FCS
check on a frame received by the host computer.
400 *FCSCHECK
410 L=LEN(RESPONSE$) ’ .......... Data transmitted and received
420 Q=0:FCSCK$=” ”
430 A$=RIGHT$(RESPONSE$,1)
440 PRINT RESPONSE$,A$,L
450 IF A$=”*” THEN LENGS=LEN(RESPONSE$)-3
ELSE LENGS=LEN(RESPONSE$)-2
460 FCSP$=MID$(RESPONSE$,LENGS+1,2) ’ ... FCS data received
470 FOR I=1 TO LENGS ’ .......... Number of characters in FCS
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
Note 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.
6-4-2 Commands from the PC
In Host Link communications, commands are ordinarily sent from the host
computer to the PC, but it is also possible for commands to be sent from the
PC to the host computer. In Host Link Mode, any data can be transmitted from
the PC to the host computer. To send a command to the host computer, use
the TRANSMIT instruction (TXD(48)) in the PC program in Host Link Mode.
TXD(48) outputs data from the specified port (the RS-232C port, the periph-
eral port, or ports 1 or 2 of the Serial Communications Board). Refer to
page 417 for details on using TXD(48).
Reception Format When TXD(48) is executed, the data stored in the words beginning with the
first send word is converted to ASCII and output to the host computer as a
Host Link command in the format shown below. The “@” symbol, node num-
ber, header code, FCS, and delimiter are all added automatically when the
transmission is sent. At the host computer, it is necessary to prepare in
advance a program for interpreting and processing this format.
One byte of data (2 digits hexadecimal) is converted to two characters in
ASCII for transmission, the amount of data in the transmission is twice the
amount of words specified for TXD(48). The maximum number of characters
for transmission is 122 and the maximum number of bytes that can be desig-
nated for TXD(48) is one half of that, or 61.
@
*
EX
FCS
Node No. Header code
(Must be "EX")
Tex t
122 characters max.
Terminator

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron CQM1H - PROGRAM and is the answer not in the manual?

Omron CQM1H - PROGRAM Specifications

General IconGeneral
I/O CapacityUp to 512 points
Power Supply100 to 240 VAC, 50/60 Hz or 24 VDC (depending on model)
Instruction SetBasic and advanced instructions
Operating Temperature0 to 55°C
Program Capacity7.2K to 15.2K steps
Communication PortsRS-232C
Expansion SlotsUp to 3 expansion units
TypeProgrammable Logic Controller (PLC)
CPU TypeRISC
Program Memory7.2K to 15.2K steps
I/O Points512 max
Expansion CapabilityUp to 3 expansion units
Data MemoryRAM (battery backup)

Related product manuals