WaitForRxMessagesWithTimeOut Method - neoVI API
int _stdcall icsneoWaitForRxMessagesWithTimeOut(void * hObject, unsigned int iTimeOut);Public Declare Function icsneoWaitForRxMessagesWithTimeOut Lib “icsneo40.dll” (ByVal hObject As IntPtr, ByVal iTimeOut As UInt32) As Int32[DllImport(“icsneo40.dll”)] public static extern Int32 icsneoWaitForRxMessagesWithTimeOut(IntPtr hObject, UInt32 iTimeOut);Examples
void * hObject = 0; // holds a handle to the neoVI object
icsSpyMessage stMessages[19999]; // holds the received messages
int iResult;
int iNumberOfErrors;
int iNumberOfMessages;
unsigned int iTimeOut = 5; //milliseconds
bool bDone = false;
while(!bDone)
{
iResult = icsneoWaitForRxMessagesWithTimeOut(hObject, iTimeOut);
if(iResult == 0)
continue; //no messages received
iResult = icsneoGetMessages(hObject,stMessages,&iNumberOfMessages,&iNumberOfErrors);
if(iResult == 0)
MessageBox(hWnd,TEXT("Problem Reading Messages"),TEXT("neoVI Example"),0);
else
MessageBox(hWnd, TEXT("Messages Read Successfully"),TEXT("neoVI Example"),0);
}
return 0;Last updated