Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot data from a GPIB function generator

I am doing a litle application with Visual C++ and the ComponentWorks++ to
control a GPIB device. I am tring to Plot a CNiGraph with data coming from
the GPIB function generator. I use the code below to write/read the device
and to Plot the graph. It give me some results but for exemple, if I
request a sin wave it give me something that doesn't look like a sin and if
I request a square wave it give me about the same wave... So I want to know
if the problem is in my code or maybe it's because my device is just a
emulator not a real func generator. But I guest I am doing some kind of
convertion error.

CNiInt16Vector vBuffer(100); // Should I try CNiReal64Vector or something
else ?

m_Visa->Write(m_strC
ommande); // Write to the device, this works well
m_Visa->Read(vBuffer); // Is it the right way to do reading ?
m_Graph.PlotY(vBuffer); // This Plot some data, but it doesn't seem right

Could somebody bring the light on this?

Thanks alot!

P.S. Sorry for the bad english...
0 Kudos
Message 1 of 2
(2,969 Views)
Ares:

I have two suggestions about common problems in VISA.

(1) How is m_Visa defined? There is occasionally some confusion about which VISA class should be used for this purpose. CNiVisaSession is the class designed for this purpose.

(2) How is the instrument returning data? Usually instruments return some sort of header before the actual data.

You may want to contact National Instruments Technical Support to continue this discussion. You can reach our telephone support at 1-800-IEEE-488 or email support at http://www.ni.com/ask.

Good Luck,

Chris Wood
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,969 Views)