LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET LIN nxReadFrame returns an empty frame or the last frame when communication is stopped

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

0 Kudos
Message 1 of 1
(2,933 Views)