Hello, i am working with a KUKA KRC 15/2 VKRC2 01. I have done all the connecting into serial port and i am sending and saving coordinates into a variable position. The only issue i am having is, that when i put all together into a for loop, zero the variable before another loop and continue to cread num.2 for example, it seems like the cread is not doing anything at all for the second time. I tried reopening the portal (copen..) and closing it at the end of the loop, but its also not helping. Seems like the memory is full or something like that, its not saving the coordinates, when it was well used once. It works only when i reopen the whole program, and i would really like to run it in a for loop, soo any ideas? The code is simple for now.
using
COPEN
CREAD(HANDLE,SR_T,SW_T, TIMEOUT, OFFSET, "%f %f %f %f %f %f", varPos.X, varpos.Y, varPos.Z . . . .
move to the position, that was saved by cread into a variable LIN varPos ;===>(varPos.X .. .. .. ..)
CCLOSE and then all again, the problem is its done well only once.
Thank you for you help and wish a good day.
KUKA CREAD problems in for loop
-
fkanout -
July 3, 2018 at 2:32 PM -
Thread is marked as Resolved.
-
-
Maybe the other side of the serial connection sends some bytes which are missinterpreted and disturb the CREAD statment.
You should post the complete code, not a handwritten excerpt with a flowery description around it.
-
Figured it out. OFFSET for cread needs to be set again every loop...
-
As you can see. Nobody could have helped you with the provided informations in your first post. If you would have posted the real code, it would have been clear on the first sight.