ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting a Waveform Graph from an Instrument

Hello,
 
I am using Visual Studio 8.1, an dI would like to be able to see the waveform graph present on my oscilloscope monitor on my computer. I have been able to communicate with the Oscilloscope (it told me it's name, for lack of a better description) and I have been able to implement a simple waveform graph. However, I cannot get the oscilloscope to send me data to create a working waveform. These are the resources I have drawn on up to this point.
 

 

 
Thank you for your help.
 
 
0 Kudos
Message 1 of 7
(5,067 Views)
Hi G. Harris,
 
Could you tell us more about how you are communicating with your oscilloscope (what library are you using ?), If you can attach your project/send the code that is not working, we'll be able to help you better.
-Mahesh
National Instruments
0 Kudos
Message 2 of 7
(5,051 Views)
I am using Visual Studio C# with Measurement Studio 8.1 to write a
VISA application, and I followed the tutorial in the attached documents above. The tutorials seem to stop abruptly
after describing how to contact the scope.  Near the end of the tutorial, it says that it is possible to create a waveform form the scope, but doesn't say how.
Here's the tutorial again:
I have also attached the project.
 
Thanks again.
0 Kudos
Message 3 of 7
(5,042 Views)

Looks like the attachment didn't work, I'll try it again.

 

 

Download All
0 Kudos
Message 4 of 7
(5,041 Views)
Hi G. Harris,

To communicate with devices such as oscilloscopes or analyzers etc, you must use the set of commands specific to your device. These commands can differ from one manufacturer to the other. Some manufacturers don't even use the *IDN? command to query the identification of the device. Generally, you can find a list of device specific commands in the device manual.

Based on the command you send and what you expect to receive, you can modify your code to read back a measurement or an array of measurements then display the array in a graph.

Hope this helps.
Manooch H.
National Instruments
0 Kudos
Message 5 of 7
(5,027 Views)
Thanks Manooch_H,
 
We were able to retrieve the binary data from the scope using the ":WAV:DATA?" command. However, we do not know how to display it properly. Could you give us any suggestions on how to make the actual graph?


Message Edited by G. Harris on 08-01-2008 03:27 PM
0 Kudos
Message 6 of 7
(4,998 Views)
Hi G. Harris,

You would want to set up your code to graph your data based on the type of data with which your instruments responds to the command you are using. For example, if the ":WAV: DATA?" returns a single measurement value, then you may want to gather a collection of data in a loop and store it in an array, then plot the values in that array using one of the plot functions of the waveform graph. If the command already returns an array of data, then again you could plot the values in that array using one of the plot functions.

If you place a waveform graph on your Form and call it MyGraph, then you could plot your data with the function call, MyGraph.PlotY().
Manooch H.
National Instruments
0 Kudos
Message 7 of 7
(4,971 Views)