LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a Arduino method from LabView?

Hi!

For a school project, I have to make an Arduino robot which can navigate it's way through a model city. It has to be able to read traffic lights, discern other robots etc.

The robot has to be able to act independantly, but in case of an emergency (i.e for example if he doesn't recognize the color of the traffic lights), I have to be able to interrupt
using LabView. I have to be able to control the Arduino manually with some buttons in LabView. So, I have a couple of methods programmed onto the Arduino, like GoForward(),
TurnRight() etc. My question is: is there any way I can call these methods from LabView? I don't want to rebuild them with a LabView block diagram, I just want to name the
method the Arduino has to run.

Thanks,
Wouter

0 Kudos
Message 1 of 4
(4,414 Views)

You could send characters like a, b, c, d, and e, where each character specifies a unique function, to Arduino and then use a switch control structure to select the function.  For an example see:

<http://arduino.cc/en/Tutorial/SwitchCase2#.UyM1fj9dU_o>

This method works with Labview but will not work with LIFA.

hrh1818

Message 2 of 4
(3,670 Views)

Why doesn't it work with LIFA?

0 Kudos
Message 3 of 4
(3,670 Views)

I should have said it will not work with the present version of LIFA.   LIFA uses a switch control structure to select which function to run. You could add more case statements to select your functions and  create a packet for selecting your functions. Look at the LIFA source code and Documents > Labview Interface for Arduino Packets to see which approach you think will be easier to implement.

hrh1818

0 Kudos
Message 4 of 4
(3,670 Views)