11-01-2012 10:38 AM
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
11-01-2012 10:50 AM - edited 11-01-2012 11:21 AM
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).
11-01-2012 11:07 AM
@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
11-05-2012 05:55 AM
Here's a simple example of what I want to do:
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.
11-05-2012 10:40 AM
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).
11-05-2012 12:32 PM
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.