01-07-2010 10:02 AM
I am creating an application. I disabled the run and abort buttons
on the front panel. I want to run the code by using simple buttons
of the frontpanel other than the run button. If anyone can give me
a simple example like generating random number inside a while loop
but without using the run button on top of frontpanel it could be great.
01-07-2010 10:20 AM
Would these be acceptable solutions
01-07-2010 10:27 AM
What you are saying is that I should run it automaticaly when the VI opens
and just use an event structure inside labview to wait for start button. This
does look like a soultion, but wouldnt it take lot of memory if its big application.
Is there anyway I can trigger the Run or the command you just mentioned.
The other problem is I need to create an infinite loop in such cases, because if I stop
the while loop it wouldnot execute again when i press start.
01-07-2010 10:36 AM
Is there not a confusion between notion of edition and run mode?
Why not create an executable if you don't want use the development interface?
You could launch a VI via dynamic link or a method but your case is not very clear or I don't understand.
01-07-2010 10:50 AM
01-07-2010 11:05 AM
thanks for your response. I had this idea. I have slightly modified the frontpanel
which was attahced to the post above. Now if you open the VI you will see that
it will run automatically and even generate numbers. But as soon as you stop it
it wouldnot work since I have made Run and abort buttons invisible. All I need is
to stop and run the code again by not using ctrl+R but by placing another button
on the front panel. I have atahced the VI.
01-07-2010 12:15 PM
01-07-2010 12:48 PM
You already got great advice, here are some general comments.
Yesh wrote:
What you are saying is that I should run it automaticaly when the VI opens
and just use an event structure inside labview to wait for start button. This
does look like a soultion, but wouldnt it take lot of memory if its big application.
Is there anyway I can trigger the Run or the command you just mentioned.
I think you have a misconception here. Once a VI is loaded into memory, there is little
difference in memory use between running or not running. If an event structure is just
waiting, CPU use is ~zero.
Yesh wrote:The other problem is I need to create an infinite loop in such cases, because if I stop
the while loop it wouldnot execute again when i press start.
Once the VI is set to run when opened, the only reason to stop it is to make edit changes.
(Once it is built into an application, it shoud close when done).
Don't make an infinite loop, but make sure to detect when the user is done with the program.
If there is hardware involved, certain shutdown steps are often needed (disconnect from instrument,
set voltages to zero, etc.), so you could trigger those with a "panel close?" event, for example.
01-11-2010 04:02 PM
Still stuck at the same problem. Forget the
above posts where I wanted to run the Vi
when they are opened. Is ther any damn way
to run the code without using then Run button,
not using CTRL+R, and not Run the VI when its
opened. I want to create a custom Run button on
the front panel. thats it
The biggest problem witht he Run when open the VI
is when you stop the execution of VI, you cannot restart
it agin unles you have acces to run button.
01-11-2010 04:17 PM - edited 01-11-2010 04:18 PM
Yesh wrote:Still stuck at the same problem. Forget the
above posts where I wanted to run the Vi
when they are opened. Is ther any damn way
to run the code without using then Run button,
not using CTRL+R, and not Run the VI when its
opened. I want to create a custom Run button on
the front panel. thats it
This has already been answered. Answer: NO.
The biggest problem witht he Run when open the VIis when you stop the execution of VI, you cannot restart
it agin unles you have acces to run button.
It sounds like you're configuring the VI properties to hide the Run button. Methinks you may just want to turn off the toolbar when running.