Showing results for 
Search instead for 
Did you mean: 

How to zero out my data for chart

I am very new to LabVIEW so please be patient.


I am aquiring 12 channels of 0-10 volt signals through a cDAQ-9174 chassis and 9205 module on Labview 11. I am using producer/consumer loops to the write the data to a file also sent to two charts. I want to keep the data sent to the file as is, and then tare (zero out) the data going to the charts.


I have attached the code. Please ignore the diagram dissable structure and it's contents.


Any help would be appreciated,


0 Kudos
Message 1 of 6

I can't look at your VI right now, but I can offer a comment: when you say you want to take zeros out of the data going to the graphs do you mean you don't want to plot those, and just leave blanks, or do you want to shift the data down? If you just want to not plot them, replace the zeros with NaN. Graphs/charts won't plot NaN. If you want to shift them, then you'd have to build up a new array to send to the graph.

0 Kudos
Message 2 of 6

It is like zeroing out a weight scale. If, when the test starts there is a signal that should read zero but does not, I want to subtract out the difference from all future values on that specific signal. For example:


If I have 12 signals and all read 0.0000 except the 7th signal reads 0.0100 then I want to subtract 0.0100 from all data on the 7th signal. But... only if the user selects to do this, not always.




0 Kudos
Message 3 of 6

So you're basically taking an initial reading to get an offset, if there is one, and optionally subtracting that offset from subsequent readings. OK. Then just find your offset from the initial reading (I'm assuming it's something like the largest reading), and then subtract it (optionally) from subsequent readings.

0 Kudos
Message 4 of 6

Yes, that is the concept. My issue arrives when trying to offset one or more data channels in the data array. If you see my producer/consumer loops, I do not know where or how to implement this idea into the block diagram. I created booleans for each channel to indicate when the user wants to zero each channel. Is there a property node that can adjust the values going to the chart or something else that would keep me from splitting the data to adjust each channel if necessary.




0 Kudos
Message 5 of 6

Are you supposed to get the this offset each time you press Start, or only the first time? For example, if I press "Start Test A", run it for 5 minutes, and then press it again to stop it, and then 10 minutes later I press it again to start it, do you need to update the offsets, or would you use the ones from 15 minutes earlier? Since the producer consumer loops are running all the time, I would suggest using a shift register/feedback node to keep track of whether you've acquired the offset values. Reset the flag when you turn off the test if you want to get the offsets "fresh" on the next start. As for where to save this, a simple local variable will work (yes, I said local variable, all you local variable haters out there!). In this case you will not run into a race condition.


Note: you do not need to use your own buttons for controlling the visibility of plots. In LabVIEW 2011 that's built-in. Show the plot legend, and then right-click on the legend and select Visible Items -> Plot Visibility Checkbox.


See attached modification for one possible implementation. Note that I removed the enqueing done in the False case in the producer loop since I did not see much point in enqueuing when you didn't actually get any data.

0 Kudos
Message 6 of 6