LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

run a vi in separate while loop, minimize flashing of window

Solved!
Go to solution

Apologies in advance for not including a VI; I can't provide it, can't even provide screenshots.

 

I have a basic state machine with a cluster of booleans that are scanned in the 'default' state, with the index of the scan = true determining the next state. All other states return to the default state. The 'stop' state stops the loop with a boolean constant = True, located inside the case structure wired to the while loop's conditional input (all other states have a False boolean constant wired to it). Outside the case

statement, the wire connected to the conditional input is connected to a boolean indicator, 'Stop, Really'. The delay time inside the state machine's while loop is presently set to 100 ms.

 

In addition to the 'state' shift register, the state machine has a 'boolean' shift register. Every state, except for one, feeds the past value of the boolean through to the next state (i.e., wired directly from left to right side of the case structure). The exception is the state that inverts the boolean, with the inverter output transferred to the next state and also wired to a boolean indicator, 'View Status', the

indicator being outside the case statement but inside the while loop. All other states simply wire the prior state of the boolean through to the next state, unchanged.

 

In addition to the state machine's while loop, I have a parallel while loop (scourge of the LV forums). That while loop's conditional input is wired to a local variable for 'Stop, Really'. A True/False case structure in this while loop contains a subVI in the True case. The boolean input to the case statement is wired to a local variable for 'View Status'. The subVI that's in the true case exists to display status to the

user.

 

The subVI that provides status via its front panel runs a python script via a 'comand prompt' vi. The required update rate for sending the python command is ~ 1/second. Within the subVI is a 1 second time delay after execution of the code.

 

It works but I'm trying to make some improvements with minimal impact to what I have.

 

Two VI Properties cases that are pertinent to behavior of the status subVI (floating or default, modal doesn't work at all):

 

1. With 'Closes when previously closed' selected, the VI window toggles (via main VI's toggle switch) between open and closed but when it's open there's the one-second window flash that might induce seizures in some users.

2. With 'Closes when previously closed' deselected, the window stays open and it's hard to tell the difference between the running and not-running state. Also, the subVI window won't stay minimized for this option.

 

 

Is there a minimally invasive change I could make to the current code to stop the one-second flash described in #1 above and toggle the status subVI window on and off?

 

 

Thanks,

 

Jeff

 

 

 

 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 1 of 22
(3,910 Views)

Can't you post the simplest of stripped down VI's that demonstrates the behavior you are talking about without anything proprietary?

 

Is it the flash of a command line window that is the issue, or the flash of the subVI window?

 

If it is the subVI window, why do you need it to open at all?  Either let it run without opening the front panel, or if it needs to open its window for some reason, can you have it open minimized?

0 Kudos
Message 2 of 22
(3,903 Views)

Have you checked "SubVI Node Setup" in caller VI?

 

Node setup

--
Marko H

OptoFidelity - Enabling Smarter Future

Tampere - Espoo - Oulu - Cupertino - Redmond - Zhuhai

0 Kudos
Message 3 of 22
(3,864 Views)

@RavensFan wrote:

Can't you post the simplest of stripped down VI's that demonstrates the behavior you are talking about without anything proprietary?

 

Is it the flash of a command line window that is the issue, or the flash of the subVI window?

 

If it is the subVI window, why do you need it to open at all?  Either let it run without opening the front panel, or if it needs to open its window for some reason, can you have it open minimized?


I don't have LV on the pc with email and didn't ave time to create a sample vi and get security's approval to email it.

 

The command prompt vi is set so it doesn't show up. The flashing is the subVI opening and closing. I can see the vi tab appear and disappear at the bar on the bottom of the window.

 

The subVI panel has information the operator needs. The vi panel is gone for a very short period because I don' have a time delay in the second while loop. The one second delay is within the subVI's sequence, in the sequence pane right after the command prompt pane. The last pane in the sequence processes the output of the command prompt and updates several color boxes based on the results.

 

Itn the short term, it might be acceptable to the users to have a small flashing indicator in the subVI panel of the "deselection of the close if closed before" option to let the user know that the panel is getting updates. 

 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 4 of 22
(3,845 Views)

This looks like a subset of the VI properties (window appearance pulldown) I edited for the subVI itself. Would I get different results? I'm off today so I can't try it til later.


@mjhakkar wrote:

Have you checked "SubVI Node Setup" in caller VI?

 

Node setup


 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 5 of 22
(3,840 Views)

I haven't really read the OP properly- too much effort. A simple diagram would have spoken a 1000 words.

 

Maybe the property nodes '(dis/en)able front panel updates' would be usfual prior/post updating indicator values?

0 Kudos
Message 6 of 22
(3,827 Views)

@ToeCutter wrote:

I haven't really read the OP properly- too much effort. A simple diagram would have spoken a 1000 words.

 

Maybe the property nodes '(dis/en)able front panel updates' would be usfual prior/post updating indicator values?


If I have time tomorrow night, I'll create a similar VI in LV 7 Student Edition, the only version I have at home now.

 

Regards,

 

 

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 7 of 22
(3,786 Views)

For $50 you can get LV 2014 Home Bundle here! 

 

Essentially it is LabVIEW Full version that you can't use for anything but personal use.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 22
(3,773 Views)

@billko wrote:

For $50 you can get LV 2014 Home Bundle here! 

 

Essentially it is LabVIEW Full version that you can't use for anything but personal use.


Yeah, I heard about it from NI at a recent LV user's group meeting in Fort Worth. WIsh it could make executables. I haven't bought it yet.

Jeffrey Bledsoe
Electrical Engineer
0 Kudos
Message 9 of 22
(3,757 Views)

@ToeCutter wrote:

I haven't really read the OP properly- too much effort. A simple diagram would have spoken a 1000 words.

 

Maybe the property nodes '(dis/en)able front panel updates' would be usfual prior/post updating indicator values?


Decided to create the example VIs tonight. See attached.

 

A button on the main VI can toggle the subVI on and off. LV 7 Student Edition doesn't have a command prompt (I couldn't find one) so I came up with something to show a numeric and a color box wired to the numeric.

 

As I explained before, the flashing status window is a problem. Now, I realize there's also and issue with selecting a new value in the string combo box on the main VI panel. You'll see what I mean if you start the status VI from the Toggle subVI button and then try to select a value in the combo box.

 

Regards,

 

 

Jeffrey Bledsoe
Electrical Engineer
Download All
0 Kudos
Message 10 of 22
(3,748 Views)