131
of 148
6.5. Sample programs
The two sample programs for the RS232 interface (standard device) and the IEEE488 interface can also be
called up on the Internet, at
www.burster.de
6:5.1 Sample program for the RS232 interface
‘*
File Name:
2329_rs.bas
Version: 1.0
‘*
‘*
Developed by:
C.Speck
on 03.12.1996
‘*
Changed by:
M.Westermann
on 26.03.1997
‘*
‘*
Language:
QBASIC 4.5 Operating system:
MS-DOS 6.22
‘*
‘*
Description:
Sample program for 2329-RS232
‘*
‘* Remarks:
‘*
‘*
Copyright by burster präzisionsmesstechnik, Gernsbach 07224-6450
‘****************************************************************************************************************************************
‘Declaration of the functions used
DECLARE FUNCTION CmdSenden (cmd$)
Send command
DECLARE SUB CmdEmpfangen (antwort$)
‘Receive response from device
DECLARE FUNCTION AbfrageSOC ()
‘Request Status Operation Condition Register
DIM antwort$(100)
DIM befehl$(100)
OPEN "COM1:9600,N,8,1" FOR RANDOM AS #3 ‘INITIALIZE RS232
CLS
‘CLEAR SCREEN
PRINT "DEMOPROGRAMM"
PRINT burster RESISTOMAT
®
Typ 2329"
PRINT "Control via the RS232 interface, COM1 9600 baud"
PRINT "Transfer protocol: ANSI X3.28 A3"
PRINT
PRINT "The measurement is started. Press the space bar to cancel it."
PRINT
befehl$ = "abort“
‘Stop the device if a measurement is in progress
IF (CmdSenden(id2329%, befehl$) = 0) THEN
SYSTEM
END IF
i = 0
‘Reset the counter
DO WHILE (INKEY$ = "") ‘Request measurement values until the space bar is pressed
befehl$ = "in" ‘Start a measurement
IF (CmdSenden(befehl$) = 0) THEN
SYSTEM
END IF
‘In the next loop, the device waits until a bit in the Operation-Status-Register
‘is set to indicate that a meaasurement variable is available
done% = 0