03-21-2025 05:23 AM
Hi!
I am currently developing a program in LabVIEW, but I am having some trouble with my channel wires. It seems that they are reading and writing incorrectly, even though I believe I have connected them properly. The names they read appear to be linked to another channel wire (see Pictures 3 & 4).
I have tried deleting the contents of the ChannelInstances folder, but the issue persists. We are only allowed to use tag-endpoints, but it only works with a stream-endpoint (see Pictures 1 & 2).
I would really appreciate any help!
I have attached some screenshots of the block diagram in this thread. Let me know if you need more information.
Picture 1
Picture 2
Solved! Go to Solution.
03-21-2025 09:41 AM
It is very hard to debug truncated pictures. Please attach the vi and use save-for-previous version... I suggest at least 2020.
03-21-2025 11:38 AM
Hi!
This is the VI
03-21-2025 09:13 PM
Thank you for attaching (part of) your code.
How are you developing your code? Are you using a LabVIEW Project, meaning a collection of VIs, TypeDefs, and a LabVIEW Project File (.lvproj) to organize your code?
Do an experiment for me. Close LabVIEW, then start it, and open only IV13 Layout.vi. Can you understand how frustrating it must be for those of us who want to help you? First of all, there are very many "blank" rectangles on the Block Diagram generating errors that we can't see, or even guess what they might be doing. We also can see less than 10% of the ENORMOUS Block Diagram, which appears to require 10 laptop screen arranged in a 2 x 5 array (two screens wide and 5 screens tall) in order to see most of the code. Completely unreadable.
You appear to be using some additional software, possibly from Digilent, that may also explain the many empty rectangles on the Block Diagram. I did download and tried to install some Digilent software, but have no idea what you are using. It would be helpful if you provided more information on your setup.
I was going to try to help you with Asynchronous Channel Wires, which I have been using in every LabVIEW Project I've been involved with since before they were released in LabVIEW 2016 (they were a "hidden feature" of LabVIEW 2015). But you've got to learn how to write LabVIEW code that fits on a laptop screen.
Can you write a one-screen VI (or several VIs working together) that illustrates what you are trying to convey with Tag Channel Wires? Your question was about Tag channels. I don't know what you are trying to accomplish with Channel Wires, but in my experience with Channel Wires, the one I use the most is the Messenger Channel, next most is the Stream Channel, and I occasionally use the Tag Channel. So I'm disappointed in not having a "viewable" view of the code to see where your Tag Channels are located, let alone understand how you are using them.
Please help us to help you.
Bob Schor
03-22-2025 03:20 AM
Thank you for trying to help me!
I apologize for attaching a code that does not work. I am not yet confident in LabVIEW, and the VI is part of a big project with Digilent for one of my university courses, so I should have known that it would be unreadable. I asked my professor what to do, but they did not know what was wrong, so they asked me to post in this forum.
My problem with the wires occurs when I bundle two numeric (DBL) values by name and then use a channel wire to transfer the values. It seems that the wire writes and reads a different name when I use the "Unbundle by Name" feature. The names it writes and reads are not even part of the project.
I have attached a VI (that I hope works) to illustrate what happens when I use different types of wires. It works with the Messenger Channel Wire, but my professor prefers that we only use Tag Channel Wires.
Once again, I apologize for the non-working code and for not being very skilled in LabVIEW. Thank you for the reply
03-22-2025 01:02 PM
I think I am beginning to understand the problem you are having (though it doesn't help me find the problem with your "huge" code). You are largely missing the concept and idea behind the name "Asynchronous Channel Wire". When we call them "Channel Wires", we ignore the most important aspect, that they are (to the best ability we have in implement them) "asynchronous", meaning "not locked to time".
A Tag Channel acts like a Global Variable, and has all the advantages and drawbacks that come with using Global Variables, but with the addition of the "Asynchronous Wire" to show you when/where the "value" is set by writing to a Tag Channel (or writing to a Global), and where the "value" is read by reading from a Tag Channel (or reading a Global). If you've got a Block Diagram that is 5000 pixels high and 5000 pixels wide (as yours is), Globals can be difficult to find, and if you have several of them, telling them apart requires looking at the rather small representation and reading the name associated with it. With a Tag channel, however, you can follow the Channel Wire to see where the Writers and Readers are, and can say "If I put 12345 in this Writer, it will instantly appear in all these Readers".
But there's a problem -- because the Tag Writer (or the code to write something into a Global) may be in a Structure (such as a While Loop or Event Loop) that executes after the Tag-or-Global Reader? Do you see the problem? You'll be able to read something, but it mind not mean anything, it might be the initial Default Value because the code to write the value hadn't yet been executed!
In my decade of using Channel Wires, I don't think I have ever used a Tag Channel (now that I write this, I might have used it once, but it caused me trouble so I had to do some kind of "funny business" to make sure it started correctly).
In LabVIEW, Queues were traditionally used in two main scenarios -- the Producer/Consumer design pattern, and in the Queued Message Handler and Queued State Machine. With the introduction of Channel Wires, the Stream Channel is what you want to use for Producer/Consumer (taking advantage of the "extra inputs" that lets you properly shut down both Producer and Consumer properly), while the Messenger Channel is ideal for Message Handlers and State Machines, as they allow branching and feedback loops.
One last thing I would like to leave with you, which I suspect has a relationship to the extremely large Block Diagram you developed. Think about text-based programming (say, Matlab). The structure of the program is basically one-dimensional -- you start at the top of the page, and work your way down to tne end. A larger, more complex program means you need a very long piece of paper (instead of 8.5 x 11 inches, you need 8.5 x 100 inches). LabVIEW looks like it is two-dimensional, as you can have an Event Loop above a While Producer Loop above a While Consumer Loop, but LabVIEW actually allows you to create three-dimensional programs, such as the Queued (or Channel) Message Handler -- one While Loop surrounds Case Statement, with each "Case" representing a different State of a State Machine (similarly, the Event Loop can handle a dozen events without growing in height or width, it grows in depth). Learn to design your code using Loops around Cases.
Bob Schor