beautypg.com

9 sample program – Kipp&Zonen COMBILOG Data Logger User Manual

Page 141

background image

11.9

Sample Program

The task is:
The measured value in channel 2 shall be read from the sensor
module with the address number 10. The value has been con-
figured with a field length of seven, two decimals, the unit "°C"
and the binary format "Integer".

Sample program for ASCII-transmission without check sum:
(Notation in QBasic, V. 1.0):

OPEN "COM1: 9600,N,8,1,D50,RS"

FOR RANDOM AS #1

,

initialize interface

REQ$ = "$0AR2"+chr$(13)

,

configure telegram

PRINT #1, REQ$

,

send request telegram

RES$ = INPUT$(9,#1)

,

receive response telegram

VALUE$ = MID$(RES$,2,7)

,

determine measured value

PRINT "Temperature = ", VALUE$

,

output measured value

CLOSE

,

enable interface

END

, end program

Note: In several programming languages the initialisation of
the serial interface with even parity and 8 data bits will not be
supported. The COM-interface in the PC and the bus interface
in the data logger have to be adjusted and configured on "(N)o
parity".

Hardware Manual COMBILOG 1022

141