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 22.214.171.124 for LabView Version 2020 or Later (32-Bit)
Arduino IDE 1.0.6
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.
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.
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?
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.
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.
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.
Thank you very much, now the error does not appear.
In my case 430ms is enough.
Attached image of the Vi you speak of.
I had same issue that you had (Labview 2016, MakerHub LINX 126.96.36.199, Arduino ADK) and your solution solved this issue. I had an other configuration (Labview 2016, MakerHub LINX 188.8.131.52Linx, Arduino UNO) where the original LINX software worked well.