07-18-2012 06:28 AM
Dear All ,
Can I put "abort execution button" and "Run button" in GUI with bigger buttons ?
Thanks.....
07-18-2012 06:43 AM - edited 07-18-2012 06:49 AM
You shouldn't use "abort execution". Never ever!
What you are looking for is a state machine with idle case. In this idle case, you poll the "run" button. Once your machine is working, all your transitions will poll the "abort" button (i would rather call it "stop" in distinction to "quit") and handle it appropriately.
Norbert
EDIT: Danil is of course right. The buttons i refer to are front panel elements (not connected to the "buttons" in the icon bar!) and so the VI has to run in order to poll those buttons.
07-18-2012 06:46 AM
07-18-2012 07:37 AM
@Norbert_B wrote:
You shouldn't use "abort execution". Never ever!
Unless you have a situation like this. (note that it's from the same poster)
To OP: Are you simply asking for a bigger toolbar?
07-18-2012 07:39 AM
@danil33 wrote:
As I understand from your question If you want a button that starts running the VI, that won't be easily possible, because the VI needs to be running in order to read the button state.
Not exactly. XControls get around this "limitation". See example... http://forums.ni.com/t5/LabVIEW/Adding-Run-Button-to-VI/m-p/1027332#M457607
07-18-2012 07:42 AM
@smercurio_fc wrote:
@Norbert_B wrote:
You shouldn't use "abort execution". Never ever!
Unless you have a situation like this. (note that it's from the same poster)[...]
Still i insist on NEVER EVER!
It always gives me stomacheache seeing something like this. To be more precise: You should never ever come into a situation like this!
There is a reason for advanced design patterns like producer/consumer or actor framework......
Norbert
07-18-2012 07:48 AM - edited 07-18-2012 07:49 AM
I wasn't disagreeing with you Norbert. I was simply pointing out a suspected reason for the question, given the earlier post.
07-19-2012 03:44 AM
Exactly I want to create button in gui and link it to " Run button in toolbar" and create other button link to "Abort button in toolbar"
07-19-2012 03:54 AM
This is not possible but if it was, not suggested (the abort button).
Norbert
07-19-2012 04:01 AM - edited 07-19-2012 04:03 AM
Hi wMw.
Aborting normally works fine for very small applications or architectures but not for anything after that. Aborting a VI can leave things in states that you don't want to be in or references open. Sometimes you do need to Abort the code though (other programming environments use Abort buttons) so I don't think we can get rid of it entirely.But try to avoid it maximum.
EDIT:why you are trying to do such a strange thing??