Dear,
I have the following situation. Sometimes it happens that my application ends up in a state where frames sent will not end up on the bus, but only be visible in the PCANView application I open in parallel to check. I usually reach that state when devices restart, so it could be related to e.g. a BUSOFF event.
The confirmation that the frames do not end up on the bus is from two further interfaces connected to the bus, one Vector and one additional PCAN interface.
My app does call uninitialize and, since I run from the debugger, I do take care to exit the debugger by issuing Environment.Exit(0); on closing of the window.
The only way for me to get out of this state and have the interface working properly again, is to unplug it from USB, replug it and restart my app.
The PCAN USB interfaces are all FW 8.6.1.
Thank you for your suggestions
Best regards
Julian
Frames sent by app occasionally are only visible in PCANView, but not on bus
-
- Posts: 10
- Joined: Tue 10. Aug 2021, 13:39
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Frames sent by app occasionally are only visible in PCANView, but not on bus
That sounds like your application have send out some CAN Frames and before it was able to send (and also get the ACK from all others on the BUS) the Network goes of (maybe other nodes are powered off, disconnecting the CAN cable etc.) The last CAN Frame is still in the physical outgoing buffer on the CAN Device.
It was send out by the Software, via the Device Driver to the Device itself. That is why the local used PCAN-View on the same HW will see that frame as send, but the two other, real physical devices, do not receive it. Have you try to make a CAN_Reset(..) and also have set the PCAN_HARD_RESET_STATUS up in front to active:
It was send out by the Software, via the Device Driver to the Device itself. That is why the local used PCAN-View on the same HW will see that frame as send, but the two other, real physical devices, do not receive it. Have you try to make a CAN_Reset(..) and also have set the PCAN_HARD_RESET_STATUS up in front to active:
When "PCAN_HARD_RESET_STATUS" is active (ON), any call to CAN_Reset (class-methods: Reset) will additionally perform a hardware reset. Otherwise, calls to CAN_Reset (class-methods: Reset) will only empty the send and reception queues of the PCAN-Channel.
- Attachments
-
- CAN-Reset.jpg (138.2 KiB) Viewed 7382 times
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
-
- Posts: 10
- Joined: Tue 10. Aug 2021, 13:39
Re: Frames sent by app occasionally are only visible in PCANView, but not on bus
Dear,
thanks, that sounds promising. That explains my feeling that having the PCANView open plays a role in this (referring to the uninitialize/inizialize cycle mentioned in the help text here). I have some follow-up questions:
thanks, that sounds promising. That explains my feeling that having the PCANView open plays a role in this (referring to the uninitialize/inizialize cycle mentioned in the help text here). I have some follow-up questions:
- At which point may I call SetValue? May it be before Initialize? Or after? Or both as long as it comes before the Reset call it aims to alter?
- PS: Ok, found the document that describes the required initialisation status. In my case, channel has to be initialized. For reference, here the document: https://www.peak-system.com/produktcd/D ... tation.pdf
- Would PCAN_BUSOFF_AUTORESET also fix my issue in this instance?
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Frames sent by app occasionally are only visible in PCANView, but not on bus
Yes, for sure. The PCAN-BUSOFF-AUTORESET does automatically bring back the Device in BUS-On State if it goes BUS-Off but if the BUS-Off Problem still exist (for example short cut etc.) - it runs in Cycles
The SetValue of the PCAN_HARD_RESET_STATUS and also of the PCAN-BUSOFF-AUTORESET should be done after the CAN Channel is initialized successfully.
In the PCAN-Basic Package you find a separate Document that explain in Detail this extra Parameters (incl. sample code !).
See page 43+ of the "PCAN-Parameter_Documentation.pdf" for the PCAN-BUSOFF-AUTORESET and page 50+ for the PCAN_HARD_RESET_STATUS
The SetValue of the PCAN_HARD_RESET_STATUS and also of the PCAN-BUSOFF-AUTORESET should be done after the CAN Channel is initialized successfully.
In the PCAN-Basic Package you find a separate Document that explain in Detail this extra Parameters (incl. sample code !).
See page 43+ of the "PCAN-Parameter_Documentation.pdf" for the PCAN-BUSOFF-AUTORESET and page 50+ for the PCAN_HARD_RESET_STATUS
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
-
- Posts: 10
- Joined: Tue 10. Aug 2021, 13:39
Re: Frames sent by app occasionally are only visible in PCANView, but not on bus
Perfect, will do, thank you.