Stanford Research Systems SR850 User Manual page 217

Dsp lock-in amplifier
Table of Contents

Advertisement

WRT$ = "FAST2;STRD"
CALL TXLIA(LIA%, WRT$)
'
Get FAST mode data.
'
The 100 sec sweep at 64 Hz has 64*100 + 1 points, each point consists of X (2 bytes) and Y (2 bytes)
'
for a total of 4 bytes per sample. 6401*4=25604 bytes.
CALL IBRDI(LIA%, RXBUF%(), 25604)
PRINT "Scan Finished."; IBCNT%; "Bytes Received"
'
Now print out the first 10 values of R based on the X and Y values
FOR I% = 0 TO 9
'
the buffer contains X,Y pairs so move by 2*I% to find the next point.
X = RXBUF%(2 * I%) / 30000!
Y = RXBUF%(2 * I% + 1) / 30000!
'
30000 is full scale (1V in this case). For other scales, multiply by the full scale voltage.
R = SQR((X * X) + (Y * Y))
PRINT "I ="; I%; "
R ="; R
NEXT I%
PRINT "Now dump the scan as ASCII values"
PRINT "Press <Enter> to continue"
INPUT a
DIM RFBUF(10)
FOR I% = 1 TO 10
RD$ = SPACE$(20)
'
Read 1 value of R from buffer position I%-1
WRT$ = "TRCA?3," + STR$(I% - 1) + ",1"
CALL TXLIA(LIA%, WRT$)
CALL IBRD(LIA%, RD$)
'
Convert to number and store
RFBUF(I%) = VAL(RD$)
PRINT "I ="; I%; "
R ="; RFBUF(I%)
NEXT I%
PRINT "Now dump the scan as LIA floating point values"
PRINT "Press <Enter> to continue"
INPUT a
'
Read from buffer position 0 a total of 10 points
WRT$ = "TRCL?3,0,10"
'
Do not use TXLIA here since the IFC RDY bit will not be cleared until the binary transfer is complete.
CALL IBWRT(LIA%, WRT$)
'
Each point is a 4 byte value made up of 2 integers
CALL IBRDI(LIA%, RXBUF%(), 40)
FOR I% = 0 TO 9
'
the first integer of each pair is the mantissa
MANTISSA% = RXBUF%(2 * I%)
'
the second integer is the exponent offset by 124
Remote Programming
6-41

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents