Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

LIN communication using C API nxReadState status error

I am using XNET LIN loopback example where I have modified the example to use ":memory:" to create session for "nxMode_FrameInStream" and "nxMode_FrameOutStream".

 

I call "nxReadState" before and after every "nxReadFrame" call. I get a communication state value of "0x80000004" and there after "0x80000008" for every call.

 

Can someone elaborate on this error ? Is there something wrong with my setup?

 

I did refer to documentation (http://www.ni.com/pdf/manuals/372840k.pdf#page=827)  but was not able to find out how to fix this error.

 

 

 

Following is a screenshot I/O Trace log for the same. (also attached is the trace log)

 

LIN_Trace_log.JPG

 

 

 

 

0 Kudos
Message 1 of 4
(4,450 Views)

Hi mahajan24,

 

Can you give a little insight into what you mean by your 'setup'?  It looks like there is nothing there to receive the LIN communication.  If I am understanding you correctly, you have a network based in LIN and are trying to get information from some device/ecu?

 

Can you go into what you are reading from?

 

I'll keep looking into that error though.  It is interesting that there is no documentation on the error code.

 

 

-Bear

Regards,

Ben Johnson
ʕง•ᴥ•ʔง
0 Kudos
Message 2 of 4
(4,414 Views)

There isn't any error that I see. Bits 3:2 are the Communication State bits. They go from 01 (active) to 10 (inactive), which is documented as "This state indicates that no bus activity has been detected in the past
four seconds." Line 10 is occurring 12 seconds after Line 9 and 12 > 4, so the bus should be inactive.

 

 

0 Kudos
Message 3 of 4
(4,407 Views)

 

@Bear : The setup I have is a loop back connection between PXI 2 port LIN board.

 

 

Yes GPIB_Guru I used "nxLINComm_Get_CommState(communnicationState)" macro in "nixnet.h" file to figure out what that status meant.

 

Thank again for your input.

0 Kudos
Message 4 of 4
(4,399 Views)