yuxie Posted October 4, 2007 Report Share Posted October 4, 2007 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. Quote Link to comment
Grampa_of_Oliva_n_Eden Posted October 4, 2007 Report Share Posted October 4, 2007 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. Ben Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.