04-24-2015 01:16 AM
Sorry in advance for the code filled with flaws, Im new to labview and this is part of my assignemnt (to create a smart house).
Problem im currently facing is, I have more than 10 fan in for my smart house however the only ways i could think of to make it all run indenpendently was to put it in 2 while loop(bad practice ><). Worst case scenario, due to i need all of the fan to be able to switch on and off by Knob, i need to keep all these (20) loops to keep running.
I did my research regarding using event case and make a string register to pause it with -1, but i have no idea on how to implement it to my scenario.
my vi file attached below shows how I make it run
what I was expected:
Fan will be off at 0, Speed decresing according to increasing number of knob respectively (i just connect knob to timer).
Please do lend me a hand on the fan =((( This is the only last part im struggling for >< thanks
04-24-2015 01:36 AM
use a single loop running at a sifficiently fast rate (e.g. 1ms loop time), then use quotient and remainder of the iteration count and the array of speeds to see which loop needs to advance.
Some glaring mistakes:
04-24-2015 02:42 AM - edited 04-24-2015 02:42 AM
Thanks for helping me =)) i realllly appriciate it 😃
I tried to edit the code according to your comment, it works =))
however =(, after i set it as 0 to stop it, it will no longer run again. is there any way to make it still able to run like pausing the loop and continue it when its not 0 ?
again, sorry for my ignorance >< i really dont get use to code with labview >< its so different ><
04-24-2015 06:45 AM - edited 04-24-2015 06:45 AM
@kavierkoo wrote:
however =(, after i set it as 0 to stop it, it will no longer run again.
Of course it does. You told the loop to stop.
I think you just want to use a case stucutre around the terminal so that you only update it when the value it above 0. You should also use a seperate button to stop the loop.

04-24-2015 06:51 AM
Thanks for the guiding, I tried the code but when my knob is at 0 the loop is not stopping but increase even faster >< i need a way to pause the loop because if 20 loops run together at the same time, my system will be very not efficient =(
04-24-2015 07:09 AM
Then use a Select function. If your value is 0, set the delay to 100.