LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

5003 error on uno but sub vi's work fine individually

So I'm using an arduino with labview to control a winch that is lowering and raising weights to set hieghts using a little pid system and an infrared distance sensor.

The sub vi's atleast appear to work individually and I've had the winch working with the code fine and the hieght sensing working fine ust using the sensor and conversion vi's. However when I try to put the whole system together I just get a 5003 error from the sensor vi (Interface for Arduino.lvlib:Digital Write Pin.viLabVIEW Interface for Arduino.lvlib:PWM Write Pin.viLabVIEW Interface for Arduino.lvlib:Analog Read Pin.viLabVIEW Interface for Arduino.lvlib:I2C Init.viLabVIEW Interface for Arduino.lvlib:Init.vi.  A timeout occurred while trying to read form the Arduino.) any ideas why this is happening? I've checked everythings wired together properly and it should be ok, so I'm guessing this is a code problem.

Its running on an Uno R3 using usb for the communication and pins 6 and 8 to control the motor with analog 0 to read the hieght sensor.

Thanks,

Sam

0 Kudos
Message 1 of 4
(7,216 Views)

Hello sam_bwut,

I'm facing the same problem of you. I need to control stepper motors and when I run the same code for individually motor it's not ocurres that erro but if I use three of them the labview show error 5003 at the end of program. It's like some problem with close the interfaces's VI but I couldn't found the exactly place that make this.

Can somebody help us ?

0 Kudos
Message 2 of 4
(4,251 Views)

I've just got the solution!

The problem is the closing more than one arduino's tasks where you probably invoke more than one of the "Close" VI.

For fix that problem you'll need to modify your labview code of way to make a simple buffer of Arduino Resource values by a build array and make a for loop with ONE "close" arduino VI inside. So the software will finish one task after one

See the picture:

arduino tasks buffer.PNG

Have a good work guy!

0 Kudos
Message 3 of 4
(4,251 Views)

You should only have one Close.vi for each Arduino that you are using.  If you only have 1 Arduino, you should only execute Close.vi once.

If you have two arduinos, you don't need to do the build array stuff you are doing there because you are just undoing the array using the for loop.  Simply use two independent Close.vi's.

If you are using only one Arduino, then you cannot branch the Arduion resource wire.  You must have every LIFA subVI in-line with all the other LIFA VIs.

0 Kudos
Message 4 of 4
(4,251 Views)