Polling Synchronization With Timeout - Agilent Technologies InfiniiVision 7000A Series Programmer's Manual

Table of Contents

Advertisement

10
Synchronizing Acquisitions

Polling Synchronization With Timeout

This example requires a timeout value so the operation can abort if an
acquisition does not occur within the timeout period:
'
' Synchronizing acquisition using polling.
' ===================================================================
Option Explicit
Public myMgr As VisaComLib.ResourceManager
Public myScope As VisaComLib.FormattedIO488
Public varQueryResult As Variant
Public strQueryResult As String
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Main()
778
On Error GoTo VisaComError
' Create the VISA COM I/O resource.
Set myMgr = New VisaComLib.ResourceManager
Set myScope = New VisaComLib.FormattedIO488
Set myScope.IO = myMgr.Open("TCPIP0::130.29.69.12::inst0::INSTR")
myScope.IO.Clear
' Clear the interface.
' Set up.
' -----------------------------------------------------------------
' Set up the trigger and horizontal scale.
myScope.WriteString ":TRIGger:MODE EDGE"
myScope.WriteString ":TRIGger:EDGE:LEVel 2"
myScope.WriteString ":TIMebase:SCALe 5e-8"
' Stop acquisitions and wait for the operation to complete.
myScope.WriteString ":STOP"
myScope.WriteString "*OPC?"
strQueryResult = myScope.ReadString
' Acquire.
' -----------------------------------------------------------------
' Start a single acquisition.
myScope.WriteString ":SINGle"
' Oscilloscope is armed and ready, enable DUT here.
Debug.Print "Oscilloscope is armed and ready, enable DUT."
' Look for RUN bit = stopped (acquisition complete).
Dim lngTimeout As Long
Dim lngElapsed As Long
lngTimeout = 10000
lngElapsed = 0
Do While lngElapsed <= lngTimeout
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
' Max millisecs to wait for single-shot.
' 10 seconds.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents