AW Gear Meters EMO-1005 User Manual
Page 34

AW-Lake Company 8809 Industrial Drive, Franksville, WI 53126 web: www.awgearmeters.com
Tel: 262-884-9800 Fax: 262-884-9810 Email: [email protected]
REV. 1a 05/98 EMO-1005 Manual.DOC
33
These are the ASCII characters needed when working with the EMO-1005
ASCII Decimal ASCII Decimal
0 48
A 65
1 49
B 66
2 50
C 67
3 51
D 68
4 52
E 69
5 53
F 70
6 54
7 55
J
74
8 56
K 75
9 57
BASIC PROGRAM FOR TESTING THE SERIAL PORT.
The BASIC program below will help test the communication port with a IBM PC compatible
computer. The program can be used in connection with BASIC, BASICA, GWBASIC or any other
reasonably standard PC BASIC.
10 REM *** EMO-1005 Serial port test program --------------
20 REM
30 OPEN "COM1:9600,N,8,1,RS,CS,DS,CD" AS #1
40 REM 9600 baud/no parity/8 data bits/1 stop bit/no hand shakes
50 INPUT "Enter string to send ",T$
60 REM for example 01K006304. This will read Totalizer channel 1
70 REM the > sign and carriage return is added later in the
80 REM program.
90 REM the next 4 lines calculates the checksum
100 FOR X=1 to LEN(T$)
110 NUM=NUM+ASC(MID$(T$,X,1))
120 NEXT X
130 CHK$=HEX$(NUM-(FIX(NUM/256)*256))
140 REM CHK$ carries the checksum as a string
150 REM now send the message
160 PRINT#1,;">";T$;CHK$;CHR$(13)
170 REM and print the message on screen
180 PRINT "Sent : ";">";T$;CHK$;CHR$(13)
190 PRINT "Waiting for replay........"
200 LINE INPUT#1,X$
210 PRINT "Received : ";X$;CHR$(13)
220 CLOSE #1
230 END
Before running the program make sure all hardware aspects are OK and the EMO-1005 is hooked up
correctly.