11-12-2012 02:52 PM
I have a Vi that has several operations being done in a consecutive order. These are done mainly through FOR and WHILE loops. Once one loop has completed it goes to the next, then the next.. etc..
I want to be able to see on the front panel at which step/operation or in which loop it is in. I attempted with string constants but I am not sure how to clear and reprint the status for after each loop is done
Thanks
11-12-2012 03:00 PM
You'll have to show us some code. My gut feel from you describe is a VI that suffers from sequencitis. (i.e. a bunch of different steps all strung out together with execution order forced by a sequence structure.)
A simple string indicator should do the trick. You should be using a state machine architecture.
11-12-2012 03:01 PM
Hi lvuser333
It sounds to me like a good way to do this would be to create a string indicator on your front panel and a number of local variable references to the indicator.
Upon completion of each loop I'd then write to the indicator using the local variable.
Kind Regards
11-12-2012 03:05 PM
I have attached the VI, as for sequencitis, I want my VI to execute in this order, so I did do this using structure. Is this not the way to do it? I was always taught to use data flow
11-12-2012 03:12 PM
What you have will work. For a while. Then some point in the future you'll get a requirement that says go back to the first loop after the second ends rather than going to the third when some particular condition happen. And you'll have no way of doing that. Look at a state machine architecture and you have one master while loop and a case structure inside. Each case represents one particular state your program is in, whether it is what happens in the first loop, or the 2nd, or the 3rd. You can have a state for initialization code, and one for cleanup code. Each state can output a string constant that upates the indicator terminal in the master loop.
If you continue with the code you have, then just using a local variable of your string indicator will allow you to update it in multiple places of your code such as each loop.
11-12-2012 03:22 PM
Thanks for the help I understand what you are saying. For the local variable however, this can be a string constant as well that will change i.e zeroing scale, cooling down.. etc??
11-12-2012 03:23 PM
Hi
Yes you should be able to write a string constant to the variable and it will be output on your front panel.
Thanks