06-30-2012 09:16 AM
I want to reduce the cluster of wires in my vi. How can I have a terminal at one end which wirelessly connects to another similar terminal and I can then draw out a wire from the second terminal and do whatever I want to. Like a wormhole from one part of the VI to some other part of the VI.
06-30-2012 01:08 PM
06-30-2012 01:12 PM
You may want to look into Queues or possibly a Functional Global. Locals will also "solve" this problem, but can quickly reinforce bad coding habits and introduce readability problems.
However, if you find that your block diagram is becoming a huge mess of wires, the first thing you want to ensure is make sure you're implementing a solid architecture. Is your code organized using a state machine or similar?
06-30-2012 01:21 PM - edited 06-30-2012 01:23 PM
@Soham wrote:
Like a wormhole from one part of the VI to some other part of the VI.
You mean like this?
How are you planning to enforce data dependency and execution order?
@Soham wrote:
I want to reduce the cluster of wires in my vi.
Seriously, You already mentioned the keyword "cluster", so bundling data that typically stays together into a cluster will significantly reduce the wire clutter.
07-01-2012 12:12 AM
Basically I am making a MUX as can be seen in the attached figure. So rather than having a local variable of string 5, can I have a different variable of that sort in which wires go in and come out of the other end. Something like the altenbach showed. And how did altenbach do it, please help me.
Thanks.
07-01-2012 01:32 AM
There are lots of ways to do this. One simple way is to chain the case structures together. You can leave your existing case structures, but instead of having a local variable of String5 in each one, instead wire that string through the true case into the next case structure. In each following case structure, pass through the string you want in the true case, and in the false case pass through the string that came from the previous case structure. At the last case structure, wire the string output to the String5 indicator.
07-01-2012 01:47 AM - edited 07-01-2012 02:00 AM
Please attach your VI instead of a picture.
Obviously you have exactly four possible outcomes, because if two of the current cases would be true, the result would be random due to race conditions
All you need is a single case structure with multiple cases and all string controls wired into it. Do some logic (e.g. see below with the two booleans to select one of the four cases). The string indicator is after the case structure, no local variables needed.
Another option would be to build the four string controls into an array. Also build the two booleans into an array, convert the boolean array to a number and use it to index into the array of string inputs to obtain the string output.
Obviously you have exactly four possible outcomes, because if two of the current cases would be true, the result would be random due to race conditions
07-01-2012 01:58 AM - edited 07-01-2012 01:59 AM
Here's what I have in mind. Simple enough?
(If you want seperate controls, simply use build array to merge it into my example code. No local variables or underground wires needed. Right? Attached VI is LabVIEW 8.2)
07-01-2012 04:32 AM
What is the thing that you have done after the boolean array? Sorry if its something simple...im sort of a newbie. 🙂
07-01-2012 07:58 AM
As a student then you should learn to use the manual. The code posted is a snippet, which you can drag and drop onto a block diagram. Then turn on the Context Help.
Then do this: To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.