BrokenArrow Posted October 28, 2007 Report Share Posted October 28, 2007 Schematic capture programs have had wire labels for decades. Seems like an obvious thing for LV. I'd prefer color-coded like my example here. I have a VI full of these color-coded labels, and I use it to plop down labels, but this should be an easy thing to implement with a Right-Click, Show Wire Name. I've found these labels particularly useful in state machines when the data is "just passin' through", or of course on long wires. Richard Quote Link to comment
Ton Plomp Posted October 28, 2007 Report Share Posted October 28, 2007 QUOTE(BrokenArrow @ Oct 27 2007, 07:11 PM) Schematic capture programs have had wire labels for decades. Seems like an obvious thing for LV. I'd prefer color-coded like my example here. I have a VI full of these color-coded labels, and I use it to plop down labels, but this should be an easy thing to implement with a Right-Click, Show Wire Name.I've found these labels particularly useful in state machines when the data is "just passin' through", or of course on long wires. Richard Not to nag you, but you know you can create a description for a wire, and see that in the Help window? But your idea sounds good, and it shouldn't be too hard to code it. Ton Quote Link to comment
Yair Posted October 28, 2007 Report Share Posted October 28, 2007 A few additional relevant options for the present: Use a cluster for your state machine SR. This allows you to pass multiple values on a single wire and makes it easier if you need to add new states. Handling the value is simply a matter of unbundling and bundling by name. Use the label available in the system controls palette. Drop one on your FP and then drag it to the BD. It has the advantage of having its background adapt to whatever is under it, so you can place it on the wire itself and it looks nice. Create some merge VIs with the relevant labels. This will probably speed up your process somewhat. Quote Link to comment
BrokenArrow Posted October 28, 2007 Author Report Share Posted October 28, 2007 QUOTE(tcplomp @ Oct 27 2007, 01:19 PM) Not to nag you, but you know you can create a description for a wire, and see that in the Help window?......Ton Right Ton, but it ain't the same. One, because you have to "hover over" the wire to see it. Plus, it doesn't have the intelligence to know that the entire wire node is the same name. For example, you can name pieces of the same wire (i.e data) different things, within different cases/sequences/loops. For that one reason, I've found that "describing" a wire is next to useless. My habit of using free labels is also problematic, because the labels aren't attached to the wires, and can get moved or lost. I spent most of the 90's doing schematic capture and PCB design, and got used to having wire labels (net labels) showing wherever I wanted them. Net Ports were also nice, but in LV, those are Local Variables RichardQUOTE(Yen @ Oct 27 2007, 02:20 PM) A few additional relevant options for the present: Use a cluster for your state machine SR. This allows you to pass multiple values on a single wire and makes it easier if you need to add new states. Handling the value is simply a matter of unbundling and bundling by name. Use the label available in the system controls palette. Drop one on your FP and then drag it to the BD. It has the advantage of having its background adapt to whatever is under it, so you can place it on the wire itself and it looks nice. Create some merge VIs with the relevant labels. This will probably speed up your process somewhat. 1. I beleive that if you have flat data, it should stay flat. 2. Neat, but as I said in my last entry, this type of label could "get lost" couldn't it? I'll try it. 3. Good idea. I've actually left my "WireLabels.vi", where I go to copy and paste labels, in the digram by accident! Richard p.s. Yen, I never knew the System Controls label was transparent by default -- that saves a step when you want a transparent label. Cool, thanks! :thumbup: Quote Link to comment
Yair Posted October 28, 2007 Report Share Posted October 28, 2007 QUOTE(BrokenArrow @ Oct 27 2007, 08:29 PM) 1. I beleive that if you have flat data, it should stay flat. Why? The cluster is simply the state machine data cluster. It holds all the data the SM needs to do its work. I consider that concept to be very simple and elegant and it has the added advantages of making your work easier, your code much cleaner and of satisfying your requirement. If you don't use the cluster in subVIs, you don't even have to make it a typedef. QUOTE 2. Neat, but as I said in my last entry, this type of label could "get lost" couldn't it? Yes, it could. Quote Link to comment
BrokenArrow Posted October 28, 2007 Author Report Share Posted October 28, 2007 QUOTE(Yen @ Oct 27 2007, 02:36 PM) Why? The cluster is simply the state machine data cluster. It holds all the data the SM needs to do its work. I consider that concept to be very simple and elegant and it has the added advantages of making your work easier, your code much cleaner and of satisfying your requirement. If you don't use the cluster in subVIs, you don't even have to make it a typedef.Yes, it could. Yen, Regarding the cluster vs. flat data, it's a bias on my part, having been told 6 or 7 years ago in some LabVIEW book somewhere to "keep data as flat as possible". Putting the data in a cluster has the advantage of just one wire "passin' through", which is an obvious advantage. When you unbundle it, there's your label. I probably should rethink some of my biases. But I still want me wire lables! Quote Link to comment
Ton Plomp Posted October 28, 2007 Report Share Posted October 28, 2007 Here's the long run: Create a Tool VI that: finds the center of the current selected wire, get the datatype, drop a system label with the correct make-up. Ton Warning it's already saturday night here Quote Link to comment
Yair Posted October 28, 2007 Report Share Posted October 28, 2007 QUOTE(BrokenArrow @ Oct 27 2007, 08:46 PM) But I still want me wire lables! I definitely agree. QUOTE(tcplomp @ Oct 27 2007, 08:54 PM) Create a Tool VI that: finds the center of the current selected wire, get the datatype, drop a system label with the correct make-up. I don't know how practical that would be on a per-wire basis (invoking it might be too time consuming), but we could probably do it for all wires if we add a tag to each wire describing its name. Of course, that has a host of other issues. Quote Link to comment
BrokenArrow Posted October 28, 2007 Author Report Share Posted October 28, 2007 QUOTE(tcplomp @ Oct 27 2007, 02:54 PM) Warning it's already saturday night here Saturday afternoon here, another exciting weekend in Parenthood. Yen, I have noticed that Merge VI is now called Place VI Contents. I posted that on the NI nugget. Richard 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.