LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LINX and LabVIEW on Arduino Code

Solved!
Go to solution

Hello everyone. I've started to learn about LINX and how it can be used to connect LabVIEW with the Arduino board. I noticed that when using the LINX Firmware Wizard, it erases the Arduino programming and uploads its own firmware. Can I use LabVIEW with the Arduino IDE programming?

For example, LabVIEW is good at creating a UI for the user to interact with, but I'd like LabVIEW to run certain subroutines I've already programmed in the Arduino using the IDE. Is there a way to do that?

0 Kudos
Message 1 of 5
(5,083 Views)

Hi Umerator,

 


@TheUmerator wrote:

Can I use LabVIEW with the Arduino IDE programming?

For example, LabVIEW is good at creating a UI for the user to interact with, but I'd like LabVIEW to run certain subroutines I've already programmed in the Arduino using the IDE. Is there a way to do that?


You can have "best of both worlds" when you use the (virtual) COM port provided by the Arduino. You can send/receive messages using serial communication in LabVIEW and the Arduino…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(5,076 Views)

Edit: wrong post

0 Kudos
Message 3 of 5
(5,021 Views)
Solution
Accepted by TheUmerator

Hi Umerator,

 


@TheUmerator wrote:
  1. Whenever I serially print a string, the original string is overwritten, how do I print different information without the previous information being overwritten?
  2. I've made the Arduino communicate with LabVIEW, how do I make LabVIEW send a command back to the Arduino?
  3. The code I've made is for handling basic strings. How can I use this code to work with numerical values?
  4. I used LINX before moving on to NI-VISA. But LINX would overwrite the original Arduino firmware and I wouldn't be able to use my arduino code with LabVIEW. Is there a way for me to send serial commands to LabVIEW, using the LINX library?

1. You need to collect the received data. This is basic LabVIEW knowledge and done using a shift register and ConcatString (or BuildArray)…

2. Use VISAWrite to send data from PC to Arduino…

3. There are a lot of string functions, and several to convert between numeric values and strings. I recommend to use ScanFromString and FormatIntoString…

4. No. You either use LINX without the ArduinoIDE or you use the ArduinoIDE with VISA functions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(5,015 Views)

Hello Gerd,

I am trying to control the  button of Arduino via VISA from Labview. The button is in the pin 13 and inside an IF statement. If butt== 1 ( do nothing) elseif butt = 1 (motor start working in specific RPM)

 

I have built a simple code in Labview, but unfortunately is not working. I have looked the code of this post, and my code is similar https://forums.ni.com/t5/LabVIEW/quot-visa-write-quot-to-arduino-only-works-when-EXECUTION-is-ON/td-...

I am not sure where I need to put the pin number, and also if it needs an if statement..

Regards,
Alexis

0 Kudos
Message 5 of 5
(4,812 Views)