04-03-2009 11:40 PM
Greetings.
Background
In my application I have two devices on the CANBUS: a controller and a USB-8473. The controller communicates using a query / repsonse protocol: my application sends a query or command frame; the device responds. The protocol requires several query / response exchanges to get the controller into a particular mode. If a failure occurs, the program sends a reset frame to the controller and starts over from the beginning.
Observations
From what I can tell, when a frame is passed to the NICAN API to be written to the CANBUS, the API continues indefinately trying to write the frame until it succeeds.
Question
To start over, the program needs to clear the pending frame. To clear the pending frame, I did this...
ncAction( fHandle, NC_OP_RESET, 0 )
Is this the best choice? Is there another method to flush the pending frame (flush the write queue)?
Thank you,
Brian
Solved! Go to Solution.
04-06-2009 08:53 AM
Brian,
The current way you are doing this flush, ncAction with the Reset opcode, is recommended. Is there some reason you are looking to use a different function?
Regards,
Ben
04-06-2009 01:53 PM
Ben,
Thank you for the reply.
I'm looking for something different because ncAction / Reset clears everything including the baud rate and the error counts.
Brian
04-07-2009 09:39 AM
ncAction with the Reset opcode is going to be your only option for clearing the Write Queue of your USB CAN interface. I will make the suggestion to our R&D department that in some situations it would be useful to have something like an ncAction / Flush instead of the full Reset.
Regards,
Ben
04-07-2009 12:56 PM
Thank you and I hope you have a good day,
Brian