LabVIEW Interface for Arduino Error 5003: A Timeout Occurred

Updated Jul 17, 2018

Reported In

Software

  • LabVIEW
  • Third Party Add-Ons

Other

  • Arduino
  • LabVIEW Interface for Arduino (LIFA)

Issue Details

I have a VI that uses the LabVIEW Interface for Arduino toolkit. Why does it generate the following error when I run my application?

Error 5003 occurred at LabVIEW Interface for LabVIEW Interface for Arduino.lvlib:Analog Read Pin.vi. A timeout occurred while trying to read from the Arduino.
 

Solution

Error 5003 indicates that LabVIEW has lost its connection to the Arduino. A loss of connection can be caused by disconnecting the USB or serial cable while a VI is communicating with the Arduino or poor wireless signal strength when using a wireless connection such as Xbee or Bluetooth.

Effectively, a timeout has occured when LabVIEW has not been able to read data back from the Arduino for a predefined amount of time (100 milliseconds per try for 10 retries by default).

Follow these troubleshooting steps to fix the problem:
  1. Ensure that all cables are securely attached if using a wired connection or that you have adequate signal strength if using a wireless connection. The USB ports located on the back of a desktop computer generally have more stable power supply than the front panel's USB ports. You may want to use those ports if you are on a desktop computer. If you are using a laptop, make sure it is plugged in during the troubleshooting process.
  2. Check to make sure you have the correct baud rate and COM port specified for your Arduino board in order to properly define the communication protocol. Failure to specify the right settings may result in this error.
  3. Every program that uses the LabVIEW Interface for Arduino (LIFA) Toolkit should begin with the Init command and end with the Close command. Ensure that you avoid the use of LabVIEW's Abort button as much as possible. When you abort a task, your code will not have a chance to run the Close VI. The next time you run your code, the Arduino will start up in an unknown state that could result in Error 5003. You may need to restart the board and re-load the LIFA firmware to correct this.
  4. Make sure that no other open programs are also attempting to communicate with the Arduino. For example, having the Arduino Integrated Development Environment (IDE) open may reserve the Arduino resource, resulting in Error 5003 when LabVIEW tries to access the COM port.
  5. You can try to open a built-in example program that interacts with the same I/O pins to see if you still get Error 5003. This will ensure the Arduino is actually capable of communicating with your computer.
  6. You can manually change the timeout time or the number of timeout retries by modifying the Time Out and Max Retries input terminals of the Send Receive function. Having a longer timeout value or a higher number of attempts (retries) may establish communication with your device.

Additional Information

Note: The package LabVIEW Interface for Arduino (LIFA) has been replaced with LINX. It is highly recommended to migrate to LINX as there will be no further development for LIFA. See How To Download Digilent LINX For LabVIEW? for more information.

WAS THIS ARTICLE HELPFUL?

Not Helpful