LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to break a continuous digital input from arduino into chunks

Solved!
Go to solution

Hello,

Basically, I have a parallel-input Serial-out shift register connected to an arduino UNO that is interfaced with labview. The shift register output is fed into the arduino digital pin with eight inputs as 1's or eight 0's. what I am trying to do is to assign each bit from the digital pin of the arduino to an LED in the front panel in labview. For example, if there are four 1's and fours 0's being read from the arduino pin then four led's should be on and four should be off. Any help would be grately appreciated.

 

Thanks in advance.

0 Kudos
Message 1 of 9
(4,385 Views)

Just send the data through the serial port.  Since you are talking about 8 digital lines, just assign each line to a bit and send that byte through the serial port.  You can then read the byte in LabVIEW and parse the read byte.


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 9
(4,372 Views)
thanks for your reply crossrulz. can you expand on that and say what vi's i would beed. also, how would I assign each bit (out of 😎 to an led in labview
0 Kudos
Message 3 of 9
(4,364 Views)

Look in the LabVIEW Example Finder (Help->Find Examples).  There is an ok example in there for a simple serial read using the VISA functions.

 

Since the VISA Read outputs a string, you will want to use String To Byte Array and then Number To Boolean Array and Index Array to split up the bytes into the individual lines that you care about.


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 4 of 9
(4,336 Views)

Hello crossrulz,

 

can you please tell me how I can separate each boolean led that is in the first byte. please refer to the attached image for what I have done.

 

Thanks in advance

0 Kudos
Message 5 of 9
(4,199 Views)
Solution
Accepted by topic author naserkhan

You already have the Number To Boolean Array.  That was the part I was worried about you finding.  Use Index Array to get the individual booleans out of the array.  And Index Array is expandable, so you only need to call it once in this case.  Just expand it to have 8 elements and wire up to your LEDs.


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
Message 6 of 9
(4,191 Views)

Thank you very much. It works

 

If its not too much to ask, is ppossible to make a monochrome image of these leds in labview using any sort of vi's. Any help will be grately appreciated.

Thanks

0 Kudos
Message 7 of 9
(4,087 Views)
What do you mean? Do you want to save an image of the indicator and save to a file?
0 Kudos
Message 8 of 9
(4,076 Views)
I would like to make a black spot (or any ahape) assinged to each. the black spot should appear only when a led is turned on and then save it.. is this possible to do in labview ?
thanks
0 Kudos
Message 9 of 9
(4,054 Views)