Quantcast
Channel: NI TestStand topics
Viewing all articles
Browse latest Browse all 6524

USB8506/2

$
0
0

Hello

For an application using C# and USB8506 component with the "nixnet.dll"

I have to send master request frame onto the lin bus and then read the slave response,

to make that i use the sequence bellow

-------------------------------------------------------------------------------------------------------------------------

nxCreateSession("database", "Cluster", "frame0,frame1", LIN0,nxMode_FrameOutStream, m_OutputSessionRef);
nxCreateSession("database", "Cluster", "frame0,frame1", LIN0,nxMode_FrameInStream, m_InputSessionRef);
nxWriteFrame(m_OutputSessionRef, l_OutputBuffer, 24, 0);
nxWriteState(m_OutputSessionRef, nxState_LINDiagnosticScheduleChange, sizeof(uint), nxLINDiagnosticSchedule_MasterReq);
nxWriteState(m_OutputSessionRef, nxState_LINDiagnosticScheduleChange, sizeof(uint), nxLINDiagnosticSchedule_SlaveResp);
nxReadFrame(m_InputSessionRef, l_InputBuffer, 24, 5.0, l_NumBytes);

nxWriteState(m_OutputSessionRef, nxState_LINDiagnosticScheduleChange, sizeof(uint),nxLINDiagnosticSchedule_NULL);
nxWriteState(m_InputSessionRef, nxState_LINDiagnosticScheduleChange, sizeof(uint), nxLINDiagnosticSchedule_NULL);

nxClear(m_OutputSessionRef);
nxClear(m_InputSessionRef);

-------------------------------------------------------------------------------------------------------------------------

 

When I start my application and "NI-MAX" together all is good

but if I stop "NI-MAX" I have no response (nxReadFrame end with error (Hex 0xBFF6300A)).

Where does this problem could come, do we have to use temporisation between the dll function....?

 

 


Viewing all articles
Browse latest Browse all 6524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>