LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SD6 Teleop issues

Solved!
Go to solution

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.

0 Kudos
Message 11 of 40
(1,607 Views)

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.

0 Kudos
Message 12 of 40
(1,592 Views)

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. 

 

http://www.ni.com/white-paper/4256/en/

0 Kudos
Message 13 of 40
(1,583 Views)

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)

0 Kudos
Message 14 of 40
(1,577 Views)

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. 

0 Kudos
Message 15 of 40
(1,574 Views)

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!

0 Kudos
Message 16 of 40
(1,571 Views)

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. 

Download All
0 Kudos
Message 17 of 40
(1,556 Views)

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. 

Message 18 of 40
(1,550 Views)

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. 

0 Kudos
Message 19 of 40
(1,549 Views)

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. 

0 Kudos
Message 20 of 40
(1,546 Views)