LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time loop... or how you call this ?

Solved!
Go to solution

    Hello all

 

   I am new in Labview and I need to do something like I will describe in the next lines.

   So, must do a thermostat application. The thing which I do not how to make is this : The resistance of the heater has to be ON for 2 seconds and to be OFF for 55 seconds. This cicle has to go until the set themperature is reached.

  Can anyone help me ?

  P.S. I use LabVIEW 8.5

 

0 Kudos
Message 1 of 12
(3,537 Views)

What are you using to drive the heater? Just a digital line? If so, you just need a delay function between tour writes.

0 Kudos
Message 2 of 12
(3,522 Views)

I'm using a relay connected to a I/O line. But unfortunately in this project I will use all the I/O ports from my device. The heater problem is only one part from the big picture.

0 Kudos
Message 3 of 12
(3,504 Views)

Hi Laurentiu,

 

"But unfortunately in this project I will use all the I/O ports from my device."

Ok, that's fine. But, what the heck, has it to do with using a Delay aka "Wait (ms)" function in your code?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(3,497 Views)


Sorry to repeat myself, but I am really new in Labview. I designed my project 'till this part. I spent so many days with it and it is not working. Can someone design this part for me ? Thankyou !

0 Kudos
Message 5 of 12
(3,473 Views)

Well, we cannot fully solve this unless we know how the rest of the program is architected.

 

Still, you could do a while loop that spins at a 1 second interval. Divide the interation terminal value by 58 using "quotient and remainder" and do a comparison on the remainder. If it is less or equal one: Heats, else: don't heat.   

0 Kudos
Message 6 of 12
(3,468 Views)

Or even simpler a squence with Heat and wait for 2 sec and then no heat and wait for 55 sec ... However i somehow dont think that's actually what you want to do.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 12
(3,456 Views)

 Look, the arhitecture is simple (check the attachament). The .VI is only for one sensor (lm35). I have to remind you all that I am new with Labview and I'm not intending to use it for complex opreation then this. If I made something wrong, please corect me by showing me in a .VI file. I learn fast only by seeing.

   So, in order to achieve the set temperature measured with the LM35 sensor, the heating element must be 2 seconds ON and 50 seconds OFF . But this cicle I want to use it for each sensor separately.

    Thankyou for your time!

0 Kudos
Message 8 of 12
(3,434 Views)
Solution
Accepted by laurentiu

 


@laurentiu wrote:

 Look, the arhitecture is simple (check the attachament). The .VI is only for one sensor (lm35). I have to remind you all that I am new with Labview and I'm not intending to use it for complex opreation then this. If I made something wrong, please corect me by showing me in a .VI file. I learn fast only by seeing.

   So, in order to achieve the set temperature measured with the LM35 sensor, the heating element must be 2 seconds ON and 50 seconds OFF . But this cicle I want to use it for each sensor separately.

    Thankyou for your time!


 

You don't really provide enough information. How many heaters are there, how do you interact with them? If you have multiple sensors and heaters, do the same thing but with an array of heater readings and an array of heaters. Code would be almost identical.

 

Since your loop spins at a rate of 1Hz, easiest would be to use my method, but of course a more scalable state machine would be more appropriate. Here's a quick draft.

 

 

Some of the problems in your code:

 

  • Your feedback node needs to be initialized, else it remembers the data from the previous run.
  • I would suggest a shift register instead.
  • It is really not a good idea to grow an array without bounds like this. What is the typical maximum array size?
  • Place your array indicator and array output on the other side of the feedback node, else they lag one iteration behind.
  • "Insert into array" is the wrong tool. Use "built array" to build an array.
  • Why is the front panel and diagram maximised to the screen. That's an annoying habit.
  • Should the loop stop when the temperature is reached? In this case wire the temperature comparison to the loop condition in the right logic.

 

 

Message 9 of 12
(3,418 Views)

Hello,

 

 For my application I intend to use sensors for temperature, humidity, CO2%. I intend to measure the environment parameters in a room. This is for my PhD thesis. I must say that I am not a PhD student at a electronic profile University so this is why i do not know how to do it. I just try to handle it the best I can.

   Alterbach, I will try the configuration and I'll come back with a replay soon as possible.

   Thankyou !

0 Kudos
Message 10 of 12
(3,395 Views)