12-06-2011 09:32 AM
I have an interesting situation in my current project. I have included a VI and a TypeDef in a zip file so others can look at it.
It's not stopping my project, but it does seem very strange to me.
I have a TypeDef that I copied a control into. So far, so good. I renamed the control (both the Label and the Caption). When I connect this TypeDef to a Bundle or Unbundle by name, the original name of the control still appears. How do I change this to show the correct name? I did not want to change this to being a simple boolean control as that causes coercion dots on the block diagram.
Here is a pic of what's happening:
Rob
12-06-2011 10:02 AM
You didn't include the typedef for the Boolean control that you are having the issue with.
12-06-2011 10:03 AM - edited 12-06-2011 10:04 AM
The typedef cluster contains another typedef or custom control that you did not include.
[Edit: Need to learn to type faster ]
12-06-2011 12:11 PM
Okay, okay. I did not include the typedef that was inside the typedef. Sorry.
On further testing (and moving things around), I found that even though the boolean typedef had been renamed, I had to take the original typedef and replace the boolean with the renamed one (the file name had not been changed - only the label and caption).
After replacing the typedef within the typedef with the same one, it works as advertised. I thought the idea of using a typedef was that you did not have to replace it everywhere that it is used.
I have the same problem with a graph on the front panel that I saved as a typedef - when I change the typedef, I have to replace every instance of the graph (there are 9 of them) with the new one - even though I opened it by right clicking on the graph and selecting Open Type Def.
Is this a bug? Or do I make sure the idea exchange has the idea to update controls when the typedef changes? Which I will do.
Rob
p.s. I included the missing typedef here anyway. Go ahead and rename it and see if the top level changes. I think a typedef within a typedef is the problem.
12-06-2011 12:29 PM - edited 12-06-2011 12:36 PM
Do you have the typedef setup as a control? Use typedef or strict typedef if you want the changes to take affect. Keep in mind that not all properties will carry over with typedefs, strict or otherwise but most will. It depends on what type of control you are using.
Edit: Sorry, a little quick with the typing. I did not notice your attached control.
12-06-2011 12:33 PM
No, what you are seeing is expected behavior. When using a typedef you are able to change cosmetic aspects of the control. While one could argue thta the name should not be modifiable I believe it is considered to be a cosmetic element. The data type and order are more important in keeping things aligned. The same principle appies if you modify the default value of a typedef constant. If you change the default value in the typedef itself this change is not reflected where it is used. Strict typedefs do restrict what elements can be changed when it is used.
12-06-2011 01:03 PM
Mark, thank you. I do now about cosmetic changes not carrying, I had thought the name of the control would not be "cosmetic".
My problem with the typedef graphs is that I could change everything - size, number of axes, names, etc. It never did make a difference to the graph on screen.
I will do some testing with strict typedefs to see what difference it makes.
It is interesting as well, that while a typedef is open (after having made changes to it), the VI that uses the typedef is broken. When clicking on the run arrow, the error indication is that there are unapplied changes in the typedef (even if it has been saved). Closing the typedef makes the VI runnable again (implying that changes were applied). Even though changes will not show unless re-loaded.
Maybe I'm just griping after a hard day of coding. I still prefer working in LabVIEW than text based languages (even though I have some Java work to do as well).
Rob