Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Using ncAction with NC_OP_RESET for flush on CAN objects?

I know that there is no flush API function in NI-CAN, and that one should use ncAction with op-code reset instead.

However, the manual states that this can only be done for a network object, and that a ncAction/NC_OP_RESET performed on a network object propagates up to all open associated CAN objects, which may not be what one wants to do.

According to the manual, it shall not be possible to perform ncAction/NC_OP_RESET directly on a CAN object (using a CAN object handle). But what if this is exactly what I would like to do?

I want to clear the Tx and Rx queues for a specific CAN object, leaving the other objects unaffected.

Is there a way for me to do this? Can I perform a ncReset/NC_OP_RESET on a
single CAN object?

Thank you in advance for your answer.
0 Kudos
Message 1 of 2
(3,424 Views)
The Rx buffer can be cleared very easily.
1) Read the number of messages in the buffer with ncGetAttribute.vi with AttrID set to Read Entries Pending
2) Read all the messages at once with ncReadObjMult.vi

For the Tx buffer :
1) Stop the sending of new messages
2) Wait until the buffer is empty (GetAttribute.vi with AttrID set to Write Entries Pending).
0 Kudos
Message 2 of 2
(3,424 Views)