RobotStudio event

Large Delay When Multitasking with Parallel Socket Connections

Hello,

I am running two tasks on the IRC5 controller in parallel, with each task connecting to separate programs via TCP/IP sockets. I noticed that if I have one task with a continuous stream of data the socketing is fast, but if I have sockets streaming data in both tasks, the speed goes down considerably.

To test this, I wrote simple scripts in java which connect via a socket and wait for a message back and write to a file how long the round-trip connection took. On the RAPID side I have a simple code which creates a socket connection, waits to receive something, and whenever it does, send out a message. I put the same RAPID script, with different port numbers for the sockets, in my two controller tasks, and ran two separate java processes to connect to these and record how long each communication loop takes.

For running the tasks one at a time, I get an average time of less than 1ms (~0.3ms)
For two completely independent tasks running simultaneously, the delay jumps to 14ms --- (from 0.3ms to 14ms is about 46 times slower, which is a very significant difference)

Why does this happen? Is there a setting that I can change to prevent this from happening, perhaps? Thank you for any help!