LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[LabVIEW Tutorials] Programming an Arduino using LINX

Hi wew044, 

 

Have you first confirmed the following;

  • Can you get the basic blink VI working through LabVIEW as in my first tutorial? i.e. set the DO channel to 13 and turn it on and off to see if it works, this will let you know if you have correctly setup the firmware on the arduino and can communicate via LINX; 
  • Have you verified your circuit is correct? verify this, here is a link that goes through it in detail https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge...; if you can confirm this is 100% correct then;
  • Are you getting any error messages from your VI when you run it? if so what are they; 

Otherwise regarding your VI;

  • Close the reference to the arduino; make sure you close the reference to arduino when you exit the VI using the close.vi function in the LINX library, otherwise you will not correctly free up the LINX resource each time you stop the VI, which may result in communication errors. 
  • The Duty Cycle control is only set from 0-0.3, but you labelled it as 0-1, is this correct?

Once you have investigated, let me know how it goes and hopefully its working!

Best Regards,


Sin | Electrical Engineer & Principal Consultant 



 

0 Kudos
Message 11 of 72
(4,792 Views)

Hi Sin,

 

Thanks so much for the reply. 

I followed your suggestions and found the following:

1. I wasnt able to get the RX and TX to blink. When I try to open the COM port (COM5) in Ni Max, it says ""VISA: (Hex 0xBFFF0072) The resource is validbut VISA cannot currently access it." I did try to the upload firmware in the labview tool section a couple times but that didnt help.

 

2. I have verified the circuit is correct. I am able to control this using arduino IDE. so my arduino uno is communicating with the COM port. Just not in labview.

 

3. I added back the Close.VI. and yes the 0.3 instead of 1 was intended because the motor spins too fast when I was testing with arduino IDE.

 

 

0 Kudos
Message 12 of 72
(4,787 Views)

Interesting, have you read this; NI-VISA Error -1073807246 Cannot Access Resource;

 

"It indicates that LabVIEW could not take control of the Serial Port.", So my gut feeling is that the VISA session was not terminated properly, i.e. not including the close.vi or aborting the VI while running. 

 

My suggestion would be, if your circuit is correct and your able to get it running through the Arduino IDE is to;

 

  • Run the Blink VI example (its essentially the same as your VI just remove the PWM function and set the digital output to PIN 13, which is tied to the arduinos in-built LED) if this shoots the same error in LabVIEW, then proceed to the following;
  • Read through that NI article and troubleshoot;
  • Make sure your Arduino IDE isn't running at the same time as LabVIEW, they may be conflicting for control over that COM port
  • try a different USB port (different COM port) or;
  • Reset your COM ports
  • Restart your PC (to force any resources tied up to release)

See if that helps.

Best Regards,


Sin | Electrical Engineer & Principal Consultant 



 

0 Kudos
Message 13 of 72
(4,766 Views)

Hey Everyone, 

 

I hope you enjoy the final tutorial of the year, and have a Merry Christmas and Happy New Year! 

 

This will be the first video in the series I plan to make on getting LINX and LabVIEW wireless using the ESP8266 microcontroller platform. The end game for me is to be able to control another microcontroller over Wifi using LabVIEW and LINX like for example an Arduino UNO....;)

 

LabVIEW Basics #7 - ESP8266 ESP-01 TCP/IP Socket Server + LabVIEW TCP/IP Client

In this video I discuss, how to set-up the ESP8266 ESP-01 in both hardware and software, how to modify a USB programmer to pull the ESP-01 into download mode and most importantly how to write a proper TCP client VI 😉

 

 

Best Regards,


Sin | Electrical Engineer & Principal Consultant 



 

0 Kudos
Message 14 of 72
(4,723 Views)

Hi Sin. Thanks for ading these tutorials. Much appreciated. I am a part time online Mechatronics student trying to do an irrigation project in Labview using Arduino. Basically a moisture activating and deactivating a watr pump based on moisture level. I also added this to your YouTube channel. Hopefully you get more subscribers. I know a few doing Labview Arduino projects who will find this helpful :

 

'Would you please be able to add some Fritzing diagrams here or in Github for the LINX examples? Or add screenshots of Fritzing diagrams showing how to connect cables and components to the VIs block diagrams, similar to Arduino RGB LED.VI in Arduino Examples in Labview.? Hope you get plenty more subscribers'.

0 Kudos
Message 15 of 72
(4,602 Views)

Hi GreennRed,

 

Thanks for the feedback, I'm glad you're finding my tutorials helpful 🙂 

 

I have dumped my Fritzing schematics to my Github as requested, hope they're a

helpful starting point for your schematics and future design. 

 

https://github.com/SINConsulting/LabVIEW-Basics/tree/master/LabVIEW%20Basics%20Examples/Fritzing%20S...

 

Cheers!

Best Regards,


Sin | Electrical Engineer & Principal Consultant 



 

Message 16 of 72
(4,583 Views)

Hey Everyone, 

 

It's been a while !! I hope you enjoy the first tutorial of the year 🙂

 

LabVIEW Basics #8 - Uploading and Debugging Custom LINX (LabVIEW) Firmware to a ESP8266

In this episode,  I show you how to compile and upload custom LINX firmware to a ESP8266 ESP-01 Module. This will allow you to program your ESP8266 in LabVIEW and run the system over Wi-Fi as a bespoke embedded system.

 

This video focuses on compiling the firmware and blinking an LED on the ESP8266 over Wi-Fi controlled through LabVIEW.

 

I also discuss how to to debug the source code files with a pragmatic mindset. You don't need to be an expert in C to debug some errors! Once you're up and running, you can take this further and develop the firmware and libraries to suit your specific needs.

 

Best Regards,


Sin | Electrical Engineer & Principal Consultant 



 

Message 17 of 72
(4,536 Views)

The channel is now up on LBRY as well! Check it out if YouTube isn't your thing.

 

https://open.lbry.com/@SINConsulting:8?r=DAWBv89owEmE5b579tYuBKPvEuh2UNLq

Best Regards,


Sin | Electrical Engineer & Principal Consultant 



 

0 Kudos
Message 18 of 72
(4,428 Views)

Hey everyone! 

 

In this tutorial, I'll show you how to setup and configure ESP-LINK on an ESP8266 ESP-01 to act as a transparent serial to Wi-Fi bridge. ESP-LINK is used to send and receive serial data/commands from an Arduino UNO (or potentially any serial device) over a WLAN.

 

Additionally, ESP-LINK enables us to program our micro-controller platform over the air! I give an overview of how to flash the firmware to your ESP8266 device as well as a brief tour on all the features ESP-LINK offers.

 

How to setup and configure virtual COM ports on a PC using opensource and freeware software such as com0com, com2tcp and HW Virtual Serial Port.

 

And lastly how to integrate and test all these systems together so you are able to see data fly over the air!

 

 

This is the precursor to my upcoming project of running LINX over Wi-Fi and sending and receiving serial data through LabVIEW via a virtual COM port that sends the serial data over Wi-Fi. Stay tuned in if you don't want to miss out!

 

Best Regards,


Sin | Electrical Engineer & Principal Consultant 



 

0 Kudos
Message 19 of 72
(4,354 Views)

Hi Sin, 

 

Thanks for all of the tutorials. 

 

I am continuously running into Error 5003 while using any VI.

I am using an arduino mega 2560.

NI MAX shows a port description of Arduino Mega 2560, buad rate 9600.

The VISA test panel, I/O completes a write operation with no errors.

The firmware wizard completes with avrdude.ard.exe done. 

I read that some people had a problem with the arduino ide version so i installed 1.0.6.  

I do not see the device name on the VI or Probe when I run the program

 

I am at a complete loss as to what the problem could be. 

 

Tried different cables

Tried different arduino's

Arduino Mega 2560

Labview 2020  Version 20.0(32-Bit)

Linx 1.0.0.9 for LabView Version 2020 or Later (32-Bit)

Arduino IDE 1.0.6

Blink.VI (Simple) 

 

Thanks for any help!

0 Kudos
Message 20 of 72
(4,238 Views)