Message Queue Timeout
Hi,
I am using PCSDK and message queues for communication beween a .Net application and rapid module. The following unit test is used to validate the timeout when waiting to receive a message. The intention of the test is to send a message to the rapid module and wait for a reply, since the rapid module is configured to not send any response the IpcQueue.Receive call should stop with a timeout (1000ms).
In this scenario the receive method will never return with a timeout, does anybody know why the timeout will not happen? Is it probably an issue of the receive method?
public void TimeoutExample()
{NetworkScanner scanner = new NetworkScanner();
Controller abbController = ControllerFactory.CreateFrom(scanner.GetControllers(NetworkScannerSearchCriterias.Real)[0]);IpcQueue sendQueue = abbController.Ipc.GetQueue("RMQ_T_ROB_R");
IpcQueue receiveQueue;if (abbController.Ipc.Exists("PC_SDK_Q"))
{receiveQueue = abbController.Ipc.GetQueue("PC_SDK_Q");
abbController.Ipc.DeleteQueue(receiveQueue.QueueId);receiveQueue = abbController.Ipc.CreateQueue("PC_SDK_Q", 5, Ipc.IPC_MAXMSGSIZE);
}else
{
receiveQueue = abbController.Ipc.CreateQueue("PC_SDK_Q", 5, Ipc.IPC_MAXMSGSIZE);
}receiveQueue = abbController.Ipc.GetQueue("PC_SDK_Q");
IpcMessage sendMessage = new IpcMessage();
sendMessage.SetData(new UTF8Encoding().GetBytes("RapidRoutineParameter;[\"Timeout\",FALSE]"));
sendMessage.Sender = receiveQueue.QueueId; sendQueue.Send(sendMessage);IpcMessage receiveMessage = new IpcMessage();
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start(); IpcReturnType returnType = receiveQueue.Receive(1000, receiveMessage); stopwatch.Stop();Console.WriteLine(new UTF8Encoding().GetString(receiveMessage.Data));
Assert.AreEqual(1000, stopwatch.ElapsedMilliseconds, 1000); Assert.IsTrue(returnType == IpcReturnType.Timeout); }Categories
- All Categories
- 5.6K RobotStudio
- 398 UpFeed
- 20 Tutorials
- 14 RobotApps
- 300 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 336 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 828 RAPID Programming
- 12 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings