Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Linx for Labview 2020 Error 5003

Hi all, 

 

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. I read that some people had a problem with the arduino ide version so i installed 1.0.6. 

 

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

 

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) 

0 Kudos
Message 1 of 26
(12,925 Views)

Hi DDuff,

I suppose you are using the simple blink vi found in the LabVIEW examples. Did you check your port settings and making sure it is correct for the visa resource in the LabVIEW VI. Or is it your hardware connection that could be giving you the problem? 

 

From the NI knowledge base: 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.

 

Regards,

cyong

0 Kudos
Message 2 of 26
(12,816 Views)

Hello
I have checked the port settings and leaving it as shown in the attachment has started to work, but only for a short time. After I made modifications to the Vi it stopped working, although I did not modify things that are related to the connection with the Arduino Mega.
From that moment on it never worked again, despite many attempts.
I'm going to try changing the original connection cable that the Arduino brought and if it works I'll let you know.
And if you know of another possible solution, I hope you publish it.
Thank you

0 Kudos
Message 3 of 26
(12,745 Views)

Choke,

When you first startup LabVIEW , go to Linx under Tools Options Tab, configure your Ardiuno Target via the configuration wizard, did you attempt this step? Your configuration to the Ardiuno Mega the wizard will ensure proper communications via serial.  I assume you used the sample VI for the Linx Toolkit or did you use VISA instead? If you used VISA to code your VI can you attach it?

 

Regards,

cyong

0 Kudos
Message 4 of 26
(12,714 Views)

cyongje

Thank you very much for your interest.
I tell you that I have already done all the steps you suggest to configure my arduino mega.
As I said before, it only worked for a short time.
So I made a program with Arduino Compatible Compiler, which downloaded correctly to my board. Then I made a program to raise the data generated by the Arduino using Visa and everything works correctly, I think that with this I could rule out physical communication problems.
On the other hand, I still don't understand the LINX communication problem.
Regarding the VI, now I am at work and I do not have it here, but when it is in case I will send it.
I keep learning with you.
Regards

0 Kudos
Message 5 of 26
(12,680 Views)

Choke,

upload your vi so that your problem can be solved. No VI, is very hard to provide advice because the problem you descibe you provide very little details. I think is highly likely you messed up your VI somewhere with the improper use of the Linx Toolkit APIs when writing your code. Please look up on how Linx I/O works, ardiuno works using the remote I/O for communication.

0 Kudos
Message 6 of 26
(12,677 Views)

Hi Everyone, 

 

So I figured out the problem I was having with LINX. I posted the solution in another thread, but I will copy it here since this tread is more specific to this problem. 

 

So I started deep diving into the LINX Blink.VI and found that if I have the Highlight Execution turned on then the Open Serial.VI would not throw the 5003 error. After some digging I found this was the path of the error

 

Open Serial -> Initialize -> Initialize Device -> Synchronize -> Send Command -> Wait for Packet-> Wait for bytes 

 

In Wait for Byte.VI it seems like the program is timing out before the Arduino has time to respond. This was causing it to pass a True argument into the  Wait for Packet.VI and changing the Timeout error to be thrown.  The TimeOut parameter can be set a few levels up in Synchronize.VI as a parameter for SendCommand.VI (default is set to 100ms). I attempted to adjust the Timeout to allow the Arduino more time to respond but it did not seem to have any affect. I was also worried about slowing down all of the sub vi's that the timeout was being passed too and causing more problems.  While poking around I noticed that Initialized Device.VI was passing an "Initialize" argument into one of its sub vi's (Packet Number.VI . Further inspections showed that it was being used to initalize a 0 into the argument for Packet Number upon startup. I added a 2000ms wait to process to give the Arduino a chance to get started and it seems like everything works now. Once it get past the initial startup it does not seem to have any issues. 

 

If anyone happens to have any better/easier fix or more information on this issue I would be interested in hearing about it. 

 

 

 

Message 7 of 26
(12,659 Views)

Perfect!!!
Thank you very much, now the error does not appear.
In my case 430ms is enough.
Attached image of the Vi you speak of.
Regards

Message 8 of 26
(12,645 Views)

Hi DDuff,

 

I had same issue that you had (Labview 2016, MakerHub LINX 2.0.0.35, Arduino ADK) and your solution solved this issue. I had an other configuration (Labview 2016, MakerHub LINX 2.0.0.35Linx, Arduino UNO) where the original LINX software worked well.  

0 Kudos
Message 9 of 26
(12,306 Views)

Hello everyone
I hope you are well, for my part a little distressed, I have not been able to obtain the data from a gMPU 6050 Sketch.pngyroscope MPU 6050, although in Arduino I can read it,  in Labview 2020 with LINX, it has been impossible for me to get out of error 5003 that followed his advice to increase the waiting time, following the sequence ...
Open Serial -> Initialize -> Initialize Device -> Synchronize -> Send Command -> Wait for Packet-> Wait for bytes with a delay of 2000ms, over the original 100ms, but nothing, also on the Arduino side I have LIFA loaded .ino ... but nothing, I would appreciate new ideas ... I almost forgot, the blink example if I can make it work according to your advice.
Since already very grateful for your cooperation. and an apology for my poor English.

0 Kudos
Message 10 of 26
(11,740 Views)