LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

temperature difference

Solved!
Go to solution

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? 

 

0 Kudos
Message 1 of 9
(1,972 Views)

Hi Deli,

 


@DeliMB wrote:

so the 0 index of the array (with the temperatures) is not always the same. 


The index "0" of an array will always be the index "0"…

 


@DeliMB wrote:

How can I save and use the very first start temperature T0? 


Use a shift register for T0…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(1,968 Views)

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.

0 Kudos
Message 3 of 9
(1,928 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(1,924 Views)

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! 

0 Kudos
Message 5 of 9
(1,899 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 9
(1,869 Views)

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. 

0 Kudos
Message 7 of 9
(1,811 Views)

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. 

0 Kudos
Message 8 of 9
(1,850 Views)
Solution
Accepted by topic author DeliMB

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(1,835 Views)