Thanks for viewing the VI. I am not asking my work to be done by some one else. someone asked me to forward code to review so i did that. My intial problem was without any code.
I looked at your code and it contains significantly more than what you described. Remove all these inner while loops and surroud the entire code with one big while loop and place a 1000ms wait. Now all inputs will get read 1/second and you can make decisions if the generator should be on or off based on all the values for the controls.
Basically, you have inputs for grid supply, solor suply, and time. (Why do you think you need to measure time twice in parallel? Are you expecting different results?) Then you have various loads connected to switches.