LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using arduino and Labview to turn on/off LED at specified cycles

Hello,

 

I have created a program (LED_test.vi) that will turn on an attached LED when specified cycles are running and off when they aren't. These cycles are defined by variables and each cycle is approximately one second. This program is running smoothly and is attached. The ultimate goal is to input this same methodology into a larger program where elapsed cycles is created and updated elsewhere in the program. However, the elapsed cycles is not being checked and so the LED is staying off the whole time. I have attached a screenshot of this code since it is part of a much larger program that I cannot post. Any ideas on how to make this work when elapsed cycles is not being updated in that specific section of code?

 

Thanks!

Download All
0 Kudos
Message 1 of 4
(2,298 Views)

Why are you using all of those local variables?  Use wires.

Why are you using array to cluster and unbundle to index out the elements of an array?

Cycles should be an integer, not a double

 

I don't understand what you are trying to do with the boolean array to number feeding a case structure that 1 is true and everything else is false.

 

It seems like you have the basics for how to talk to the Arduino.  I suggest you write down on paper as either a flow chart or pseudo code for the logic you want to use before trying to implement it in LabVIEW code.

0 Kudos
Message 2 of 4
(2,281 Views)

@trevorlujan wrote:

Hello,

 

I have created a program (LED_test.vi) that will turn on an attached LED when specified cycles are running and off when they aren't. These cycles are defined by variables and each cycle is approximately one second. This program is running smoothly and is attached. The ultimate goal is to input this same methodology into a larger program where elapsed cycles is created and updated elsewhere in the program. However, the elapsed cycles is not being checked and so the LED is staying off the whole time. I have attached a screenshot of this code since it is part of a much larger program that I cannot post. Any ideas on how to make this work when elapsed cycles is not being updated in that specific section of code?

 

Thanks!


You are aware that the Arduino IDE comes with examples. The one you'll want to look at is Blink Without Delay.

 

Not sure why you are insisting on using LabVIEW when you don't know LabVIEW.

 

Might as well, learn C/C++ for Arduino.

 

 

.

0 Kudos
Message 3 of 4
(2,278 Views)

What you are doing makes no sense at all. First off you are putting the cart before the horse as we say...

 

You are worried about turning on an LED when "cycles" are running, but you have no "cycles" or anything like that in your program.

 

So of course what you are trying to do is not working and makes no sense to anyone. In fact if you figured something out that worked like you think it should you would probably have a hard time working that into a larger program.

 

I am willing to bet if you concentrate on your "main program" and get all the "cycles" working you will see that it is trivial to add an LED indicator that lights up when any "cycle" is running.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 4
(2,252 Views)