Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How to switch samples to time on the X-axis

I am VERY new to the whole VC++ aspect of Measurment Studio, but I am very comfortable with LabVIEW.  In LabView I was used to making a waveform graph that actually stored the samplerate for me.  Thus when I graphed the data, only time was displayed on the x axis.  I dont even know where to begin to do this with VC++ 2005.  Basically, I am trying to display 10,000 points collected at 4KHz.  Therefore, my x-axis should go from 0 to 2.5 seconds.  Any idea on how to do this?
 
Much appreciated,
Joe LaRosa
0 Kudos
Message 1 of 2
(6,059 Views)
Hi Joe,
 
I can definitely help you with this issue. In your Visual C++ project, you need to assign data to a given plot (which happens to be an object). Essentially, you can use the (your graph object).Plots.Item(1).PloyXvsY function in order to plot two arrays of data on your graph.
 
You will first want to declare your X and Y arrays as type CNiReal64Vector, then fill up the arrays with the data of your choice (therefore the X array can be a set of time data).
 
Alternately, if your data is sampled at a regular interval, you can use the PloyX function and specifiy a Y array, initial X value, and X increment value as parameters.
 
Please let me know if you need additional help with this, and I would be glad to assist you further. I am sure that we can work together to get your application up and running; have a great day Joe!
 
Regards,
 
Casey Weltzin
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(6,047 Views)