ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XControl without timeout

Hello!

 

I need to design an xcontrol that is NOT inside a loop. But the xcontrol is dependent on values from other controls outside of it. So when I run my instrument, the xcontrol event structure will immediately time out and the control will stop running, and no values will be read. Now I'm wondering:

 

What are the consequences for using an xcontrol without time out event? Is there some smart work-around for having it not time out in that particular case?

 

 

Regards

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 1 of 6
(3,709 Views)

The X-control itself needs a timeout case as documented in the diagram comments when you desinge the facade VI.

 

In the calling program, the x-control can be anywhere, but all rules of dataflow obviously apply.

 

Overall, your question (as written) makes very little sense. Can you attach a simple example that shows what you are trying to do?

What is the function of the x-control?

How exactly does it depend on other controls? (value, properties)

 

An x-control is always ready to run, even if the calling VI is in edit mode (dumb example).

0 Kudos
Message 2 of 6
(3,704 Views)

@O.P. wrote:

Hello!

 

I need to design an xcontrol that is NOT inside a loop. But the xcontrol is dependent on values from other controls outside of it. So when I run my instrument, the xcontrol event structure will immediately time out and the control will stop running, and no values will be read. Now I'm wondering:

 

What are the consequences for using an xcontrol without time out event? Is there some smart work-around for having it not time out in that particular case?

 

 

Regards


 

If I  remeber correctly, the Xcontrol will hang if there is no timeout.

 

I think I read Ton suggesting using the Init of the XControl to create a background thread that does your looping for you.

 

Add custom properties to define those "other controls" the background thread will monitor.

 

That is all of the suggestions I can offer.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 6
(3,697 Views)

Here's a simple example of what I want to do:

 

xcontrol.png

 

The vi to the left takes some input that's packaged in a class and sent to my xcontrol. But when the "Data Change" event triggers, the "Data in" input is empty.

 

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 4 of 6
(3,661 Views)

An update:

 

The value I send to the xcontrol contains two class objects, each containing a notifier and a queue, and an integer. If I put a breakpoint inside the xcontrol I can see that the integer contrains a value, but notifiers and queues have invalid refnums, as if they weren't initialized (they should be).

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 5 of 6
(3,649 Views)

I tried setting up a test case, but something strange happened. I tried setting up a control that displays a string, but it never receives the string because it doesn't seem to enter run mode.

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 6 of 6
(3,643 Views)