08-13-2012 08:28 AM - edited 08-13-2012 08:28 AM
Hi all,
I have encountered a problem in my program and I need help debugging it.
I think the picture is too small, you may need to right click and zoom it.
My main focus is this portion,
I am trying to implement a function that allow user to calculate a new value if true, or input value by control if false.
My problem is that my calculated mean value is not leaving the tunnel. Only the value in false case is passed out. I know this got to do with the boolean properties, which I set to latch when release. Upon completing true case, it goes to false case and hence the value in false cased is passed out. I need the button to be press and release after completing the code in the case and pass the value for other calculation. I hope anyone can understand my problem.Thanks!!!
08-13-2012 08:34 AM
I can't make out any of your code. Can you just post the actual VI?
08-13-2012 08:58 AM - edited 08-13-2012 09:06 AM
Hi crossrulz,
Thanks for your reply, I don't have the manufacturer driver now and some subvi as I am not at my work place is it okay for you to look at the program without it?
08-13-2012 09:00 AM
Hi MrLearners,
Set the mechanical action to Switch when pressed.
Make the boolean true at the begining of the code and make it false after mean has calculated.
Regards,
Prashant
08-13-2012 09:30 AM
Hi Crossrulz,
This is the snippet of my program.
08-13-2012 10:19 AM
Hi Prashant,
How can I do that?
08-13-2012 10:44 AM
I'll start with the obvious question:
Have you stepped through it/watched it with the highlight on with Plot 2 set to True and seen the False value come out? If the answer is yes, then I'm not sure where to start and could do with something clearer than a snippet to look at. If the answer is no, try it and see what happens.
If you do see the true case enacted then the chances are that the program is just running so fast that the value is being overwritten by the false case before you can see it. There are various options for maintaing that value if that is what's needed, and the value out of the case shown,
08-13-2012 10:50 AM
If your Plot and Calculate buttons are both false, you have what we call a "greedy loop". The while loop will run as fast as it can. So what is happening is you press the Calculate button, the data is aquired and the Mean is calculatated, but then the next iteration comes before you can see it, Calculate is now false, and so the value in Phase Shift 2 is the output of the case structure.
08-13-2012 11:45 AM
Hi Crossrulz,
How would you suggest me to fix it?
08-13-2012 12:02 PM
Hi KarthrynB,
I have tried watching it with the the highlight and on Plot 2 set to true, I am seeing the False value come out.