04-20-2018 10:59 AM
Hello Sir,
I have made a virtual instrument. I need some help regarding if you can tell me how i can restart the while loop in which i have put my DAQ.MX TASK along with trigger and gate.
I want rising curve samples and have to take product and integration of them. If i place the Integration Vi Graphs and Multiplications, they keep on rapidly multiplying. causing error to the required values
I have used cased structure, and switches so that when the value is true it runs the daqmx task, and perform alll the operations after reading the data. BUT IF FALSE, I dont know what to do.
Solved! Go to Solution.
04-20-2018 11:26 AM
04-20-2018 12:28 PM
@Ahmed.Arsalan wrote:Kindly please help!!!
OK, looked at your code.
Please do not attach VIs where the front panel is bigger than the largest monitor and objects scale with the panel. It is a major pain to do anything with your front panel if all decorations are outside the active window and thus nobody will look at your VI. Please fix and re-attach.
From a quick glance, your code is just a convoluted jumble of express VIs, dynamic data, and stacked loop. You probably should do a few more LabVIEW tutorials before continuing all this.
All you need is a proper architecture, e.g. a "state machine" as already mentioned.
04-20-2018 01:32 PM
Thanks for the comments regarding use of state machine. I tried to implement it though..... 🙂
I am a civil engineer with almost no idea of LABVIEW. All this I have learnt in three days as time is a luxury which i dont enjoy at the moment. i have experiments lined up due in next week.
From a quick glance, your code is just a convoluted jumble of express VIs, dynamic data..
In this time I only require one thing ........help me in this convoluted jumble .........
It works perfectly if Run Continuously!
NO DOUBT! YOUR LITTLE JUGGLERY WITH MOUSE CAN MAKE MY DAY!
P.S i have shortened it a little bit, this is perhaps the most out of my abilities!
04-20-2018 08:34 PM
Don't hide the labels of the terminals on the block diagram.
The problem is that the condition that stops the inner while loop, also stops the outer while loop. That means it will only run once.
If you need something else to stop the outer while loop, than wire that condition to it rather than the same wire coming from the inner while loop.
04-20-2018 10:31 PM
@RavensFanIf you need something else to stop the outer while loop, than wire that condition to it rather than the same wire coming from the inner while loop
outer loop should stop with the inner loop.... now how to restart both the loops.....
i cannot allow the integration loop running. as with time the integration values shall increase
04-21-2018 10:16 AM
@Ahmed.Arsalan wrote:
@RavensFanIf you need something else to stop the outer while loop, than wire that condition to it rather than the same wire coming from the inner while loop
outer loop should stop with the inner loop.... now how to restart both the loops.....
i cannot allow the integration loop running. as with time the integration values shall increase
You just contradicted yourself. You want it them to stop together, but then have the outer restart?
As pointed out before, refactor this into a state machine. That way if you have a situation where you want the code to run but basically do nothing such as not integrate, you can have an idle state.
04-25-2018 04:11 AM
Used the Simple State Machine Template and it worked like a charm....
Thanks @RavensFan