LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XControl Update Issue

Solved!
Go to solution

This morning I ran into an unexpected (for me) limitation of XControls.  If you send data too rapidly to the ControlTerminal of an instance of an XControl, some of it (sometimes most of it) won't get sent.  Apparently if you send data to an XControl while it's still processing the previous data, the new data will be discarded.  I did find a workaround though: If you write to the Value property of the XControl, data will always be passed (I suspect that this is because a property node can wait, but a ControlTerminal can't).  Attached is a Progress Bar XControl; it's supposed to advance the bar every time something is written to it (but it doesn't work correctly of you send data too fast).  My kludgy solution is to have it put up an annoying warning if you run a VI with Progress Bar's ControlTerminal wired to anything.  I would appreciate it if anyone could think of a cleaner solution.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 8
(3,394 Views)

I've run into this with an xcontrol bound to a quickly updating network shared variable. The VI would slow down to a crawl, and eventually need to be killed.

 

A workaround I found is to add a secret property to the xctl file (with a text editor) to "optimize" data updates:

<Property Name="NI.Lib.Version" Type="Str">1.0.0.0</Property>
<Property Name="NI.XClass.Flags" Type="Int">0</Property>
<Property Name="NI.XCtl.OptimizeDataUpdate" Type="Bool">true</Property>
<Property Name="NI.XItem.DeclaredLeakProof" Type="Bool">false</Property>

Taken from here.

 

Edit: Actually it sounds like the issue you're seeing is the opposite of what I ran into (too many updates). Maybe setting the above property false will work? Which version of LabVIEW are you using?




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
Message 2 of 8
(3,338 Views)

I'm using LV 2017.

Can you tell me about more secret properties?

 

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 8
(3,313 Views)
Solution
Accepted by topic author paul_cardinale

I found the correct solution.  In the Init.vi ability, just set the Synchronous Display property to true.

ix.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 8
(3,308 Views)

Wait, what?

 

Seriously, this works?  Do you also have some special INI settings or is a plain old "In the Init.vi ability, just set the Synchronous Display property to true." enough to rid the world of this annoyance?

 

I've struggled with this on numerous occasions, that's the first time I've encountered that tip (or more accurately since I'm getting older, I don't recall ever encountering that tip before Smiley Tongue).

0 Kudos
Message 5 of 8
(3,294 Views)

It does work.  The "annoyance", and the solution, are actually well documented standard behaviors (but I hadn't remembered it and I had to do some digging to find it).

 

See: https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/properties-and-methods/vi-server/generic/g...

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 8
(3,289 Views)

Well, yes, I'm aware of the "Synchronous display" option for controls and indicators.  But typically one can right-click on an instance and choose whether it is synchronous or not (usually under "Advanced".  This option (AFAIK) does not exist for XControls, hence needing to set it programatically.

 

I have had several discussions with NI and nobody ever mentioned the ability to set an XControl to synchronous in the Init VI.  I've even started an Idea Exchange idea on the topic.  I tried out all kinds of experimental INI settings (at the behest of NI) all to more or less no avail.

 

And to think the solution is so darned easy.

0 Kudos
Message 7 of 8
(3,285 Views)

@Intaris wrote:

Well, yes, I'm aware of the "Synchronous display" option for controls and indicators.  But typically one can right-click on an instance and choose whether it is synchronous or not (usually under "Advanced".  This option (AFAIK) does not exist for XControls, hence needing to set it programatically.

 

I have had several discussions with NI and nobody ever mentioned the ability to set an XControl to synchronous in the Init VI.  I've even started an Idea Exchange idea on the topic.  I tried out all kinds of experimental INI settings (at the behest of NI) all to more or less no avail.

 

And to think the solution is so darned easy.


Synchonous Display is available for all controls; including XControls.

It's available both in the context menu and in property nodes.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 8
(3,269 Views)