![background image](http://html2.mh-extra.com/html/omega/compact-cal-ca100/compact-cal-ca100_owners-manual_5154776063.webp)
Appendix
App-7
Sample Program
'*******************************************************************
'* *
'* CA100 COMAPCT CAL (RS-232-C) *
'* *
'* Output 50 mV in DCV 100 mV range *
'* *
'*******************************************************************
'
OPEN "COM1:9600,N,8,1,CS0,DS0,LF" FOR RANDOM AS 1 'Set communication mode
'
PRINT #1, "RC" 'Initialize settings
PRINT #1, "SF0" 'Set to DCV function
PRINT #1, "SR0" 'Set to 100 mV range
PRINT #1, "SD50.000" 'Set the generated value to 50 mV
PRINT #1, "SO1" 'Start generation
'
CLOSE #1
END
'*******************************************************************
'* *
'* CA100 COMAPCT CAL (RS-232-C) *
'* *
'* Make 100 measurements, determine the max. and min. values *
'* and display the result. *
'* *
'*******************************************************************
'
OPEN "COM1:9600,N,8,1,CS0,DS0,LF" FOR RANDOM AS 1 'Set communication mode
'
DIM RDATA$(100)
COUNT = 0: MAXNO = 0: MINNO = 0: ERRNO = 0: 'Initialize parameters
MCOUNT = 100: 'Set measurement count
LF$ = CHR$(&HA)
PRINT #1, "RC": 'Initialize settings
PRINT #1, "H1": 'Turn ON header
PRINT #1, "MO1": 'Start measurement
PRINT #1, "MF0": 'Set to DCV function
PRINT #1, "MR0": 'Set to 100 mV range
PRINT #1, CHR$(&H1B) + "S": 'Initialize status byte
LINE INPUT #1, STB$
CLS
' Main routine
LOOP1:
PRINT #1, CHR$(&H1B) + "S": 'Get status byte
LINE INPUT #1, STB$
IF LEFT$(STB$, 1) = LF$ THEN STB$ = MID$(STB$, 2)
SB = VAL(STB$)
IF (SB AND 8) <> 0 THEN GOTO ERRPROC: 'Over rangeÅH
IF (SB AND 1) <> 0 THEN GOSUB READM: 'Measurement complete?
LOCATE 1, 1: PRINT COUNT; "Samples"
IF COUNT = MCOUNT THEN GOTO MEASEND
FOR I = 0 TO 10000: NEXT I 'Wait
Free Datasheet http://www.datasheet-pdf.com/