LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display counter output on graph

I have two counters generating continuous digial pulse trains from my PCI 6010, and I'm trying to display the output on a graph.  I've got the output of one counter connected to an AI line that leads to a waveform graph, but I can't get anything on the graph.  I've measured the output via external means, so I know the counters are generating the appropriate pulses.

 

Eventually I'd like to have some sort of indicator for each counter that indicates whether the counter is in the 'on' or 'off' state, but I figured getting the counter outputs to diplay on a graph would be a good first step.

 

My VI is below; the display part that isn't working is at the bottom of the case structure.

 

Thanks.

Counters with display.JPG 

0 Kudos
Message 1 of 4
(3,298 Views)
Once your code goes into the inner while loop your graph will never be updated since it will only execute one time. In order to update the graph continually you will need a parallel which handles the graph updates. A good way to pass data between the parallel tasks is a queue.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 4
(3,295 Views)

I'm not sure what exactly you mean by use a parallel and a queue.  I tried putting my graphing code into a while loop that's inside a flat sequence structure with the counter while loop.  Is this what you meant by a parallel?  Or maybe the rendezvous VI?  I still get nothing on my graph.  My code is posted below.  I read about queues, but is a queue really necessary?  My counter output is wired directly to an analog input, so I really just want to graph what's coming into the input.

 

I also tried putting the graphing code inside the same while loop that my counter is using - still nothing on the graph.

 

Thanks for your help.

Counters with display2.JPG

0 Kudos
Message 3 of 4
(3,270 Views)
On your first post you have an input to the top left corner of your 'AI Voltage' Subvi, on your most recent you do not. I gather this input is important.
------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 4 of 4
(3,253 Views)