Jump to content


Photo
- - - - -

No update on X-control value change


  • Please log in to reply
10 replies to this topic

#1 Jon Kokott

Jon Kokott

    Very Active

  • Members
  • PipPipPip
  • 176 posts
  • Location:Milwaukee, WI
  • Version:LabVIEW 2010
  • Since:2006

Posted 18 April 2012 - 08:06 PM

I've got an X-control which I am updating very quickly, but I noticed that even though the data is being sent to the X-control indicator, the data never gets to the facade.vi

My x-control display then gets out of sync, i.e. if you read the data out (with a property node) immediately after writing it (by directly wiring the indicator), its wrong.
Am I doing something wrong or is this a real bug?

LV2011 No SP1
Certified LabVIEW Architect

#2 Aristos Queue

Aristos Queue

    LV R&D: I write C++/# so you don't have to.

  • Premium Member
  • 2,620 posts
  • Location:Austin, TX
  • Version:LabVIEW 2011
  • Since:2000

Posted 18 April 2012 - 09:51 PM

What you're seeing is the same behavior that all LV controls have. It is why some controls have "Synchronous Display" as an option. The synch display option forces LV to wait until the UI is updated for every write to the indicator. Normal operation will update the UI on a much slower schedule -- so you see big jumps when writing to a Numeric control inside a loop, for example.

If you update your XControl using the Value property instead of using the FPTerminal, I'm 90% certain that you'll get the synchronous display behavior.

#3 Jon Kokott

Jon Kokott

    Very Active

  • Members
  • PipPipPip
  • 176 posts
  • Location:Milwaukee, WI
  • Version:LabVIEW 2010
  • Since:2006

Posted 19 April 2012 - 04:20 PM

I see what my problem is, updating the control is an asynchronous notify() operation, vrs using a property node is a synchronous operation. The documentation supports this, for some reason (because typical event structure behavior) I thought that updating the control value would be more like an enqueue() operation.

I can see that there is a race condition if I modify the Xcontrol data during one of these notify() occurances. In fact, during rapid updates doing this is absolutely awful and results in out of date display very often.

I'll have to rethink how to do this as modifying data in the Xcontrol can't happen fast enough to be practical.
Certified LabVIEW Architect

#4 Jon Kokott

Jon Kokott

    Very Active

  • Members
  • PipPipPip
  • 176 posts
  • Location:Milwaukee, WI
  • Version:LabVIEW 2010
  • Since:2006

Posted 19 April 2012 - 05:20 PM

Arg,

Something is still not right about this.

I'm updating an Xcontrol by directly wiring the terminal with a string extremely quickly. I don't actually need the control to update that fast, but its possible that it will get hammered like that every once in a while. The problem is that once execution stops, if it was recently "flooded" with data, the control keeps updating like crazy (like a queue, not an notifier) even after the VI is stopped. Once it finally catches up, its not always the most recent data. It would be nice to know that the last data value displayed is in fact the most recent. Is there any work around for this?

Updating the value upon an execution change event does not work.
Certified LabVIEW Architect

#5 mike_nrao

mike_nrao

    More Active

  • Members
  • PipPip
  • 31 posts
  • Location:Flagstaff AZ
  • Version:LabVIEW 2011
  • Since:2002

Posted 19 April 2012 - 06:20 PM

*
POPULAR

Thanks to Ram Kudukoli (of NI R&D) for sharing this with us at the recent CLA Summit:
If Façade is not executing fast enough to keep up with data updates, it causes the updates to queue up. The updates will happen even after the VI stops running. To reduce data updates:
- Open the Xcontrol .xctl file in a text editor like Notepad.
- Add the bolded line shown below:
<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>
- Save the .xctl file.

#6 asbo

asbo

    I have no idea what you're talking about... so:

  • V I Engineering, Inc.
  • 1,273 posts
  • Version:LabVIEW 2011
  • Since:2008

Posted 19 April 2012 - 06:29 PM

Do you have any detailed information about what "optimizing data update"s actually does?

#7 Jon Kokott

Jon Kokott

    Very Active

  • Members
  • PipPipPip
  • 176 posts
  • Location:Milwaukee, WI
  • Version:LabVIEW 2010
  • Since:2006

Posted 19 April 2012 - 06:58 PM

Nice, that fixes the problem. So happy. Same question as asbo though.
Certified LabVIEW Architect

#8 Aristos Queue

Aristos Queue

    LV R&D: I write C++/# so you don't have to.

  • Premium Member
  • 2,620 posts
  • Location:Austin, TX
  • Version:LabVIEW 2011
  • Since:2000

Posted 20 April 2012 - 05:01 AM

Doh! Good call, mike_nrao. I completely forgot about Ram's trick.

#9 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 21 April 2012 - 08:13 AM

*
POPULAR

I added the info to the LabVIEW Wiki page on XControls

#10 Ravi Beniwal

Ravi Beniwal

    Very Active

  • Premium Member
  • 88 posts
  • Location:Detroit
  • Version:LabVIEW 2011
  • Since:2001

Posted 21 April 2012 - 05:47 PM

Here's a link to Ram's presentation and examples, where he shares a lot good stuff about XControls.

https://decibel.ni.c.../docs/DOC-21551

#11 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 22 April 2012 - 12:02 PM

Here's a link to Ram's presentation and examples, where he shares a lot good stuff about XControls.

https://decibel.ni.c.../docs/DOC-21551

Unfortunately that link isn't accessible by all (for instance ME).

Ton