LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to show number of samples on wave form graph while acquiring data through DAQ card

Solved!
Go to solution

Hi,

I am trying to acquire data through DAQ card and successfully did it. but now I want to show a graph which represents voltage versus no of samples instead of voltage versus time. can any body help how can I do that.

MJhaziq92_0-1590867721728.png

I want to replace time on x asxis with no. of samples acquired in one cycle 

Regards,

Haziq

0 Kudos
Message 1 of 7
(3,062 Views)

If you are plotting a waveform, extract the data from it using Get Waveform Components and send the Y array to the graph instead.

0 Kudos
Message 2 of 7
(3,041 Views)

Hi,

Thank you  for your reply. I tried to used get waveform component and try to plot y on second graph but its not working. I am new to lab view so if I am making any mistake can you please help. I am attaching pic of my vi.

Regards,

Haziq

 

MJhaziq92_0-1590883210789.png

 

0 Kudos
Message 3 of 7
(3,017 Views)

Attach your VI.  We can't execute a picture, nor can we see it clearly enough to be sure we are "doing what you are trying to do".

 

Bob Schor

0 Kudos
Message 4 of 7
(2,972 Views)

Without knowing how the DAQ Assistant is setup, I don't know what the data output contains so don't know how Append Waveforms will handle it.  This is one of the many reasons why I don't like the Express VIs - stuff is often hidden.  My suggestion would be to right-click on the DAQ Assistant and select Generate NI-DAQmx code.  This will give you something that does the same as DAQ Assistant but is much easier to understand, and troubleshoot.  You would then put all the setup stuff before the loop, the DAQmx Read inside the loop and the DAQmx Clear Task after the loop.  This will do away with the Dynamic Data type and you can set DAQmx Read to produce data for each channel as a waveform or an array of doubles.

0 Kudos
Message 5 of 7
(2,971 Views)

Hi 

first of all sorry I didn't upload the CV so I am uploading it now. For simplicity in this cv instead of  using DAQ assistant I just simply generate sine wave with 1 KHz frequency with 100 samples. Now usually graph represents time vs voltage graph but I want to plot a graph that represent no.of samples vs voltage.

Regards,

Haziq 

0 Kudos
Message 6 of 7
(2,919 Views)
Solution
Accepted by MJhaziq92

Do you want your graph to just show the last capture?  Or do you want a limited history?  Or ALL of the data?  My recommendation is the limited history since that is by far the simplest route to go.  Just replace your Waveform Graph with a Chart.  A chart will default to storing the last 1024 samples.  You can increase the "History Size" with a right-click option at edit time.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 7
(2,914 Views)