EasyManua.ls Logo

Anritsu ML2437A - Status Register Control; 488.2 General Send;Receive System

Anritsu ML2437A
314 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Programming Examples GPIB Operation
8-134 PN: 10585-00001 Rev. P ML2437A/38A OM/PM
Status Register Control
This function demonstrates how to use the Status Registers to provide synchronization.
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
488.2 General Send/Receive System
This function uses the status registers to synchronize the GPIB commands and return data if
a query command was used. The system waits until the command string has been completed
and then checks to see if any data is on the GPIB output buffer. If so, the data is returned in
the Result$ argument and any error code generated in receiving the data is returned in the
Result_Code% argument.
For example: Use 4882SendReceive(0, 13, “O 1”, Result$, Result_Code%) to return a reading
from the ML243xA.
Note that this function is written in “pseudo code” and cannot be executed as is.

Table of Contents

Related product manuals