Correct way of creating a networked RAPID application/module

Dear reader,
After a day of diving really into RAPID and getting some test applications running I'm looking into the second big part of my application. For the project I'm working on I want to be able to send positions to the robot which to which is needs to move. All positions will lay on the same YZ-plane and are in the reach of the robot. I already got an application ready which can send these coordinates to a tcp/ip server.
Normally (with C/C++) I would either use a asynchronous socket or a separate thread in which I receive data and share received data using muteces to protect it. When using RAPID I'm not sure what the best way is to handle this data. I want the robot to move as fast as possible and as "real time" as possible. Can someone explain me roughly what I need to look into for this.
To give a bit more information... at this moment I'm thinking to use a simple binary protocol where I sent `messages` from my application to the robot. The first 4 bytes will hold the size of the message (big endian order) in bytes and once I receive a complete message I want to convert the received coordinates and use them with my robtargets. How can I read but not flush the first 4 bytes? And what would be the fastest/best solution to read numeric data?
Thanks
pollux
Tagged:
Comments
I think I am trying to do something along the lines of what you are did here. I am trying to get the IRC5/RAPID to receive messages sent from LabVIEW using Sockets. These messages contain first a position in space we want the robot to move, then another message telling the robot to move to that position defined in the previous message. I am new to this sort of thing so I was wondering if you could kind of steer me in the right direction of what I need to do? I have the robot being the client, and the LabView computer being the server.
Thanks!
SM
Robotics and Vision Specialist
Consat Engineering
Thanks,
SM
A record type is a data type that you can define after your needs like this
Robotics and Vision Specialist
Consat Engineering
Thanks,
SM
- pos (x,y,z)
- orient (in quaternion, there are functions for going between euler (pose data type) and quaternion and the other way)
- confdata (cf1,cf4,cf6,cfx)
- extjoint (external axis)
you can define them all as seperate variables
For the motion you can also use RelTool, which is in relation to the tool coordinate system and not the workobject as in Offs
Everything is described in the manual Rapid instructions, Functions and Data types
Robotics and Vision Specialist
Consat Engineering
Thanks,
SM
Robotics and Vision Specialist
Consat Engineering
I am receiving large amounts of data (in access of 80000 robtargets) in the main task. I dont mind the task being blocked during data reception.
The TCP/IP communication is fast enough but the unpacking (using UnpackRawBytes) and copying the incoming data to the robtarget buffer causes significant delays resulting in wait of 3~4 mins for data transfer. I guess the bottleneck is due to the processing/memory access capabilities of the IRC5 controller with the UnpackRawBytes instruction.
Will the speed improve if I move the data reception and handling to the background task ? Following is the code for data reception and unpacking
During the data reception, the Rapid Execution load goes to 100% while the CPU load keeps changing between 80% and 40 %.
I wonder if there is still some room for optimization to decrease the data reception time. Thanks