05-11-2017 10:02 AM
I would like to create a start button for my VI for when I export the program to be used without being able to edit.
I know that I can select start VI upon opening and I have then created a start button by using a while loop where the stop button is linked to the start button. (So loop finishes and VI continues once the stop button has been pressed). However, my issue is that my VI has user inputs that are required and when I press run and then try to change the user inputs before pressing start, these are not registered.
Is there a way to make this work so that the VI can be started via opening and user inputs can be changed before pressing start?
Thanks
05-11-2017 10:23 AM
05-11-2017 10:34 AM
Thank you, would you mind please explaining how your solution works. I am not familiar with the functionality of event structures.
By 'code to process inputs' do you mean the rest of my VI?
Thanks
05-11-2017 10:46 AM
http://zone.ni.com/reference/en-XX/help/371361K-01/glang/event_structure/
05-11-2017 11:11 AM
I have solved this issue by putting my entire VI into a flat sequence with the start button before it. I can then change inputs before pressing the stop button.
05-11-2017 02:49 PM
Flat structure - is an evil; you'd better use Event Structure. Moreover, it's very easy to use it, nothing complicated - but it gives much more benefits, then flat structure.
Sincerely, kosist90
05-11-2017 03:12 PM
Design your code as a proper state machine. The distributed version should be set to "Run when opened" and start up in an idle state.
You are throwing things like "solved" and "flat sequence" together in one sentence and that tells us that it is probably not solved.
Please attach your code so we can give constructive comments on how to do it better. 😄