Hi.
I'm running a CVI example for the LIN XNET card.
My Master is communication well with the slave device, but when communication stops or even before starting, the nxReadFrame keeps returning one frame,
it's an empty frame (payload 00 00 00 00 00 00 00 00 hex) or the last frame received.
// Read Stream of frames without waiting.
g_Status = nxReadFrame(g_InputSessionRef, l_pMyFrames, sizeof(l_pMyFrames),nxTimeout_None, &l_pMyNumBytesReturned);
if(nxSuccess != g_Status)
{
PrintStat(g_Status,"nxReadFrame");
}
// Find the number of frames returned using the bytes returned.
l_pMyNumFrames = l_pMyNumBytesReturned / sizeof(l_pMyFrames[0]);
if ( l_pMyNumFrames > 0 )
{
// Iterate frames using simple indexing and update textbox
for (i = 0; i < l_pMyNumFrames; i++)
{
for(j=0;j<l_pMyFrames[i].PayloadLength;j++)
{
sprintf(l_pBuffer,"%02X",l_pMyFrames[i].Payload[j]);
printf("%s\t",l_pBuffer);
}
Is there any reason for this to happen?
Thanks in advance.
Regards.
Daniel