LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Launchpad in LabVIEW.

Dear LabVIEW friends,

In this VI you will find my final program for a basic Launchpad for all you people who whish to make this themself. I've got one goal next: it are RGB leds and i'm currently only sending the green ones out on the button i click but as you can see from the front panel i programmed it to give a blue & a red led also. Can sombody with knowledge send me the solution if possible i don't really have a clue how i should do it because the leds that needs to go Blue/Red are not the ones from the button i click.

I'll put some pictures of the project and the links from the products i used for you guys!

Good luck for the ones who wish to make the same thing.
And thank you for the ones helping me with the solution.

Button pad breakout:
https://www.sparkfun.com/products/8033
RGB leds:
https://www.sparkfun.com/products/105
Buttons and pad:

https://www.sparkfun.com/products/7835
NI USB-6501 24-line Digital I/O

0 Kudos
Message 1 of 9
(3,885 Views)

Oh my.  Have you ever see the "Rube-Goldberg" Thread?


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 9
(3,812 Views)

Why should i've seen it?

0 Kudos
Message 3 of 9
(3,788 Views)

My Teacher told me to do it this way

0 Kudos
Message 4 of 9
(3,785 Views)

While you your teacher may have told you to do it that way, your VI contains a remarkable number of pet peeves and practices that are considered bad practise around the forums or for LabVIEW programming in general. Just from a cursory glance I can see:

  •  Stacked Sequences: Flat sequences inside flat sequences?! All that was needed there was to add more frames to the base sequence. While flat sequences have their place, they are used here in place of proper dataflow.
  •  Local Variables: Used in an alright manner for exiting two parallel loops, otherwise though, how are you going to try and determine where a value has been set when trying to debug anything.
  • Opening/Close DAQ: All of the opening and closing of the DAQ ports is not only unnecessary, it is slowing down your program. Moving the opening and closing of these outside your loop would speed up and simplify your program.

  •  Timing control: Is there any timing control throughout your loops? From what I can see the only thing stopping your program from saturating your computers CPU is the time that it takes to wait or write the DAQ commands.

  • SubVIs: There is not a single sub-vi in amongst all of this program that I could find. Not only do they make it easier to navigate a program they can also help make it easier to understand and look tidier too. Even if all your DAQ open/write/close or DAQ open/read/close clusters were contained in subVIs the entire thing would look much nicer.

 

I'm sure there are other things to point out, if some of the more experienced guys here could take the time to narrow it down (I'm only a CLAD), and amongst all of this there is the problem of lack of some simple programming knowledge, you could simplify all of your boolean to number conversions by using two subVIs, Build Array and Boolean Array to Number.

 

This is not to diminish the amount of work that you have done to get this project working (I presume it works, I haven't got the hardware to test) but through use of proper techniques and development this project would get significantly easier to maintain and/or bug check.

 

[EDIT]: Formatting

Message 5 of 9
(3,753 Views)

Hi ogk.nz thank you for your advice. My life is pretty stressful atm just because of this project my teacher is my mentor given by school. We had 5 programming languages to choose from but he said i needed to do this with LabVIEW, in my opinion this project would be done much easier in Arduino or any other c language.
This Saturday i've to demonstrate my project in front of a jury. It isn't finished because i need to program the other colors but have no clue why and my teacher says i've to find it out myself and look on forums, he prob doesn't know what to do himself because most of the time during the year if he said i was stuck i founded an easy solution in most cases but he didn't saw it. Anyways enough with the story...
Can u show me what u mean and change it into the program so i can have a good overview over it and understand it before saturday. Also i don't understand how i should do the other 2 colors...Red/Blue since they are not assigned to the button i click.
Thank you in advantage,
Seppe Pairon.

0 Kudos
Message 6 of 9
(3,724 Views)

OK, we have confirmed that this is Homework.  So, we will give advice not answers.but, lets look at this structure that you have repeated 16 times

Capture.png

if you hold the Boolean (with a switch until released action) read the value once and write it to 3 local variables  (Yes the inner True case looks exactly the same with a True Constant)

 

Why  not make the control a latched Boolean?


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 9
(3,704 Views)

I will try it out tomorrow. Can't do it at home since i only have mac and DAQmx drivers are RIP for Labview 2016 Mac

0 Kudos
Message 8 of 9
(3,698 Views)

Hi, my name is Seppe.
I'm currently making in my freetime a launchpad 4x4. I finished school and the project wasn't finished yet so i'm finishing it at home just for fun.

I'm having one last issue, my green and blue from the RGB work fine but for some reason my red doesn't seem to work right. Sometimes  a whole line goes on and sometimes nothing happends when normally for each button only one red led should light on.

I'm wondering if the issue is that i'm using the Port for 2 different kind of things. I used another port for the blue and the green as u can see in the program.

I'm using the NI USB-6501

and as PCB i'm using this one: https://www.sparkfun.com/products/8033

Thank you in advantage see file,

Please help!
Seppe Pairon.

0 Kudos
Message 9 of 9
(3,593 Views)