Showing results for 
Search instead for 
Did you mean: 

Zero Function on waveform data



I want to perform a zero function on waveform data being read from a DAQ device.

For example, when acquiring data from load cells or strain gauges, a zero function need to be performed to take out any pre-loading / pre-stressing of the sensor.


I am able to do this when using DBL data as shown in the snippet attached, but I am not able to do it with waveform data. I get an error which syas that the dT from both inputs to the subtract are different.


Any suggestions?




Download All
0 Kudos
Message 1 of 19

Do not attach pictures of code, attach code (this means attach the VI, itself).  Among other things, it allows us to examine what a picture cannot show us, such as the "hidden" Case elements.  You are clearly "doing something wrong", and we can "guess" what it is, but with the actual code, we could make sure we were truly answering your question.


Bob Schor

0 Kudos
Message 2 of 19

Hi Rhys,


you need to initialize the shift register properly…



- when using waveforms you get errorIO for simple math nodes. Did you check the error out?

- why do you want to subtract one waveform from the other? Why don't you subtract a simple DBL offset to ZERO your signal?

- why do you subtract arrays anyway?


@Bob: those PNGs look like snippets! (I don't have LV2015 available right now to verify this, but filesize looks quite ok…)

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 19



     My apologies -- you did, indeed, post Snippets, which "expand" to code.  I've never thought of attaching Snippets -- I tend to embed them as images right in the post (it took me several years of using the Forum to learn how to include images -- just use the little "picture" icon (to the right of the Chain icon, for "Links", on the toolbar just above this Message area).  So when I see image attachments, I simply "go ballistic", for which I do apologize.


Bob Schor

0 Kudos
Message 4 of 19

Hi Both,


Yes they are snippets which I attached as a file rather than pasting in the post; no worries Bob.


I need to know what the Y value is at the point in time when the ZERO button is pressed in order use this value as a constant to subtract from the new data.

Do you understand?


The error which I was getting is show here.







0 Kudos
Message 5 of 19

Zero Strain Data.png


Here's one I did before which worked with DBL data.



0 Kudos
Message 6 of 19

Hi Rhys,


again: you need to initialize the shift register correctly!


Did you debug your VI using probes?

Do you know what happens when you subtract an EMPTY array from a non-empty array?


Or to put it in a different way:

In your "working" example you used FirstCall? and so you made sure to initialize the sift register. You may try this too…

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 19

Hi GerdW,


Apologies I missed out the initialization.

I think I have worked out what I need to do.


In general terms, how does this look to you:

Working Zero Function.png






0 Kudos
Message 8 of 19

Hi Rhys,


why do you use ReplaceArraySubset in the case structure?

How did you initialize the constant wired to the shift register?


(I can't open your snippet as I don't have LV2015 available right now.)


I still don't know why you need to subtract a whole waveform/array instead of a scalar value - every simple DMM uses a scalar ZERO value!

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 19

Are you looking for a single value to zero out, or an array of values?


Right now your tare value is an array which is every point of your waveform.  I thought you wanted to subtract out a single Mean value.


And even if you wanted to subtract an array,  you don't need Replace Array subset in the True case.  Just wire up the Y array.  Also, you don't need to split the waveform and individually unbundle the same Y array from eacy.

0 Kudos
Message 10 of 19