Sta tus
Reg is ter
Con trol
This func tion dem on strates how to use the Sta tus Reg is ters to pro vide syn -
chro ni za tion.
Uses the TR2 (trig ger with set tling) com mand to make a read ing.
Func tion Get TR2Read ing (chan nel) As Sin gle
‘ make space for the re sult
Dim re sult As String
re sult = String$(10, 0)
‘ Send Sta tus Reg is ter setup com mand + TR0 hold trig ger mode
Call DLLsend(0, 13, “*SRE 16; TR2 1", 14, NLend, ibsta%, iberr%,
ibcntl&)
‘ Set loop flag
Value = -256
Do
‘ Loop un til SRQ is as serted.
Do
Call DLLTestSRQ(0, SRQ%, ibsta%, iberr%, ibcntl&)
Loop Un til SRQ%=0
‘ SRQ as serted, read the ML2400As sta tus reg is ter
Call DLLReadStatusByte(0, 13, sta tus_byte%, ibsta%,
iberr%, ibcntl&)
‘ Check if it is the ML2400A which is re quest ing
‘ ser vice (SRQ bit + MAV bit)
If (sta tus_byte% And 80) = 80 Then
' It is the ML2400A, read back value
Call DLLreceive(0, 13, re sult, 10, STOPend,
ibsta%, iberr%, ibcntl&)
Value = Val(re sult)
End If
Loop Un til Value <> -256
Get TR2Read ing = Value
End Func tion
ML2400A OM 6-133
GPIB OPERATION PROGRAMMING EXAMPLES