Visa Example In C - Agilent Technologies InfiniiVision 5000 Series Programmer's Manual

Hide thumbs Also See for InfiniiVision 5000 Series:
Table of Contents

Advertisement

End Sub

VISA Example in C#

To compile and run this example in Microsoft Visual Studio 2005:
1
2
3
4
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
err = viVPrintf(vi, ":MEASURE:TEDGE? +1, CHAN1" + vbLf, 0)
' Read time at edge 1 on ch 1.
err = viVScanf(vi, "%lf", VarPtr(dblChan1Edge1))
' Query time at 1st rising edge on ch2.
err = viVPrintf(vi, ":MEASURE:TEDGE? +1, CHAN2" + vbLf, 0)
' Read time at edge 1 on ch 2.
err = viVScanf(vi, "%lf", VarPtr(dblChan2Edge1))
' Calculate delay time between ch1 and ch2.
dblDelay = dblChan2Edge1 - dblChan1Edge1
' Write calculated delay time to screen.
MsgBox "Delay = " + vbCrLf + CStr(dblDelay)
' Make a phase difference measurement between channel 1 and 2.
' Query time at 1st rising edge on ch1.
err = viVPrintf(vi, ":MEASURE:TEDGE? +2, CHAN1" + vbLf, 0)
' Read time at edge 2 on ch 1.
err = viVScanf(vi, "%lf", VarPtr(dblChan1Edge2))
' Calculate period of ch 1.
dblPeriod = dblChan1Edge2 - dblChan1Edge1
' Calculate phase difference between ch1 and ch2.
dblPhase = (dblDelay / dblPeriod) * 360
MsgBox "Phase = " + vbCrLf + CStr(dblPhase)
Open Visual Studio.
Create a new Visual C#, Windows, Console Application project.
Cut- and- paste the code that follows into the C# source file.
Edit the program to use the VISA address of your oscilloscope.
Programming Examples
717
12

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents