As in the subject line, I have a dual port PXI-8513 in a PXIe-1065 chassis. It is replacing a 8461 HS-CAN card. I am writing the new CVI library to support this card but cannot get the library to transmit a CAN frame, standard or extended. There is no activity on the Bus and the cards' LED turns red. The nxWriteFrame function does not return an error.
If I open the Bus Monitor from NIMax, I can transmit frames successfully on the Transmit tab, so I know both drivers and HW are working.
XNET Version 19.0 is installed.
I am creating separate sessions for Tx and Rx. I am using the memory database and setting the baud rate.
My code snippets:
// Create sessions
ErrChk(nxCreateSession (":memory:", "", "", "CAN1", nxMode_FrameOutStream, &g_TxCAN1SessionRef) );
ErrChk(nxCreateSession (":memory:", "", "", "CAN1", nxMode_FrameInStream, &g_RxCAN1SessionRef) );
// Set baud rates
baud = 500000;
ErrChk(nxSetProperty(g_TxCAN1SessionRef, nxPropSession_IntfBaudRate64, (u32)sizeof(u64), &baud) );
ErrChk(nxSetProperty(g_RxCAN1SessionRef, nxPropSession_IntfBaudRate64, (u32)sizeof(u64), &baud) );
// Start Sessions
ErrChk(nxStart(g_TxCAN1SessionRef, 0) );
ErrChk(nxStart(g_RxCAN1SessionRef, 0) );
// Send message
g_Status = nxWriteFrame(nxSession, &Transmit, (u32)sizeof(Transmit), 0);
By my reading of the manual and code sample, this is the proper sequence of function calls.
.