LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

shift register

i have to Monitor the last three temperature readings, if i get three “High” temperatures in a row the  Emergency LED light. The temperature has been too high for three (or more) successive readings). Once the temperature changes back to something other than high else the light off.

this is my attempt 

jiji_830_0-1638570526369.png

 

0 Kudos
Message 1 of 6
(2,040 Views)
It's a good start. If you want this to run continuously, you should use a while loop, not a for loop. Maybe the value you actually want in your shift register is a boolean for "high temp", so you don't have to do the temperature comparison for all 3 history registers every loop.
0 Kudos
Message 2 of 6
(2,027 Views)

@jiji_830 wrote:

this is my attempt 


No, that's just an image. If you want help, attach your VI.

 

  • Why do you wire a 3 to N of the FOR loop if you want to read an infinite amount of readings, always averaging the last three? (In your case i+1 can never be larger than 3)
  • You want to take the average of the current and two previous reading and compare that with your boundary. You are currently summing "-1, -2, -3" instead of "0, -1, -2"
  • Why does the subVI have a blue output? That's a very poor thermometer!
  • What's the purpose of the all the dead code?
  • What is your desired loop rate? It is unlikely that the temperature changes significantly every nanosecond.
0 Kudos
Message 3 of 6
(2,026 Views)

could someone help me to figure it out , I still not got it .thank you

0 Kudos
Message 4 of 6
(1,826 Views)

Try wiring the output of your comparison to the Shift Register.  You should also initialize the all of the Shift Register values to FALSE.  Then you can use the Compound Arithmetic Node in the AND configuration to see if all of the 3 previous values are TRUE.  You can wire that result straight to your indicator.


GCentral
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 5 of 6
(1,788 Views)

@jiji_830 wrote:

could someone help me to figure it out , I still not got it .thank you


Sorry, I don't have LabVIEW 2021 here, but see if this can give you some ideas:

 

 

altenbach_0-1638892352704.png

 

 

(Make sure you fully understand every single element!)

 

Note that this is scalable code. For example if you later want to modify it so the LED goes on only if the last 1000 reading are above a certain threshold, all you need to change is a single diagram constant (which one?). In your original code picture, you would need a diagram the size of a skyscraper! Of course for large histories there are even more efficient solutions. You figure it out 🙂 )

0 Kudos
Message 6 of 6
(1,784 Views)