From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-24-2012 11:35 PM
hi guys once again am stuck with a prblm...prblm here is in my VI my aim is fill the tank automaticlly n record the time when the tank starts filling the prblm here is my timer is starting asusaul when tank strt filling but dosent stop when tank reaches to it's max level .....n 1 mre thing is i want calculate the difference of the time i.e.., the strt n end time of tank in seperate cluster.... plz sugget a solution for me if possible plz sugget me a bettr VI...here i am attaching my code so tht u cn hav btr idea wat i am supposed to say
Solved! Go to Solution.
10-24-2012 11:50 PM
You should be using a proper design pattern instead of using two seperate while loops. Check here which gives you some usefull links on State Machine design patterns. (One small suggestion: Do not write in SMS language)
10-25-2012 12:37 AM
hi could be more specific where i need to correct my VI
10-25-2012 12:42 AM
I would say better re-write the whole code with the state machine.
10-25-2012 01:33 AM
I think there is something wrong with your keyboard. Quite a few keys seem to be missing.
You did not include the converter subVI or the type definitions, thus we cannot test your VI. But looking at the code, it makes very little sense. Why do you do this exceedingly complicated formatting operation using three for loops and lots of shift registers and primitives. I am sure it could be done with much less. Anyway, your timer loop runs completely independent from the tank loop, so how are you expecting them to synchronize?
Maybe you can run both code segments in the same loop, for example?
I have the feeling that the functionality of your program could de done with 10% of the code you currently have. try it!
10-25-2012 07:36 AM
i have no idea about state machines....without sate machines can i slove my code
10-25-2012 10:59 AM
10-26-2012 11:38 PM
then tell me how can i do that thing
10-26-2012 11:56 PM
What have you tried so far?
10-27-2012 10:13 AM - edited 10-27-2012 10:14 AM
only using different loop structure...which are not working properly