10-18-2022 08:00 AM
Hi,
I constantly get temperatures from a sensor and I want to build the temperatures difference from the start temperature and each other temperature. The Problem is that my Sub VI is in a Main VI with a while loop so the 0 index of the array (with the temperatures) is not always the same. How can I save and use the very first start temperature T0?
Solved! Go to Solution.
10-18-2022 08:10 AM
10-18-2022 10:02 AM
First of all thank you for your fast answer.
Then why do I get every second another Element. My Indicator changes constantly.
And I cannot use a shift register because I work in a Sub VI and I am not able to use the Main VI.
10-18-2022 10:24 AM - edited 10-18-2022 10:26 AM
Hi deli,
@DeliMB wrote:
Then why do I get every second another Element. My Indicator changes constantly.
Because with each iteration you create a new array made of one single random number...
What else do you expect from your code???
@DeliMB wrote:And I cannot use a shift register because I work in a Sub VI and I am not able to use the Main VI.
You can use shift registers in your mainVI as well as in the subVI. When you don't know this I recommend the beginner tutorials offered at the top of the LabVIEW board!
Hint: Examine the point-by-point functions to learn about (one way of) using shift registers...
10-18-2022 11:15 AM
Yes Sir that was my Point. i Need the very first Element of the very first Array.
I will try it with the Shift Register.
thanks a lot Mister Gerd!
10-18-2022 02:21 PM
Your code is senseless. Your loop is building a new array every iteration using a random number wired to all elements of the array. Your indicator called appended array is never an appended array. It will always be a three element array containing the exact same random value in each element.
I highly recommend that you go through the tutorials linked at the top of the forums page.
10-18-2022 05:12 PM
I Know that this is senseless. I just want do Show my Problem as you can See there is Not a Input of a Temperature sensor.
i just wanted to Know how I can Save and use the First Element of my array. I Need the temperature T0 and thats my Point. (I thought it should be the index 0 But this doesn‘t work in a while Loop)
I Hope someone understands me.
10-18-2022 07:58 PM
I Know that. I just want to explain my problem. As you can See there isn‘t any temperature inputs. That’s Just a VI that I Made to show my problem.
I want to Save and use the First Element of the First Array (everything Happens in a while Loop), Thats the start temperature T0. So I can calculate the temperature difference between the First and each other Element.
I Hope someone understands me now.
10-19-2022 12:58 AM - edited 10-19-2022 01:03 AM
Hi Deli,
@DeliMB wrote:
I want to Save and use the First Element of the First Array (everything Happens in a while Loop), Thats the start temperature T0. So I can calculate the temperature difference between the First and each other Element.
Store the first element of the array to a shift register - but only in the first iteration of your loop!
You need a shift register and a case structure (or Select node)…
Or you measure T0 before your loop and just use a wire to feed it into the loop.
Or you build a statemachine with one state of "measure T0" and other states like "measure new values". Then use shift registers again…
Or…