LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

status of VI

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

0 Kudos
Message 1 of 7
(2,924 Views)

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.

0 Kudos
Message 2 of 7
(2,922 Views)

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

Chris | Applications Engineer NIUK
0 Kudos
Message 3 of 7
(2,919 Views)

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

0 Kudos
Message 4 of 7
(2,913 Views)

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.

0 Kudos
Message 5 of 7
(2,907 Views)

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??

0 Kudos
Message 6 of 7
(2,900 Views)

Hi

 

Yes you should be able to write a string constant to the variable and it will be output on your front panel.

 

Thanks

Chris | Applications Engineer NIUK
0 Kudos
Message 7 of 7
(2,896 Views)