LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to create multithreading problems when opening file dialog

Warning: Newbie to Labview...

I have a problem in a rather complicated VI where bringing up the open file dialog halts some background operations.

I would really like to reproduce this behaviour for various reasons, but am unable to. I've created a simple VI with a for-loop where the index feeds a sine converter which in turn feeds a tank indicator. This produces an oscillating behaviour. To this VI I've added a file dialog control.

Regardless of the multithreading setup, I'm unable to get the oscillating of the tank indicator to stop when the dialog is open. Is there something I can do to get this behaviour? I realize it's unusual to try to break things, but it is rather important for me.

Tha
nk you,
Nigel
0 Kudos
Message 1 of 5
(2,931 Views)
Hi,

The for loop (all loops by the way) is halted until everything in it is
finished.

Try this:

+ Make a while loop
+ wire TRUE to the stop criterium.
+ Put an indicator on the 'I'.
+ Put a MS Wait in it (e.g. 80 ms), to prevent 100% processor time.

Run it, and the indicator will increase fast.

Now put any dialog in the while loop. E.g. a message box.

The indicator will increase everytime you press 'OK'.

Note: stop by pressing CTRL+. and clicking 'OK' several times.

Regards,

Wiebe.


"N Cook" wrote in message
news:5065000000080000001E6C0000-1031838699000@exchange.ni.com...
> Warning: Newbie to Labview...
>
> I have a problem in a rather complicated VI where bringing up the open
> file dialog halts some background operations.
>
> I would real
ly like to reproduce this behaviour for various reasons,
> but am unable to. I've created a simple VI with a for-loop where the
> index feeds a sine converter which in turn feeds a tank indicator.
> This produces an oscillating behaviour. To this VI I've added a file
> dialog control.
>
> Regardless of the multithreading setup, I'm unable to get the
> oscillating of the tank indicator to stop when the dialog is open. Is
> there something I can do to get this behaviour? I realize it's unusual
> to try to break things, but it is rather important for me.
>
> Thank you,
> Nigel
0 Kudos
Message 2 of 5
(2,931 Views)
Thanks for your comments Wiebe. I've done what you suggested, but still the indicator continues to increase regardless of any dialog being open. Is there a way to get the indicator from stopping until the dialog is closed?

Thanks,
Nigel
0 Kudos
Message 3 of 5
(2,931 Views)
Nigel,

Try this example. This is what he was talking about.

A loop iteration will not complete until every thing in that iteration is complete. In this case, the dialog does not complete until you press the OK button.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 4 of 5
(2,931 Views)
Hi,

Are you sure you've put the message box in the while loop? It has to popup
several times, not just once.

Regards,

Wiebe.


"N Cook" wrote in message
news:50650000000500000077BE0000-1031838699000@exchange.ni.com...
> Thanks for your comments Wiebe. I've done what you suggested, but
> still the indicator continues to increase regardless of any dialog
> being open. Is there a way to get the indicator from stopping until
> the dialog is closed?
>
> Thanks,
> Nigel
0 Kudos
Message 5 of 5
(2,931 Views)