Jump to content

Typedef wire appearance


Recommended Posts

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?

Link to comment

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.

Link to comment

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?

Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment

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.

Link to comment

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.

Link to comment

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.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.