LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tare Question

I am wondering if there is any way to add a function in Labview that simulates a "Tare" (zeroing) function based on the first value of a reading. I assume this is a fairly often asked question and there is a simple answer to this (I understand that assuming can end badly thought =)). The only way I have been able to find on how to tare is doing a hard tare or manually inputting an intial value into the VI (reference: http://forums.ni.com/t5/LabVIEW/Adjustable-Calibration/m-p/924068#M415322). Is this still the only way to Tare data from a DAQ? If there is a standard link for this question please post it since apparently I am inept of finding it. Thanks!

0 Kudos
Message 1 of 17
(3,726 Views)

Are you reading single points or arrays?

 

Assuming you acquisition occurs in a loop, you can do [i]=0 or the "first run?" primitive the get the reference value. Then keep it in a shift register or feedback node and keep subtracting it from the new data.

0 Kudos
Message 2 of 17
(3,723 Views)

Altenbach,

 

Here is the VI I am currently using. I am bringing in 6 data readings from a USB 6210. I don't know how to do the [i]=0 or to keep it in the shift register so I will look into that. Thanks!

 

Coulton

0 Kudos
Message 3 of 17
(3,714 Views)

This VI makes very little sense. Why are you appending one point at a time, followed by smoothing the entire accumulated data. This means that after N iterations, the oldest point has been smoothed N times! Can't you use a ptbypt filter instead?

 

Why can't you use a single shift register with a 2D array, and append an entire row per iteration? It would simplify the code at least 6 fold!

 

Sorry I don't quite understand where you want to tare? At the start of the program? The first time the "start" boolean turns TRUE? Every time the "Start" boolean turns TRUE?

Message 4 of 17
(3,708 Views)

Altenbach,

 

I apologize for the sloppy code, this is one of about 6 total LabView codes I have ever written. Essentially, I am aquiring 6 voltage inputs, but the voltage noise in the system is relatively high compared to the voltage difference I am trying to document. This filter was the only one I could get to work. I will try the ptbypt filter.

 

By using a single shift register and use a 2D array I would essentially attach a 2D array and replace the rest of my arrays with array?

 

Lastly, my goal is to have the program tare everytime the Start boolean is True.

 

Thanks for the help!

 

Coulton

0 Kudos
Message 5 of 17
(3,703 Views)

I don't have DAQ, so here's a simple version that uses simulated data. I removed the filter, but you can add it again before the graphs. Simply define that columns are channels when converting to dynamic data and it will filter all channels with one instance of the express VI.

 

Of course you will be running out of memory at one point, accumulating data without limits, but I assume that you acquisitions are short.

Message 6 of 17
(3,693 Views)

Yes my acquisitions are relatively short.

 

Stupid question, how do you define columns as channels? I placed the filter after the array, but before the end of the if structure.

0 Kudos
Message 7 of 17
(3,688 Views)

This VI is what I came up with when I defined columns as channels. I am still getting the same graph for all 6 graphs. Perhaps I missed something?

0 Kudos
Message 8 of 17
(3,681 Views)

I think it needs to be "rows are channels". I never use dynamic data, so whatever. 😄

 

 

It really makes no sense to filter the existing data over and over again, so the filter should be between the 2D array and the graphs. See if this works better.

(Sorry, I changed the filter to 10, please change it back.)

Message 9 of 17
(3,676 Views)

Alright,

 

I was able to get my sloppy version of what you built to run correctly, but for some reason the simpler VI that you built still reads the same data on all 6 graphs. Perhaps I am doing something wrong on my end?

0 Kudos
Message 10 of 17
(3,642 Views)