LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Toggling combinations of variables

So I'm trying to control LEDs via LabView. I need to be able to turn on and off any combination of 32 LEDs based on a users input. I've been thinking that I would want to use a boolean array with 32 elements, but I don't know how I could have any user determined combination of the boolean values be changing. This is both a question for the theory as well as for the LabView implementation. Any helpful suggestions would be greatly appreciated. 

 

Thanks

0 Kudos
Message 1 of 10
(4,040 Views)

You will give the user an array of Boolean controls to work with?  How would that not allow any combination?  Or am I misunderstanding?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 10
(4,037 Views)

short answer: it can be done..give us a more specific answer to your requirements (to what specific user input to what specific boolean arrayed ouptut you need?)

0 Kudos
Message 3 of 10
(4,033 Views)

Okay sorry for the lack of details. So what I now have is a boolean array in which the user can toggle between true/false(on/off) and these changes dictate the changes(equivalent) on the "resulting array". Now I need to make a system(using a breadboard for simplicity) where the "resulting array" is the breadboard with LEDs on them. 

 

That is to say when boolean values at index 1, 4, 5, and 15(or whatever) are set for true in LabView, they're corresponding LEDs on the breadboard are on(receiving power.) When the values are set to false, the LEDs should not be receiving power, and should be off. This is being done on a classic breadboard and I'm trying to limit inputs.

 

Thanks

Zach

0 Kudos
Message 4 of 10
(4,023 Views)

So you are just trying to limit the number of wires you have to hookup to your breadboard?  If you have the right DIO, a Serial to Parallel adapter might be of some help.  For example, TI's SCLS555 will take a serial command and turn it into 8 lines.  Granted, to get this to work in software will take some careful planning of your DIO lines and building of waveforms.

 

EDIT:  Heh, upon actually reading the datasheet, the SCLS555 accepts a UART input and is addressable.  It takes 2 commands per 8 bits.  But you could have 3 of these chips, each has a different address, and you wire the serial port to each of the chips.  Seems like the outputs should have enough drive to run the LEDs even.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 10
(4,013 Views)

sounds simple, if your using a NI daq...goto your help>>find example>>hardware input and output>>daqmx>>digital generation>>write dig chan.vi...try that outSmiley Wink

0 Kudos
Message 6 of 10
(4,008 Views)

Okay so I'm using a Labjack u12. 

 

I'm trying to use the digital signals of the labjack to turn leds on and off on a breadboard. 

 

How can I make it so that the labjack turns on/off only the leds I code? aka routing power only through the digital outputs I request. Is that possible? Lastly, how do I communicate with the Labjack via labview? VISA seems not to be the answer...

0 Kudos
Message 7 of 10
(3,986 Views)

Have you tried their drivers?

http://labjack.com/support/ud/examples/labview


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 10
(3,981 Views)

It sounds like you're just asking how to turn on and off digital outputs of your DAQ with simple boolean controls.  If so, that's about the simplest possible application for digital output.  What have you tried?  Where are you stuck?  Both LabVIEW and LabJack have example code available.  That should show you all you need to toggle some digital lines.  If that's not all you need to do, post back and describe the whole project...

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 9 of 10
(3,975 Views)

I've been using and looking through all the examples. I don't understand how Labview communicates with the labjack u12...

 

To be more detailed: 

I'm trying to use the labjack commands LJUD_OpenLabJack.vi and the DigitalIO.vi blocks. I don't know what the ID number(it looks like -1 maybe,) the connection type, or the device type are...or at least how to dictate what they are within labview.

 

Thanks for the help I'm quite new to labview and definitely new to the use of the Labjack

0 Kudos
Message 10 of 10
(3,961 Views)