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.
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.
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…)
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.
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.
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…
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:
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!
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.