Sparkette Posted April 4, 2009 Report Share Posted April 4, 2009 If you have ever played around with the matrix data type, you may have noticed that it is actually a 2D array in typedef form. But if you disconnect it from the typedef, the wire appearance ("[][][][][][][][][][][]") goes away and is instead replaced by the standard "===============" wire appearance. It is obvious that the custom wire appearance is stored in the typedef. But my question is how can I change the wire appearance for my own typedefs? I know how to do it for classes, but those are different. Does anybody know how to do it in typedefs? Quote Link to comment
Mark Yedinak Posted April 4, 2009 Report Share Posted April 4, 2009 As far as I know you can't change the appearance of the wire type for anything other than a class. Quote Link to comment
Sparkette Posted April 4, 2009 Author Report Share Posted April 4, 2009 QUOTE (Mark Yedinak @ Apr 3 2009, 04:38 PM) As far as I know you can't change the appearance of the wire type for anything other than a class. Well then how did NI do it with the matrix typedef? Quote Link to comment
Mark Yedinak Posted April 4, 2009 Report Share Posted April 4, 2009 QUOTE (flarn2006 @ Apr 3 2009, 03:42 PM) Well then how did NI do it with the matrix typedef? The difference here is that NI is changing the data type, not you the user. They have knowledge about the type of data and at this point they do not expose that level of customization to the user. Quote Link to comment
Sparkette Posted April 4, 2009 Author Report Share Posted April 4, 2009 QUOTE (Mark Yedinak @ Apr 3 2009, 04:49 PM) The difference here is that NI is changing the data type, not you the user. They have knowledge about the type of data and at this point they do not expose that level of customization to the user. What reason would they have for keeping it private? Can anybody from NI maybe post here and say? Quote Link to comment
Mark Yedinak Posted April 4, 2009 Report Share Posted April 4, 2009 QUOTE (flarn2006 @ Apr 3 2009, 04:07 PM) What reason would they have for keeping it private? Can anybody from NI maybe post here and say? My guess is that this feature was not added until classes were added to LabVIEW. Depending on how their internal code was it probably wasn't an easy task to add this capability to other things such as typedefs and clusters. Also, I don't think they would want to allow the user to change the wire type for primitive data types since this would be too confusing. It is good to know that a thin blue wire is an integer and a thin pink wire is a string. If they allowed customization for all data types someone could really confuse the readers of their code by changing the wire types for the primitive data types. Quote Link to comment
jdunham Posted April 5, 2009 Report Share Posted April 5, 2009 People have been asking to change the wire appearance since before you were born. If you are using a built-in type which is not a cluster, then it would just obfuscate your code to change the wire appearance. If you are using clusters and want a custom wire, why not just make it an lvclass? (well because it's harder to see your values on subvi panels, but I hopefully NI is working on that). Quote Link to comment
Aristos Queue Posted April 5, 2009 Report Share Posted April 5, 2009 A) No, the wire pattern is not stored with the typedef. B) It is hardcoded into LV that if a typedef has a particular name "Matrix.ctl" then draw an alternate pattern for the wire. I'm pretty sure you can do it by naming any typedef "Matrix.ctl" C) There is no feature in LV for establishing a custom wire pattern for control VIs, so don't bother hunting for it. If you want custom wire patterns, LV classes are your answer. Quote Link to comment
shoneill Posted April 5, 2009 Report Share Posted April 5, 2009 QUOTE (Aristos Queue @ Apr 4 2009, 12:46 AM) A) No, the wire pattern is not stored with the typedef. B) It is hardcoded into LV that if a typedef has a particular name "Matrix.ctl" then draw an alternate pattern for the wire. I'm pretty sure you can do it by naming any typedef "Matrix.ctl" C) There is no feature in LV for establishing a custom wire pattern for control VIs, so don't bother hunting for it. If you want custom wire patterns, LV classes are your answer. That's cool, any other hard-wired Typedef names out there? Shane. Quote Link to comment
Aristos Queue Posted April 5, 2009 Report Share Posted April 5, 2009 QUOTE (shoneill @ Apr 4 2009, 01:32 PM) That's cool, any other hard-wired Typedef names out there? To the best of my knowledge, no. Quote Link to comment
Val Brown Posted April 5, 2009 Report Share Posted April 5, 2009 QUOTE (flarn2006 @ Apr 3 2009, 02:07 PM) What reason would they have for keeping it private? Can anybody from NI maybe post here and say? Isn't this kind of like your other hacking question? What is motivating you to try so many hacks of LV? Quote Link to comment
Sparkette Posted April 5, 2009 Author Report Share Posted April 5, 2009 QUOTE (Val Brown @ Apr 4 2009, 04:15 PM) Isn't this kind of like your other hacking question? What is motivating you to try so many hacks of LV? I just believe that software should never have features not revealed to the end users, with the prominent exception of easter eggs. If a file format has a certain feature, the program should allow anyone to use it, not just the developers. Quote Link to comment
ragglefrock Posted April 5, 2009 Report Share Posted April 5, 2009 QUOTE (shoneill @ Apr 4 2009, 01:32 PM) That's cool, any other hard-wired Typedef names out there?Shane. This obviously isn't a typedef, but the error cluster has similar rules. As of 8.2 or so it has a different color. Labview is also pretty lax in how it determines if something is an error type. We once had a typedef cluster that was a path, a Boolean, and a double. Labview still interpreted it as an error wire. Quote Link to comment
Aristos Queue Posted April 5, 2009 Report Share Posted April 5, 2009 QUOTE (flarn2006 @ Apr 4 2009, 03:56 PM) I just believe that software should never have features not revealed to the end users, with the prominent exception of easter eggs. If a file format has a certain feature, the program should allow anyone to use it, not just the developers. Ok... this should be fun. I'm going to spawn a new thread to respond to this challenge so that this thread can return to a discussion of typedefs, if there's anything further to discuss.The new thread is here: http://forums.lavag.org/Secret-features-et...hem-t13742.html 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.