07-12-2013 04:12 AM
Hi,
this seems very simple, but impossible to do with LABVIEW !?
See attached VI "ON OFF E3648-E3649".
I want to command 2 power supplies ON (one button), then permanently read current throuhg readback, and switch OFF with another button.
But it doesn't work...
07-12-2013 04:33 AM
Hello Lucas,
Nothing is impossible, its just that you need to have the right knowledge about using the tools you have.
Regarding your implementation, the first thing i would advice is that never put a while loop inside an event structure. You are actually blocking the program flow by doing this. You can study about simple State Machines and use the state machine concepts for implementing the same logic. It will be as simple as you expect it to be and will be more effecient as well.
Check out these links:
http://www.ni.com/white-paper/7595/en/
http://www.ni.com/white-paper/3024/en/
Warm regards,
Nitz
07-12-2013 09:12 AM
the problem is data flow.... unless it is a sub.vi that opens front panel and it is then you can shut it down.
since you have multiple controls you want to write and indicators you want to read...you can use an event driven producer/consumer design
07-12-2013 10:04 AM
Your event is set to lock the front panel until it completes, meaning that interactions with the "MISE Off" button is not possible while the event executes and your code will lock up indefinitely because the event cannot complete. As a quick bandaid solution, uncheck that option in the event configuration.
Still, you have a very poor design and it should be improved. Use a proper state machine architecture.