Jump to content

a bug of Control Name fixed in LabVIEW 8.5


yuxie

Recommended Posts

See the attached VI.

When using the Get Control Value [Variant] methods or other similar methods, we have to assign the control name. Intuitively, the control name is identical to the label text. In version 8.5 it is. However, in LV 7.1, it is not always the same, even though 99% it is. This is not an obvious bug in LV 7.1. The problem is, if there is white space(s) at the beginning/end of the label text, we have to trim the white space(s). If you use "Set Control Value [Variant]" method you can see it returns the control name without white space if there is any. But the spaces within a label text are OK. For example, if the text label is " 12 3 ". The control name is going to be "12 3". This is an annoying bug since white space is very hard to identify especially when the background is transparent.

Consequently, unlike the "label text" property node which could be an empty string, you have to have a nonempty label for the control you want to access. In addition, if you want to use "Get All Control Values" method, none of the controls can have empty label, otherwise LabVIEW will return an error.

This issue is fixed in 8.5 (may be in 8.0, too. But I did not check). "Get All Control Values" method won't return an error even though a control has an empty label. However, such a correction causes a problem. You have to decide to or not to trim white spaces based on the version information.

Link to comment

QUOTE(yuxie @ Oct 3 2007, 05:34 PM)

See the attached VI.

When using the Get Control Value [Variant] methods or other similar methods, we have to assign the control name. Intuitively, the control name is identical to the label text. In version 8.5 it is. However, in LV 7.1, it is not always the same, even though 99% it is. This is not an obvious bug in LV 7.1. The problem is, if there is white space(s) at the beginning/end of the label text, we have to trim the white space(s). If you use "Set Control Value [Variant]" method you can see it returns the control name without white space if there is any. But the spaces within a label text are OK. For example, if the text label is " 12 3 ". The control name is going to be "12 3". This is an annoying bug since white space is very hard to identify especially when the background is transparent.

Consequently, unlike the "label text" property node which could be an empty string, you have to have a nonempty label for the control you want to access. In addition, if you want to use "Get All Control Values" method, none of the controls can have empty label, otherwise LabVIEW will return an error.

This issue is fixed in 8.5 (may be in 8.0, too. But I did not check). "Get All Control Values" method won't return an error even though a control has an empty label. However, such a correction causes a problem. You have to decide to or not to trim white spaces based on the version information.

Good info thanks!

The leading white space breaking a function is weird. :throwpc:

Ben

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
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.