LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determining a input value to a VI

Hello,

   How can I use a vertical toggle switch control to determine the value of a single bit for a VI that has a 8 bit input port?

 


Regards,


Kaspar
0 Kudos
Message 1 of 9
(2,988 Views)
You can just use Boolean to (0,1). It's on the Boolean palette. If you're not setting bit 0, multiply the result by the bit value of the bit you do want to set (i.e. to set bit 3, multiply by 8).
0 Kudos
Message 2 of 9
(2,975 Views)

Your question is confusing to me. A toggle switch is already an "input". If you want to display the status of a bit, you need an indicator. For eight bits, you need 8 boolean indicators unless you add a control to select which bit you want to display.

Where do the eight bits come from? Are they e.g. an array of eight booleans or e.g. an U8 variable?

 

0 Kudos
Message 3 of 9
(2,971 Views)

Hi Kasper

Maybe something like this...

Its an array of 8 toggle switch controls to create an number to write to your port.

David

Message Edited by David Crawford on 01-31-2006 10:10 AM

0 Kudos
Message 4 of 9
(2,966 Views)
Hello,
 
  I will play arround with the example of the array of 8 switches to determine the value of a byte that will drive the input to a vi that requires a 8 bit input? Is it easly to have 5 of the bits set to a logic zero and the other 3 defined to come from a toggle switch? If the a concatenate function somewhere in LabView?
Regards,


Kaspar
0 Kudos
Message 5 of 9
(2,964 Views)

Just use an array with only 3 switches, the rest will fall into place ;).

(If you don't want the three low order bits, rotate the array accordingly.)

Message Edited by altenbach on 01-31-2006 08:36 AM

0 Kudos
Message 6 of 9
(2,948 Views)

It's called Build Array.

You might want to think about taking a LabVIEW basics course. There are a varieth of options besides the NI classes, including some on-line tutorials. Check your options at http://www.ni.com/devzone/lvzone/fundamentals.htm.

0 Kudos
Message 7 of 9
(2,945 Views)

You can use the Build Array element with two inputs. Right-click and select Concatenate Inputs.

One of the inputs would come from an array with three toggle switches.

The other input would be an array constant.

0 Kudos
Message 8 of 9
(2,939 Views)
Hello,

   Thanks for the help with the problems I had earlier. As a result of the great people that participate in this forum I have a solution. I am also planning to take the Basic 1 and Basic 2 class, but that wont happen for another several weeks, so I will keep on plugging away!
Regards,


Kaspar
0 Kudos
Message 9 of 9
(2,926 Views)