LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Xcontrol not keeping up the pace

Solved!
Go to solution

Hi,

 

I'm trying to use a Xcontrol to make a graph indicator with a few more features than the basic graph in Labview (like automatic update of the X and Y scale label, desactivation of auto scaling when the users zooms on the graph... that sort of things)

 

The problem i'm facing right now is that, if I send data very fast to the Xcontrol, it will bufferize all this "data change" event and process them quite slowly. I end up with a Xcontrol that is still running altough the hosting vi is stopped! In this particular case, my graph is still updating altough the hosting vi is stopped.

 

How can I avoid this behavior?

 

I'm new to Xcontrol so maybe I'm making some rookie mistakes! Here is the code of my facade vi:

LV Xcontrol.png

 I basically have a small subvi that takes care of all the data manipulation, the event structure just send "actions" to this vi.

 

Would it be a good idea to use some kind of producer/consumer structure, with a one-element lossy queue, within the facade vi?

 

In general, where can i find ressources and good tutorials about Xcontrols?

 

Thanks in advance,

 

peper 

0 Kudos
Message 1 of 6
(2,630 Views)
Solution
Accepted by topic author peper2001

I've had exactly this problem in the past.  It's known and it's not really due to be fixed any time soon.

 

You can relieve the pain a bit by editing the XControl xml file directly and adding the line

 

<Property Name="NI.XCtl.OptimizeDataUpdate" Type="Bool">true</Property>

 

Courtesy of a post HERE.

 

While this doesn't fix the root problem, it will alleviate much of the headache aqssociated with it.

 

Please go HERE and vote for my idea to fix this behaviour once and for all.  Apparently NI Graphs behave the same but the problem is with XControls that the individual loop times can get VERY slow depending on what's being done.

 

Shane.

Message 2 of 6
(2,609 Views)

As a work-around you can implement methods for the XControl, they execute synchronously.  That is, control returns to the calling VI ONLY when the XControl is actually finished executing the method.

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

Hey,

 

Thanks for your answer,

 

Silly question: where can I find the xml file of the Xcontrol you're refering to?

 

Best regards,

 

peper

0 Kudos
Message 4 of 6
(2,593 Views)

It's actually called something.xctl.

 

It's wherever you have saved your XControl.

 

Shane.

0 Kudos
Message 5 of 6
(2,584 Views)

Ok i've made the modification and indeed, it has improved things somewhat.

 

Thanks for your help!

 

peper

0 Kudos
Message 6 of 6
(2,579 Views)