One-To-One Nt Link Communications - Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

CPM1/CPM1A Communications Functions
Example Program

4-2-2 One-to-one NT Link Communications

CPM1 PCs
OMRON Programmable Terminal
228
3. If an out-of-range value is set, the following communications conditions will
result. In that case, reset the value so that it is within the permissible range.
Communications mode:
Communications format:
Transmission delay:
Node number:
This example shows a BASIC program that reads the status of the CPM1's in-
puts in IR 000. For more details, refer to 4-5 Host Link Commands.
An FCS (frame check sequence) check isn't performed on the received re-
sponse data in this program. Be sure that the host computer's RS-232C port is
configured correctly before executing the program.
1010 'CPM1 SAMPLE PROGRAM
1020 'SET THE COMMAND DATA
1030 S$="@00RR00000001"
1040 FCS=0
1050 FOR I=1 TO LEN(S$)
1060 FCS=FCS XOR ASC(MID$(S$,I,1))
1070 NEXT I
1080 FCS$=(FCS):IF LEN(FCS$)=1 THEN FCS$="0"+FCS$
1090 CLOSE 1
1100 CLS
1110 PRINT "SENDING COMMAND"
1120 OPEN "COM:E73" AS #1
1130 PRINT #1,S$ + FCS + CHR$(13);
1140 CLS
1150 PRINT "RECEIVING RESPONSE DATA"
1160 LINE INPUT #1,A$
1170 PRINT A$
1180 END
Using the 1:1 NT Link, the CPM1/CPM1A PC can connected to the Program-
mable Terminal (NT Link Interface) through an RS-232C Adapter.
RS-232C Adapter
RS-232C Cable
Host Link
Standard settings
(1 start bit, 7-bit data; 2 stop bits, even parity,
9,600 bps)
No
00
CPM1 CPU Unit
Section
4-2
CPM1 CPU

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents