Hobbyist Toolkit

Showing results for 
Search instead for 
Did you mean: 

Running Arduino and Labview together

Go to solution

Hello, as the tittles suggests, I want to upload a program from the Arduino software to my Arduino board and then, for example, some commands to control 2 servos with an adafruit shield, and then, to send signals from Labview to my Arduino board, to other components. And I want those 2 interfaces, my Arduino code, and my Labview code to run together on the same board. I don't want the Labview to override my Arduino code or the other way around, but I haven't really found a way to make it work, and I haven't really found a topic that addresses this issues specifically. I want to do that because I can control my motors with a shield that has a custom library, and I can't do that in Labview, and I need Labview to acces data more easily and to write some complicated mathematical models for control too. 

0 Kudos
Message 1 of 6

You haven't specifically said what you want to do with your servos, but I know the Arduinos have several analog and digital IO channels (some of the digital ones can do PWM, too).  So if what you are doing can be controlled by voltage, PWM, or an on/off signal, why not wire an analog or digital output controlled by your LabVIEW code to another pin (or two) that can be read by your Arduino sketch as an input to your servo code?.   Just a quick thought, I know the LabVIEW code can address analog and digital outputs and I know Arduino sketches can read from specified pins so it's worth a try. 


My disclaimer: I am familiar with using LabVIEW on the Raspberry Pi but haven't used the latest version (with LabVIEW Community 2020) with an Arduino yet so I am not sure whether it works like it does on the RasPi (in a separate code area that runs on it own outside of the Raspian OS).  If I get some time I will try it on one of my Arduinos before the end of the year.




0 Kudos
Message 2 of 6

I haven't specified what I want to do with my servos because my problem was not with them, I wanted to know if I can run my Arduino code in parallel with my Labview code, I was just giving an example. 
Let's say I want to control a stepper motor with my shield, and it has a custom library, that I can't find in labview interface with Arduino. Then I need my two codes to run together on the same board, one from the Arduino software so I can use my shield, and the other from Labview so I can do the other stuff I want to do, let's say I want to use an encoder to measure speed and plot that data on a graph.

Is it possible or they will overwrite each other?

0 Kudos
Message 3 of 6

Write your Arduino code to run and to respond to commands through the serial port using the Arduino IDE serial monitor


Then instead of using LINX use LabVIEW to talk to it using VISA serial just like any other device on a serial port.

=== Engineer Ambiguously ===
0 Kudos
Message 4 of 6
Accepted by topic author denispop

@denispop wrote:

I need my two codes to run together on the same board, one from the Arduino software so I can use my shield, and the other from Labview so I can do the other stuff I want to do,

Is it possible ?

Sorry I just reread this and the answer is a definitive NO you can't do that, it's LINX or Arduino native you can't mix the two except for the scenario I described above where you run Arduino native and talk to in with LabVIEW.

=== Engineer Ambiguously ===
0 Kudos
Message 5 of 6

Oh, I should add that depending on the Arduino library you can add "Custom Commands" to LINX.


Here's a link to an old Diligent Blog post


So while what you asked is impossible, you may not be totally out of luck. There should be some updated information around here now that NI has reabsorbed LINX and the LabVIEW Makerhub.



=== Engineer Ambiguously ===
Message 6 of 6