LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subVI to multiplex 4 input and single out

Solved!
Go to solution

I am having trouble with a LabVIEW 2009 problem:

 

P4.3)  Create a subVI that multiplexes four inputs to a single output. The subVI should have four floating-point numeric controls (denoted In1 thru In4), one floating-point numeric indicator (denoted by Out), and one unsigned 8-bit integer control (denoted by Select). if Select = 1, then Out = In1; if Select = 2, then Out = In2, if Select = 3, then Out = In3; if Select = 4, then Out = In4. (Hint: The Select function VI from the Programming>>Comparison palette may be useful.) 

 

 - Where do I find the unsigned 8-bit integer control?

 - How do I get it to do the desired function?

 - How would the select function in the hint be able to help at all?

 

I don't mind answers that require me to think. I'm trying to learn this stuff.

Any help would be greatly appreciated. Thanks, Matt

0 Kudos
Message 1 of 7
(5,497 Views)

A numeric control is a numeric control. You right click and select representation and change it to what you want. In this case U8.

 

The select function is pretty much an if/else. If the bool input is true the top input goes to the output. If it is false then the bottom input goes to the output. Hint: You need more than one.

 

I would give you the answer but it sounds like a school project. If so you should really think about how to answer it yourself. I am sure you have some kind of course manual to refer to.

=====================
LabVIEW 2012


0 Kudos
Message 2 of 7
(5,481 Views)

I really appreciate your help.  I thought that all I could have in my subVI were the listed items. I'm assuming it is okay to use select function(s).

 

 - Why does it say to make a subVI instead of a VI? I'm thinking that is important to solving this.

 

 - I'm thinking that the U8 control will control my select functions (I'm using three). The first two controls go to one select function, and the second two controls go to another select function. Then, their results go to the third select function.  Allowing the Indicator to achieve the intended value. But that will not work because the select functions and the U8 control are of different types. Am I at least thinking in the right direction? If so, do I use some kind of conversion function to correct the problem with the different terminal types?

 

 - The indicator should have the same value as the control that is selected.  This is my interpretation from the problem. Can you give me a hint about how to get the U8 control to make the selection? if it's even supposed to.

 

I've read this chapter twice and scanned chapters 1-3 trying to come up with an answer. I've looked at the context help window and other help windows and a lot of LabVIEW examples. It seems like I'm just missing something simple.Not sure if I am thinking in the right ballpark. 

 

Any advice helps.  Thanks, Matt

 

 

 

0 Kudos
Message 3 of 7
(5,468 Views)

A VI is a subVI if it is used in another VI. It has a connector pane. Other than that a VI is a VI.

 

The U8 is called select and there is a function called select. I am not sure if that is causing any confusion.

 

The select fuction has three inputs and one output. The top and bottom inputs can be anything. String, number, boolean, cluster, class.... Anything. The middle is a boolean true or false only. If true the top goes to the output and if false the bottom goes to the output. You don't wire your U8 "select" control to the select function at all.

 

You are on the right path. What you have to do is use comparison functions.  "select" = 0 will output a boolean. That connects to the boolean input of one of the select functions. It is useful in learning to solve the problem using the select fuction but it is not the best way in my opinion. Using a case structure or build array followed by index array would be cleaner.

 

Your assignment is to just solve the problem. But if you are really interested in improving your LabVIEW skills I suggest that you solve this problem in three ways: Case structure, select functions and array functions.

Let us know what you come up with.

=====================
LabVIEW 2012


0 Kudos
Message 4 of 7
(5,461 Views)

No confusion on the U8/"Select" and the actual Select Function. What you wrote here was a little confusing: 

 

 - "( You don't wire your U8 "select" control to the select function at all. )"

 

 - "( "select" = 0 will output a boolean. That connects to the boolean input of one of the select functions. )"

 

It sounds like you are saying opposite things. I'm not sure if you made a mistake or if I'm not understanding you.

0 Kudos
Message 5 of 7
(5,453 Views)
Solution
Accepted by topic author Mr. Matt
You do a comparison on the U8. The output of the comparison is a boolean. Wire that output to the boolean input of the select.
=====================
LabVIEW 2012


0 Kudos
Message 6 of 7
(5,450 Views)

I'm starting to get the hang of this. I appreciate all your patience.

0 Kudos
Message 7 of 7
(5,447 Views)