LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create xy plot

Hello,

 

I want to create a YT graph using a counter which counts pulses (falling edges) and puts the number of pulses in a time bin. In other words, the first for loop counts pulses for 1second (example) and then puts this number into the first bin. I tried to create a XY graph where the Y input is the array of counts and the X input are the time bins, but the resulting graph plots only the first bin. 

 

I have attached the code.

 

Thanks in advance.

 

 

 

 

0 Kudos
Message 1 of 4
(2,149 Views)

If you want to plot "pulse counts" versus time, I would recommend a waveform into a waveform graph. Make dt your bin size when building the waveform.

 

And why do you have 5 for loops each with one iteration? You could do everyting in one for loop running 5 iterations. And put DAQ Clear Task outside the loop so it runs after the loop is finished.

0 Kudos
Message 2 of 4
(2,129 Views)

I tried your suggestion, but the waveform graph does not respond when placed outside the loop. On the other hand when I placed the graph inside, it showed a single point.

0 Kudos
Message 3 of 4
(2,096 Views)

My suggestion was to use a For loop for the DAQ and the For loop wrapped by a While loop. After the For loop is finished you would see the updated graph, then the While loop would iterate again.

0 Kudos
Message 4 of 4
(2,093 Views)