LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Caption.Text Property Bug?

Drop any control on the Front Panel. Change the label if you wish (but DO NOT show the caption).

Create a reference to that control on the diagram.

Connect that reference to a Property Node and select the Caption.Text property.

Connect an error cluster indicator to the error output (and a string indicator to the property output if you wish).

Run the VI (see example attached).

You should get this error:

 

Screen Shot 2015-03-03 at 15.27.43.png

 

Now, if you SHOW the caption only once (in Edit mode obviously), this error disappears, even though the caption doesn't need to be defined before it is shown (by default it is identical to the LABEL).

 

This, BTW, works equally well if you create a PN for the control directly. As long as you do not SHOW the caption, that PN will return the error above and you will not get a Caption.Text output.

Let's say I spent a lot of time nailing down the first problem and that, for me, warrants a bug flag. There is no warning whatsoever about this error in the Help file for "Text Property".

 

 

Tested in LabVIEW 2013 64 bits SP1

 

 

 

0 Kudos
Message 1 of 7
(4,337 Views)

See Ed's post from 2005 here.

Message 2 of 7
(4,325 Views)

Thanks for the pointer.

Whatever NI thinks (from hearsay in that thread), this behavior makes zero sense at all and at the very least there should be an explicit warning in the Help file.

0 Kudos
Message 3 of 7
(4,321 Views)

Yes, there should be.

 

I guess this behavior originated in the stone ages of LabVIEW, where memory was very expensive and highly limited.

 

FP objects should all have a default caption. This error should never occur.

The default caption should be an empty string, but if the caption is empty and we show it, it should get the text of the label so it behaves the same as today.

0 Kudos
Message 4 of 7
(4,314 Views)

I have run into this before as well.  My impression is that the caption does not really exist until the manual Show Caption process has occurred at least once.

 

I agree that this should be fixed or documented.

 

Would it make sense for one of these alternatives to the present behavior to be considered?

1. The Caption.Text property node is broken if the caption does not exist.  Or,

2. Placing the Caption.Text property node on the block diagram implicitly creates the default caption with text = Label.Text, which is the same as when the manual creation takes place. This would still leave the label visibility on the front panel unchanged and the caption not shown. Or,

3. Automatically create the caption when the control is created.  This adds a bit of overhaed (the caption text) but I cannot see any way it would break legacy code unless someone is using the 1320 error for something which would not be eliminated by this option.

 

Lynn

0 Kudos
Message 5 of 7
(4,309 Views)

johnsold wrote:

1. The Caption.Text property node is broken if the caption does not exist.


This does not handle the case where we use explicit control references. I already edited my reply above.

Message 6 of 7
(4,306 Views)

@altenbach wrote:

I guess this behavior originated in the stone ages of LabVIEW, where memory was very expensive and highly limited.


Nope. It actually worked fine up to LV 7.0. It was only in 7.1 that NI did this intentionally. I'm assuming they were right on a technical level (presumably the caption was kept as a full string and that is a lot of duplication when you consider that the vast majority of controls don't have a caption that's different from the label), but I expect it could have also been handled differently (e.g. have a bit that says whether the caption is the same as the label and don't save its text in that case) and this actually broke earlier code which acted on the caption whether it was there or not.


___________________
Try to take over the world!
0 Kudos
Message 7 of 7
(4,260 Views)