07-29-2011 09:15 AM
Hi to all,
I was wondering if it is possible to run a vi with a button placed on the front panel.
Regards,
Palazzo
07-29-2011 09:23 AM
07-29-2011 09:33 AM
The answer of a such a question can be like that of course 🙂
I should accept your answer with kudos 🙂
anyway how to manage it, can you tell me a little more or may be some visual examples.
thanks
07-29-2011 09:33 AM - edited 07-29-2011 09:36 AM
How is it possible? You can run a VI with the run arrow or you can set it to run when opened. You can call and run a subVI by pressing a button on a running VI. But if a VI is not running then the FP buttons will not do anything unless they are XControls. But my experience with XControls is very close to zero.
I have been wrong many times before. Whenever I find out I am wrong it means that I learned something so I don't mind
Edit: GerdW I think I get it now. Yes it is possible to run a VI even if it has a button on the front panel
07-29-2011 09:39 AM
Run vi when opened is not useful in my application, I know that option, thanks.
What are the xcontrols and what are they for? Can you inform me a little about that?
Regards
Palazzo
07-29-2011 09:44 AM - edited 07-29-2011 09:47 AM
07-29-2011 09:47 AM - edited 07-29-2011 09:52 AM
@Palazzo wrote:
Run vi when opened is not useful in my application, I know that option, thanks.
Can you elaborate? Programmed as a proper state machine, have the program run in an idle state that only waits for for a button press.
There is no need ever to go to edit mode during execution of a finished program.
while I have written a demo Xcontrol to show that everything is possible, I strongly recommend against it. It makes no sense.
See here for the example and instructions. But please read the entire thread, though.
07-29-2011 09:50 AM - edited 07-29-2011 09:51 AM
GerdW,
Sorry, take this as enexperience, but I don't get the point of using this loops. Actually I don't get how the run button and the controller of the while loop relate. The code you've written, is it useful in math script node?
Regards,
Palazzo
07-29-2011 09:52 AM
GerdW, that VI is running!
Palazzo, XControls are custom controls with a block diagram. They are running even in edit mode. They contain an event structure with an event to run when you drop it on the front panel and when the user interacts with it. If it is possible with an XControl to run the VI in which it is placed that is only an interesting curiosity.
Altenbach, yes I totally agree that you would not want edit mode to ever be part of the end users experience.
07-29-2011 04:11 PM
It seems we should avoid that approach.