LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running two pieces of hardware - quicker one automatically queues?

Hello,

 

I currently have a labview program setup to control a spectrum analyzer.  The hardware itself takes about a second and a half to output the peak RSSI value which is then recorded into a text document.

 

With the same piece of code I am receiving GPS coordinates from a Garmin 18x.  So when this code runs, everything seems fine, but driving a quick loop around the parking lot and checking the data reveals the GPS coordinates are late.  In other words, when driving a loop, the first data point does not match the last data point.  The last data point is of the coordinates a few seconds back.

 

I am theorizing that the Garmin is spitting out data about once a second.  Therefore, the data is being automatically cached due to the 1.5 second time on the loop.  I have briefly dabbled in "queue" functions.  Am I barking up the right tree?  Does anyone have any other suggestions?

 

Thanks very much.

0 Kudos
Message 1 of 2
(2,217 Views)

It is time for you to think carefully about the structure or architecture of your program.  It sounds like you have at least two independent data sources which produce data at different rates. You are also saving the data to a file.  You did not indicate what else the program may be doing or what user interactikon may occur.

 

The key is that the data comes in at different (and somewhat incompatible) rates.  When you see this pattern it is usually an indication that a parallel loop architecture such as Producer/Consumer is appropriate.  For your situation you will probably have two producers (one for each data source) and one consumer (file). There are examples which come with LV.  The advantage of this kind of architecture is that each producer loop is timed to acquire the data at the rate appropriate to the source. The consumer may operate at another rate.  The only constraint is that it must grab all the data available so that no buffer overflow or stale data situations occur.

 

Lynn

0 Kudos
Message 2 of 2
(2,210 Views)