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.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 783 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings