07-30-2018 04:06 PM - edited 07-30-2018 04:08 PM
Hello all, as you can see on the attached picture i am trying to do some further calculations with my data after it has been received. The goal is to get numerical indicators, which will not show up when using waveform data. The indicators connected to the waveform modules do work, but not the ones for the calculations. So I tried to use the "get waveform components" function but i keep getting an error in my code (broken wire). Anyone know any other functions i could use to accomplish this?
FYI- the first photo is the full program, and the second is the broken wire when i try to add the "get waveform components"
Solved! Go to Solution.
07-30-2018 04:46 PM
It's probably because you have an array of waveforms, not just a single waveform. Try using "index array" before "get waveform components".
I can't tell for sure without seeing the VI.
07-31-2018 08:52 AM
We beg, we plead, we politely ask, but still people show us pictures of code rather than attach the VI, the code. I'm just glad we're not talking C++ (and a picture of a 1000 lines of text).
You clearly have an array of Waveforms, and, even worse, you transform it into (and then out of) a Dynamic Data Wire (I've never understood why these were invented, other than to make LabVIEW "seem simple" for Newbies). There are other things in your picture that I'd love to click on and examine closer, possibly try running through a For loop to see if I can "de-array-ify" it and make your code work, but I only have a static picture, not a dynamic LabVIEW VI, to work with.
A single Waveform is easy to use. Extract one from your Array and try again. If you need more help, attach your VI. Please!
Bob Schor
07-31-2018 09:34 AM
My apologies! Here is the attached .VI and the associated subroutines. Thanks for your initial suggestions, I am going to try now and see if I can get something to work.
07-31-2018 05:18 PM
You have a lot to learn -- let's get started!
I think that if you go through your code, removing Dynamic Data Wires, recognizing where you have Arrays of Waveforms and handling it appropriately (here's an idea -- wire the Array of Waveforms into a For Loop, which will give you an Index Array input tunnel that will enumerate each waveform in the Array. Put a Case Structure inside wired to the Index, "i", so it "counts" 0, 1, 2, etc., and put inside the, say, 0 case the code you need to calibrate Channel 0, in the 1 case calibrate Channel 1, etc., then let the output, a single Waveform representing one of your channels, pass back out through the For loop as an Indexed Tunnel and Presto, you've gone from N Uncalibrated Waveforms to N Calibrated Waveforms).
That last point -- any time you have multiples (in an Array), see if you can process the entire Array, possibly doing different things for different Array Indices, but often you'll be doing the same thing for each Array element. The For loop, with its Indexing Input and Output Tunnels, lets you work on a single Array element inside the loop and reassemble it on output. Neat!
OK. Clean this up. You are off to a good start.
Bob Schor