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

Hide thumbs Also See for InfiniiVision 5000 Series:
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()
578
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
' Max millisecs to wait for single-shot.
' 10 seconds.
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide

Advertisement

Table of Contents
loading

Table of Contents