LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView Vis / Arduino Flashing LED error 5002

Greetings and Salutations everyone!

Using Labview with an Arduino One, running a flasing LED Vis.  The light flashes for a while and then stops.  I have a green useless button, that should start or stop the flashing, but once the light stops flashing, the (light bulb icon) shows the way the logic is traveling, and it's plain to see that there is no going back to "flashing".

When I press the stop button on the front planel  I get error message 5001, which is rather involved, though, at the base of the error message there are three choices: [Continue]  [Stop] or [Why not found?].  Clicking on [Continue] resets the VIs , which prepares it to run again. 

Please find three jpg images and one MP4 video, then get back to me with a solution.

Thank you!

4j1a 

0 Kudos
Message 1 of 9
(6,852 Views)

Hi, Two quick points 1- Upgrade to LINX 2- It appears that your pin assignment is inside the while loop. Set the pin outside the loop if you can. barddya

0 Kudos
Message 2 of 9
(4,749 Views)

The baudrate for the Arduino Uno is 115200.

For optimization, it is best to have all single action VIs outside the loop (especially setting of the pin mode).

Message 3 of 9
(4,749 Views)

Great,

Changed the baudrate and removed the loop,  now the LED does not blink and the button, still has no function.  The error message at the end still comes up as a 5001 or 5002.  I attached another image Flashing-VIs-revision-1.jpg which shows what the VI is doing.  What would you sugjest I do to make the light flash and the button to toggle it?

0 Kudos
Message 4 of 9
(4,749 Views)

You shouldn't remove the loop.  This means that it will only run once.  I said that the "Set Digital Pin Mode" VI should be outside the loop (after Init.vi and before the loops starts).

Error 5001 says that your digital pin is out of range.  This means that you are not giving it a valid pin.  Valid digital pins on the Arduino are 2 through 13 (iirc).

The errors that you are receiving in the latest version of your VIs is probably because you are not 1) using a loop and 2) are not closing the reference to the Arduino with Close.vi.

Here is how I would program this basic VI:

LED Control.png

Then, make sure that you avoid hitting the abort button.  Try to always use the front panel stop button if possible.

0 Kudos
Message 5 of 9
(4,749 Views)

Howdy!

I am trying really hard to get this project over and done with, LOL.

Made a DIs similar to your suggestion, yet, the LED just sits there;

clicking on the button, has no effect either.  Could be it's just some

comma or dash thats holding it up. Maybe I missed something.

What could it be?

Please find a screenshot of the Di attached.

Download All
0 Kudos
Message 6 of 9
(4,749 Views)

Well, when you have an error, it won't do anything.  I think that error is saying that it can't find anything on COM6.  What COM port is your Arduino on? (look in the Windows Device Manager).

0 Kudos
Message 7 of 9
(4,749 Views)

Please find the attached Arduino-UNO-COM6.jpg file.

I changed the baud rate to 9600 on the DI.

The DI pauses at the Arduino/input box for 30 seconds

while the light flashes on the UNO.

Then it proceeds with errors.  See attached DI-LED-errors.jpg

If getting a button to turn an LED on and off is this difficult, it 

will be impossible to do anything else.

What do you think will make this DI function?

Download All
0 Kudos
Message 8 of 9
(4,749 Views)

When you say "DI" are you trying to say "VI" (the name of a program in LabVIEW)?

The baudrate for the Arduino Uno must be 115200 because that is the value that the Arduino Uno uses when you load the firmware on it.  Were you able to successfully upload the LIFA firmware to the Arduino via the Arduino IDE?  And, did you remember to re-upload it after you tried any of the example programs in the Arduino IDE?

This particular VI (the one that I posted) is the most simple thing you can do with LIFA.  If you are having problems at this point, it is probably something super simple that when you find it, you will not be happy (I've had this happen many times before).

I highly recommend that you abandon LIFA entirely and use LINX instead.  Not just because you are having issues but because LIFA is deprecated.

0 Kudos
Message 9 of 9
(4,749 Views)