04-19-2014 06:43 PM
Thank you for your response. The error is coming from the bundle by name function after the flatten to string function. If I probe the error line VISA byte count function, I get a warning, code 1073676294 VISA: (Hex 0x3FFF0006) The number of bytes transferred is equal to the requested input count. More data might be available. Is this coorelated to what you are saying?
Sorry, I am still pretty inexperienced with LabView, so if you have any tips on how to go about fixing this I would greatly appreciate it.
04-20-2014 11:38 AM
That is not an error, it is a warning. (My opinion, a stupid warning that just says you got back exactly what you asked for.)
But the problem is that you you have 0 bytes at port when you check that value immediately after you did a VISA write, you will than Read 0 bytes, and you'll get back exactly what you asked for, 0 bytes, and get that warning.
Does your device return a terminatin character such as a line feed or carriage return? If so, you should be relying on that. The fix to your problem is to get rid of bytes at port, read a large number of bytes, and rely on the termination character to give you a complete message.
If you don't have the termination character, you can still use bytes at port, but make sure you put a wait before the bytes at port. A long enough wait for the device to have plenty of time to return a message.
04-20-2014 11:59 AM
Yes that is a warning, but immediatly after I get the error 116. I assume the two are correlated? The device is a NI 9870. I am not sure if my device has a termination character, but I will use the examples on this page to check. Thanks again for your help.
04-20-2014 12:07 PM
Yes, they are related. Reread my message #10. Use probes and indicators on various wires so you can understand what data is flowing through your VI. (Bytes at port, the output of the VISA read, the output of the match pattern, the boolean that controls the case structure)
04-20-2014 12:09 PM
They are not.
If I remember correctly, the 116 error is generated when you are not correctly talking to the Roboteq. The Roboteq responds with a plus sign when it recieves a good command. If you do not read the response the code is artificially throwing the 116 error.
Are you positive that you're targeting the correct serial ports? Is the external EStop button engaged? It's the large red one on the rear outside of the robot.
One thing I did notice from working with it myself, is that there's a typo in the baud rate. It should be 115200, not 112500.
04-20-2014 12:13 PM
Or when you read bytes at port too quickly and there are zero bytes at port, then you proceed to read zero bytes, you get an empty message which means you can't find that plus sign you are looking for!
04-20-2014 12:39 PM
On the VISA test panel it does show the baud rate as 112500 I believe, I will change it to 115200 and see what that does. I am fairly sure that we are targeting the correct ports, but I do feel like the problem is somthing more along those lines than with code itself. A prior group had this code working, and Jason you got this code working without making changes to this driver as well right? Since this is a widely used program and there arent comments on the download page for it regarding this, it leads me to believe the code works, but my problem is elsewhere.
04-20-2014 12:43 PM
Besides the baud rate, I did not have an issue with the motor code. I did consistantly have the 116 issues but that was solved by formatting and updating the serial code on the cRIO itself. I was clued in on this being an issue because the serial ports kept on dissappearing in MAX.
One thing I will note is that ASRL1 is on the cRIO itself. Port1 on the serial card is ASRL2 and it counts up from there.
04-20-2014 12:45 PM
I will try and put some sort of delay in between the VISA write and Bytes at Port, but as I said in my last post, I do think the problem is something else as we did not write this section of the code, and I havent seen anything about needing to change that anywhere else. Thank you for your quick replies.
04-20-2014 12:47 PM
When you say formatting and updating the serial code, you mean following the process outlined on this page?
http://digital.ni.com/public.nsf/allkb/6B1343F61905203386257051006573CA
Thanks again for all your help.