LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Different Values to Start and Stop Motor

Hello All,

 

I'm pretty new to labview and have been searching for a solution for this for couple of days now. If someone can help me out, I will appreciate it.

 

I'm trying to turn a motor on and off based on its temperature. When it reaches 90C I want it to stop. Which it does in the current code. But I want it to wait till the temperature drops to 30C before starting again, instead of starting right back up immediately it drops below 90C. There must be better ways to do what I have done. If someone knows how to do t his please let me know.

 

Thank you

0 Kudos
Message 1 of 4
(2,345 Views)

Use a shift register to maintain a "State" variable. Initialize a Boolean to "F", then when the motor turns off the first time, change the boolean to True. Use that boolean to do a different compare; instead of constantly comparing to 90C, compare it to 30C. When it turns back on, switch the boolean back to False.

 

Ideally you'd put the whole thing in a state machine, but that's a little more advanced than your VI needs right now. Any further development will require more of a "framework" but for now, you can just toggle a value to pick a different set of actions depending on if it just turned on or if it just turned off.

Message 2 of 4
(2,329 Views)

In this thread, https://forums.ni.com/t5/LabVIEW/Help-with-school-project/m-p/3748320, someone was asking for a similar thing.

 

I referred them to back to an older thread where I posted a subVI that handles that control mechanism.

https://forums.ni.com/t5/LabVIEW/refrigerator-temperature-control/m-p/1095955

 

Message 3 of 4
(2,307 Views)

Thank you! I was able to make it work with the feed back loop with the cluster.

0 Kudos
Message 4 of 4
(2,296 Views)