LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino, Labview, and CAN control

Hello All,

I am creating a multifunction machine being controlled by an Arduino AT MEGA. I am in need of controlling TWO CAN motorized actuators with Lab View being used as my control interface..Does someone have any suggestions as to how to acomplish this? I am relatively new to Lab View and would appreciate any insights here.

Thanks Larry

0 Kudos
Message 1 of 13
(10,107 Views)

I think you would first need to get the CAN-BUS Shield.  You would need to figure out the SPI commands and such to communicate with the shield.  You would then need to create create LabVIEW functions to communicate via SPI with the shield.

That's the basic idea. 

If it's not that easy then it my require finding an Arduino library for it and then creating custom LIFA functions to use the library's functions.

0 Kudos
Message 2 of 13
(5,762 Views)

LIFA does nt have CAN capability.  If you have a firm requirement to control the actuators with Labview then one option is purchase a USB interface to CAN that is compatible with Labview.  See:

<http://www.ni.com/can/>

Another possibility is a CAN Bus Shield for Arduino.  See:

<http://www.sparkfun.com/products/10039>

You would need to add support for CAN to the LIFA firmware to be able to use a CAN Bus Shield with Labview.  This is not a trivial task   I recommnd you go with a Natinal Instruments USB interface to CAN if your budget can afford it.

Howard

0 Kudos
Message 3 of 13
(5,762 Views)

I agree with this recommendation.  It's not extremely cheap but it's is the best and most reliable choice.

0 Kudos
Message 4 of 13
(5,762 Views)

Ok how about this idea: Labview does the Labview thing, tells the "Arduino" a position to send through the CAN bus

to control my actuators. Labview does not control anything but a Bolean State or a number that the Arduino can interpret and output a response through the Can Bus shield... This seems a lot better than letting Labview control the CAN Bus.

0 Kudos
Message 5 of 13
(5,762 Views)

What do you mean by "Labview does the Labview thing"?    Do you mean use LIFA or do you mean develop your own Labview interface to Arduino and not use LIFA?  This question is important because LIFA has a limited set of commands for controlling an Arduino.  See: LIFA > Documents > Labview Interfac for Arduino for a list of available commnds.  You will notice there is no command for setting a bit or word or letting Arduino interpret the bit or word and output a response.  Yes, you coould modify LIFA to perform this capability.   But if you prefer to have Labview  control "a Bolean State or a number that the Arduino can interpret and output a response through the Can Bus shield" then I believe a better approach is develop your own Labview interface to Arduino.

You will need to make the trade off between material cost and labor cost.  Most students and hobbyist will prefer the programming approach.  But most peiople woring in idustry will prefer the material approach.  It is up to youn to make your own trade off. 

Howard

0 Kudos
Message 6 of 13
(5,762 Views)

Oops I meant to say See: LIFA > Documents > Labview Interfac for Arduino Packets

Howard

0 Kudos
Message 7 of 13
(5,762 Views)

If all you need is one way communication then you would probably be OK with using the Arduino (as opposed to a CAN specific device that LabVIEW already knows.

If you can figure out how to send your "positions" through the can shield to the actuators using Ardiuno code (SPI communication; maybe there is a library already, idk), then I should be able to convert that to LabVIEW code for you using LIFA SPI VIs.

0 Kudos
Message 8 of 13
(5,762 Views)

All that needs to be done is to set the Arduino to recieve data on its Serial Port (String of values) with one of the values being the actuators position (0-100% lets say). The Arduino (with a CAN-Shield) interperate the incoming value from Labview and does whatever it needs in order to tell the actuator what to do.

With Labview he needs to use VISA to open up a COM port (which ever COM port the arduino is showing up as) and write your String (actuator value) to the port.

Labview Talk, Arduino Listen.

Granted he can't use LIFA's direct functionality but he can pull out the bits of Labview code from it and modify it to do what he wants. 

-Dan

Mechanical Engineering
Colorado State University
0 Kudos
Message 9 of 13
(5,762 Views)

From what I read about the shield, you don't need to do any custom Arduino code (in the end) because it communicate vi SPI which can be done with existing LIFA functions.  Unless there is something specific about the shield that I don't know about.

0 Kudos
Message 10 of 13
(5,762 Views)