LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

not able to execute while loop

I am using programmable RUN button to run the VI, but in this mode I am not able to control the components inside the while loop. please see the attached VI. looking for help.

0 Kudos
Message 1 of 18
(2,587 Views)

Your VI is broken.  It seems your "Start Button", although it appears to be a double precision floating point numeric, is some sort of Xcontrol.  You didn't attach the Xcontrol file.

 

Where did you get this Xcontrol from?  What are you really trying to do?  Do you really need an Xcontrol?  Your attached VI is rather simple, I'm not sure it reflects what you are trying to do, but a well designed state machine architecture is probably a better alternative than messing with Xcontrols.

0 Kudos
Message 2 of 18
(2,569 Views)

Is it possible you are trying something really (really!!!) silly, such as this?

 

(who wrote your xcontrol? Maybe it never returns???)

 

There is a run button in the tool bar, and that's probably all you need. Once your program is implemented as a state machine (instead of a sequence worm) and once deployed, set to to "run when opened" going into a state that waits for input.

 

In the mean time, go a bit further with some introductory tutorials. Do you really need a greedy loop? Do you really need a sequence?

Message 3 of 18
(2,506 Views)

please find the ctl file as attachment and try running the RunButton1.vi. In this if you run the VI using run control button, the bolean and stop button didnt work but if you run this vi using the default run button of the vi at the top left corner it works fine. 

 

My aim here is to run the VI using an alternate method i.e. RUN control.

 

 

 

0 Kudos
Message 4 of 18
(2,473 Views)

Hi Kashif,

 

you missed to attach the whole XControl. (You better ZIP the whole folder containing ALL related files!)

 

My aim here is to run the VI using an alternate method i.e. RUN control.

And why do you need a XControl to do that?

"Alternate method" compared to what else?

Why not use a simple subVI call - or simple VIServer calls?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 18
(2,456 Views)

Dear GerdW,

 

i am not able to attach the X control, as this portal is showing error while attaching the file alone as well as in ZIP.

 

Alternately: please find the youtube link, I followed these steps to create the RUN

https://www.youtube.com/watch?v=oMSFBQV67XE&list=WL&index=10&t=0s

 

My aim is not to use the run button of the front panel at the top left corner (alternate method) but instead use some boolean to run the VI.

 

I think for subVI call, first I have to run the VI by clicking on the default run button of the front panel (which I didn't want to ).

 

Regards

kashif

 

0 Kudos
Message 6 of 18
(2,440 Views)

Hi kashif,

 

you cannot attach ZIP files? (Everybody else can…)

 

My aim is not to use the run button of the front panel at the top left corner (alternate method) but instead use some boolean to run the VI.

Put a (default) boolean button on your front panel.

Use an event structure to wait for a value change event for this button.

When the event occurs you can start/call the remaining code.

No XControl needed! (Even a simple polling loop could do this…)

 

(In an executable the code automatically runs when opened, so you need to wait for user input anyway. In a VI you may set the VI to "run when opened", but this is a bad choice IMHO: your customers should only get executables.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 18
(2,433 Views)

Hello GerdW,

 

I am attaching the screenshot of the error while sending the zip.

 

I was doing the same thing that you suggested, but my guide didn't want to run the VI by default in executables but instead want to add the boolean to control the run command. So I used the method suggested by the link that I shared.

 

regards

kashif

0 Kudos
Message 8 of 18
(2,430 Views)

Hi Kashif,

 

I am attaching the screenshot of the error while sending the ZIP.

The error says "RAR not allowed".

Do you spot the problem?

 

my guide didn't want to run the VI by default in executables

So your "guide" wants a feature which is against ALL standard conventions about running executables?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 18
(2,426 Views)

Dear GerdW,

 

So what's the alternate way to send the file. I am attaching the second screenshot of the error while sending the single file.

 

 

So your "guide" wants a feature which is against ALL standard conventions about running executables?

I didn't have anything to say on this but to find the solution.

 

The above solution did work but the problem I am facing is while executing the loop.

 

Regards

Kashif

0 Kudos
Message 10 of 18
(2,421 Views)