Home Programming

Discussion

Left ArrowBack to discussions page
ctrlctrl Posts: 5 Apprentice
Hi I am trying to use C (not python) for RTDE for a UR10e.  Can someone help me figure out how to pack the initial message, which I think should be 'v' for RTDE_GET_URCONTROL_VERSION.  It says two bytes for the package size and 1 byte for the package type.  I can open and connect thru the port but need help getting started with the basic header info in the first message I need to send.  

Can someone break this down for me?  Is this 
sendmsg[0]=8
sendmsg[1]=0
 sendmsg[2]='v'   

 for the header info or am I way off base?  


Comments

  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,070 Handy
    edited May 11
    Here is how we did it in nodejs originally, we run new code now but this worked for a long time

    _sendall(cmd, payload = '', callback) {
    let size = 3; //Header is always 3 bytes long, 2 bytes for the size, 1 byte for the command
    if (payload.length > 0) size += payload.length;
    let buf = new Buffer(size);
    buf.writeUInt16BE(size, 0); // write the size at index 0
    buf.writeInt8(cmd, 2); // write the command at index 2
    buf.write(payload.toString(), 3); // write the payload starting at index 3 this.sock.write(buf, 'binary', err =>{ more code here but nothing pertinent to the discussion
  • ctrlctrl Posts: 5 Apprentice
    Thanks, again for the help.  Am I not able to keep connections open to the dashboard (29999), a socket (50000) and another port (30002) at the same time as RTDE (30004)?  

    So far I can send the command out but get no response to RTDE_REQUEST_PROTOCOL_VERSION which is the first command I try to send.  All the other ports are okay and are receiving data with their respective handles.  
Sign In or Register to comment.
Left ArrowBack to discussions page