![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/6/fe/6fea7682-8c40-4662-9a09-fef3b84eb2c1/6fea7682-8c40-4662-9a09-fef3b84eb2c1-bgd9.png)
Status
Register
Control
This function demonstrates how to use the Status Registers to provide synchroni
-
zation.
Uses the TR2 (trigger with settling) command to make a reading.
Function GetTR2Reading (channel) As Single
‘
make space for the result
Dim result As String
result = String$(10, 0)
‘
Send Status Register setup command + TR0 hold trigger mode
Call DLLsend(0, 13, “*SRE 16; TR2 1", 14, NLend, ibsta%, iberr%, ibcntl&)
‘
Set loop flag
Value = -256
Do
‘
Loop until SRQ is asserted.
Do
Call DLLTestSRQ(0, SRQ%, ibsta%, iberr%, ibcntl&)
Loop Until SRQ%=0
‘
SRQ asserted, read the ML2430As status register
Call DLLReadStatusByte(0, 13, status_byte%, ibsta%,
iberr%, ibcntl&)
‘
Check if it is the ML2430A which is requesting
‘
service (SRQ bit + MAV bit)
If (status_byte% And 80) = 80 Then
'
It is the ML2430A, read back value
Call DLLreceive(0, 13, result, 10, STOPend,
ibsta%, iberr%, ibcntl&)
Value = Val(result)
End If
Loop Until Value <> -256
GetTR2Reading = Value
End Function
6-130 ML2430A OM
PROGRAMMING EXAMPLES GPIB OPERATION