Jump to content

Tab Control Bug


MikaelH

Recommended Posts

Hi

I guess many of you have encountered this issue with the tab control.

Is this a bug or something everybody knows about and always just manage to live with it.

The problem is that the Tab Control don’t always changes Tab when you programmatically changes is using a local variable, if you at the same time updates a control or indicator using the property node which is located on any of the tabs.

Why??

(LV 8.6)

//Mikael

TabTest.vi

Link to comment

I guess many of you have encountered this issue with the tab control.

Is this a bug or something everybody knows about and always just manage to live with it.

The problem is that the Tab Control don’t always changes Tab when you programmatically changes is using a local variable, if you at the same time updates a control or indicator using the property node which is located on any of the tabs.

Why??

(LV 8.6)

//Mikael

I think this is a bug that maybe nobody's been reporting? I've seen it for a while so I'm in that group (and it still exists in LV2009 as far as I have seen). My workaround -- you can use the Value.Signaling property and it seems to always update correctly. Just be sure that the Tab Value Changed event is not going to impact you negatively if you use this property.

Link to comment

I better report it so we might get it fixed until next NI-week :-)

I've always got my code working with some workarounds.

One way is to use the Property Node of the Tab Control when changing the value.

Sometimes I use a SubVI to change the Tab like this:

post-941-125383273245_thumb.png

This also saves some Block Diagram Space.

But then I have to make sure the Tab is a Type Def and that can create some other issues.

Cheers,

Mikael

Link to comment

Hi

Have you test to put your tab update outside the event structure like this:

post-5178-12538670358_thumb.jpg

That is likely to work but has probably not the intended effect since the tab is now changed all the time independent of the event that occurred (or you have to make sure to wire out the correct (current) tab control value in all other event cases, for a real application!).

Using a value property for the tab control (or preferably a local for the string) seems a more logical solution here and since that executes in the UI thread it involves a context switch and is sure to avoid the optimization race condition that seems to be in place here otherwise.

Rolf Kalbermatter

Link to comment

post-14628-125392538816_thumb.png

Dear all, I change the Tab Control local variable with property node: Value, and it works.

And I seldom use local variable except for Path or boolean value.

PS: If we want the numeric value change event occures, we usually use the value(signal) property instead of value.

Thanks.

Tom.

Edited by huotom
Link to comment

post-14628-125392538816_thumb.png

Dear all, I change the Tab Control local variable with property node: Value, and it works.

And I seldom use local variable except for Path or boolean value.

PS: If we want the numeric value change event occures, we usually use the value(signal) property instead of value.

Thanks.

Tom.

I would actually rather have changed the string value property to a local variable instead.

It is a noble attempt to avoid locals as much as possible, but using the value property instead is in fact fighting the devil with the beelzebub.

Rolf Kalbermatter

Link to comment

I like the property node since they have Error in/Out that makes the me in control of the flow.

But the property nodes are slow.

post-941-125410476666_thumb.png

This code takes around 8 ms, but if you change it to the property node it takes 10 seconds.

That is because the control works in Synchronous mode.

You get the same time if you set the control to "Synchronous Display" but still uses a local variable.

So my conclusion is to always use the Property Node when updating a Tab control.

Cheers,

Mikael

Link to comment

I like the property node since they have Error in/Out that makes the me in control of the flow.

But the property nodes are slow.

post-941-125410476666_thumb.png

This code takes around 8 ms, but if you change it to the property node it takes 10 seconds.

That is because the control works in Synchronous mode.

You get the same time if you set the control to "Synchronous Display" but still uses a local variable.

So my conclusion is to always use the Property Node when updating a Tab control.

Somehow I can't follow you. First you say that the property node is terribly slow, although the reasoning for that is only partly right. Yes it operates in synchronous mode so it will force an update of the control on each iteration before going to the next iteration, but there is also additional overhead because the property node (any VI server property node at that not just the value one) has to run in the UI thread so there are also always two context switches involved.

And then you say one should always use the property Node for a tab control. I always use a local for that and had not any problems so far. I think we had established that the problem here was the "parallel" execution of the string property node (and only for an element contained on the tab control) when updating the tab control through a local variable. So replacing the string property node with a local variable seems to me the better solution.

Rolf Kalbermatter

Link to comment

So replacing the string property node with a local variable seems to me the better solution.

Sure it's one solution, but assume that I use the local variable for the Tab Control and use a local variable for the string.

And then suddenly we need to update this code to also gray out the string control, so I change it to a property node to disable the control and at the same time I use the same property node to update the value of the string control.

But of cause I now know about this problem so I have to change the updating of the tab to a property node.

But I have 5 LV developers in my team and I can't do all updates myself so maybe the developer I assign this task to might not remember this.

Cheers,

Mikael

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.