I have an application written in CVI compiled to a .dll and executed from TestStand. When it is executed from the TestStand Sequence editor it works fine. When I load the same sequence into Test Exec and run it, the UDP callback never executes. I can monitor the Ethernet traffic using Wireshark and the correct messages are being transmitted to the P.C. I have run out of ideas as to why the call back never executes even though I can clearly see that the correct packets are coming back. Does anyone have an idea of what might be happening? I wonder if there may be an execution speed issue?
Windows 7 Ultimate 64 Bit, Quad Core i7 Intel CPU, 16 GB RAM. CVI 2013 & TestStand 2013.
Thank You in advance for your help.
void __declspec(dllexport) __stdcall startUDPR5Connection(short *errorOccurred,
long *errorCode, char errorMsg[1024])
{
error = UDPR5_startEthernet();
}
int UDPR5_startEthernet (void)
{
error = CreateUDPChannelConfig(19025, "192.168.80.50",1,R5Callback,NULL,&readerR5Channel);
error = UDPMulticastSubscribe(readerR5Channel, "230.77.69.76", NULL);
error = CreateUDPChannelConfig(19024, "192.168.80.50",0,NULL,NULL,&writerR5Channel);
error = CreateUDPChannelConfig(14502, "192.168.80.50",0,NULL,NULL,&writerR5U3Channel);
}
int CVICALLBACK R5Callback (unsigned channel, int eventType, int errCode, void *callbackData)
{
do //loop until entire packet has arrived
{
LastSize = size;
Delay(.001);
// Read the size of the arrived data packet.
size = UDPRead(channel, NULL, 0, UDP_DO_NOT_WAIT, NULL, NULL);
}
while (LastSize < size);
msg = malloc(size + 1); // Memory size is allocated on readback size
// Read the waiting message into the allocated buffer.
size = UDPRead(channel, msg, size, UDP_DO_NOT_WAIT, &srcPort, "230.77.68.76");
if (msg) free(msg); // Memory size is de-allocated
}