From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling 16 LEDs with LINX through shift registers

Hi, I am very new to using LabView (and relatively new to Arduino) and would like some help please:

I have an Arduino Mega that is connected to two 74HC595 shift registers, this allows me to control 16LEDs selectively through the Arduino IDE using the bitWrite and shiftOut commands.

Now I would like to create a UI using Labview where I would have a matrix (of buttons maybe?) to control the LEDs individually, but I've got no idea where to start. For starters in the LED blink tutorial, I can see the logic but it baffles me how to use all the blocks... Where and how would I connect the latch and clock pins? and in the Arduino IDE I can select which LED to turn on/off by changing the respective output of the shift register to high [00000000] but I don't know how (or even how to search) for a method to do so...

Any help is hugely appreciated 

0 Kudos
Message 1 of 5
(9,553 Views)

Hello and Welcome!

 

Your problem is very clear to me, but i do have some questions in order to help.\\

 

You tried LINX blink VI, have you watched any other videos on using LabVIEW and/or LINX?

Are you willing to learn LabVIEW or just want to solve this problem?

I believe you have 2 aproches using LINX:

1) build you code and 74HC595 library for interfacing with digital OUTPUT with LINX.

2) Use the customcommand block, to send data to arduino and control your leds.

Personally, i like both. the first one would require a bit more learning on LabVIEW, the second one would require your arduino to randle shifOut commands.

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 2 of 5
(9,410 Views)

Hi,

I've seen some tutorial that is specific to LINX, and some very basic tutorials on Labview.

I want to focus on solving my problem but I am willing to learn Labview and become more proficient at using it.

 

Do you mind elaborate a little bit more on the two approaches you have written?

For (1), where would I start off building a code and library?

Or for (2) what is a customcommand block? is it much different from building my own as stated in (1)?

Also, I think I have seen some very old posts of people using an older tool package called LIFA where they used the SPI blocks to solve my issue? Is this something I can replicate using LINX?

 

Thank you very much

Z

0 Kudos
Message 3 of 5
(9,390 Views)

Great!

 

for 1) you could build the logic of shiftOut() function by using loops. create your own subVI to replicate this function, toghether with digital write of LINX toolkit. It may be a bit challenging at first, but it would be a great way to learn LabVIEW. (i mean, you don't need all this software engineering to do what you want)

 

Since your are interested in solving your problem. i'd recommend using custom comand function. This function allows you to send bytes to arduino and from arduino. this way, you can use the shiftOut() function in the firmware. There is a great tutorial i used a long time ago that may help you:

 

https://web.archive.org/web/20200806103634/https://www.labviewmakerhub.com/doku.php?id=learn:tutoria...

Instead of using mycustomcommand function to add values in variables, you can send the bits from your front panel. That may quickly solve your problem.

 

LINX is an upgraded version of LIFA, then i believe yes, you can use it as well SPI to solve your problem:

 

https://forums.ni.com/t5/LabVIEW-Interface-for-Arduino/SPI-for-Shif-Register-74HC595/td-p/3436404

 

 

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
0 Kudos
Message 4 of 5
(9,382 Views)

I'm going to check it out and give it a go. Thank you!

0 Kudos
Message 5 of 5
(9,364 Views)