LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

feeding dynamic data into formula is causing slow execution and weird results

Solved!
Go to solution

I am gathering 11 channels of analog input voltage, then performing a series of (different, editable) calculations on each channel of voltage to convert each to sensor temperature.

 

My first stage of calculations (using multiply, subtract, and divide blocks) works fine.

 

My second stage of calculations (which includes a natural log "ln") is being performed with the formula block. However, the formula block has three red arrows where the input constants are, and the results of the formula block are intermittent and incorrect (if plotted, the plot just flashes what looks like a value of 1 intermittently... if saved to a csv file, the results show a bunch of zeros and then a row of values, then more zeroes).

 

I'm not sure if I need to be converting my dynamic data to an array before feeding into the formula, or if there's some other way applying a complex formula to dynamic data, or...? I'd like to stick with dynamic data because it makes plotting things easier, but I'm open to other suggestions.

 

Capture1.PNG

Capture2.PNG

Download All
0 Kudos
Message 1 of 14
(4,140 Views)
Solution
Accepted by topic author solobo

The answer is very simple -- do not use Dynamic Data.  I've never understood why NI created this (other than to show "how easy it is to collect data using the DAQ Assistant and Express VIs" (and not mentioning that you lose a lot of control over what you are doing).  There have been numerous questions here in the Forums and a number of responders with a lot more experience than I have also made the same recommendation.

 

I'm not sure where the Dynamic Data arises in your case.  If it is coming from the DAQ Assistant, by all means read this and get rid of that Assistant!

 

Bob schor

0 Kudos
Message 2 of 14
(4,135 Views)

Is dynamic data really useless? I thought it contained a timestamp, which the array would not. I may be confusing that with the waveform data type though... it looks like splitting my waveform turns the datatype from waveform to dynamic.

 

 

0 Kudos
Message 3 of 14
(4,118 Views)
No, it's useless. It doesn't contain anything that the waveform data type doesn't have. You would not use the split function on a waveform. A simple index array is all that is needed.
0 Kudos
Message 4 of 14
(4,108 Views)
One other thing is that your images do not show any three red arrows unless you are referring to the cocoon dots. Your formulas seem to have integers defined as the inputs and you are passing DBLs. Please be s little more specific about 'incorrect' results.
0 Kudos
Message 5 of 14
(4,099 Views)

Regarding dynamic data/waveform: if I conver either one to an array, I lose timestamp information, correct?

 

Regarding index array, I'm not aware of a way to seperately index every column of an array (or channel of waveform) unless I used many index array functions (one for each column), correct? (unless I used a loop).

 

I think my formula inputs (a0, b0, c0) are doubles, and my other input (R) is dynamic data, correct? The little "arrows" I see are right where the a0, b0, and c0 constants feed in. I'm not sure what cocoon dots are?

0 Kudos
Message 6 of 14
(4,081 Views)
Yes, you lose timestamp data if you convert to DBL array. Keep it as waveform data.

No, a single Index Array can be dragged down to provide multiple outputs. You don't even have to wire the index element inputs if you start at index 0.

I don't use the Express Formula so I don't know what it expects. The dots (nor arrows) indicate the data is being coerced from one type to another. If it is trying to coerce to dynamic data, it could be anything at all.
0 Kudos
Message 7 of 14
(4,071 Views)

Converting from a waveform to a double array makes you lose time information.

 

Index Array can be expanded to index out as many items as you need.

 

He meant Coercion Dots.  The spellcheck probably went to cocoon.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 14
(4,069 Views)
Oops, didn't even notice 'cocoon'. Sorry.
0 Kudos
Message 9 of 14
(4,067 Views)

Thanks, that makes sense. For now I'll stick with converting to an array, it sounds like there's no good way to do natural log equations on a waverform / dynamic data.

0 Kudos
Message 10 of 14
(4,055 Views)