beautypg.com

Teledyne 7600 - Infrared gas analyzer - communication manual User Manual

Page 37

background image

Teledyne Analytical Instruments

37

(a) Example of data read-out
Operation:

Read-out CH1 measurement concentration value.

(Continuous word read-out from read-out only area)

Used function code :

04H

Read-out start register No. : 30001
Read-out word number :

3

1000 '-------------------------------------------------------

1010 ' READ CONTINUOUS WORDS SAMPLE PROGRAM
1020 '-------------------------------------------------------

1030 '

1040 ' Transmission speed = 9600 bps (selected with SPEED command

and SWITCH command of MS-DOS)
1050 '

1060 CLS

1070 DIM CC(255)
1080 '

1100 '-------------- Send data setting -----------------------

1110 CC(1)=&H01 'Station No. = 1
1120 CC(2)=&H04 'Function code = 04H

1130 CC(3)=&H00 'Upper byte of relative address(0000H) of resister

No.30001
1140 CC(4)=&H00 'Lower byte of relative address(0000H) of resister

No.30001

1150 CC(5)=&H00 'Upper byte of read-out word data(0003H)

1160 CC(6)=&H03 'Lower byte of read-out word data(0003H)
1170 COUNT=6

1200 '

1210 '----------- CRC code calculation of send data ----------
1220 GOSUB *CRC.CALC

1230 CC(7)=CRC.L 'Lower byte of CRC calculation result °Ê Upper byte

in message
1240 CC(8)=CRC.H 'Upper byte of CRC calculation result °Ê Lower byte

in message

1250 COUNT=COUNT+2

1300 '
1310 '------------- Send data -----------------------------

1320 PRINT " Sending data > ";

1330 OPEN "COM1:N81NN" AS #1 ' No parity •••"N81NN""
1340

1350

1360 FOR I=1 TO COUNT
1370 PRINT #1,CHR$(CC(I)); 'Writing in transmission port

1380 PRINT RIGHT$("0"+HEX$(CC(I)),2);" "; 'Displaying on screen

1390 NEXT I
1400 '

1410 FOR I=O TO 12000 :NEXT I ' Interval time

1500 '

This manual is related to the following products: