07-30-2024 09:07 AM
I have a VI (while loop) that reads an XNET session from my CAN bus. Due to EMC problems, sometimes the sending device freezes. Consequently, the displayed values in LabView don't change anymore. They remain constant.
How can I detect if my cRIO is still receiving signals from this XNET session?
07-30-2024 09:37 AM
If your session type is Signal, then you can do something like I've shown in this blog post where there is a Trigger signal that resets a timer. If the timer expires the values goes to NaN.
https://hooovahh.blogspot.com/2018/07/can-part-11-xnet-signal-drop-out-and.html
You can also have additional session types and have one be reading the raw frames. If there are no frames, then there is no new CAN values.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-31-2024 06:56 AM
First of all, thank you so much, this is exactly what I was looking for. It also work nicely if executed alone.
Unfortunately, I can't get it running with my CAN_READ loop (see screenshot). Error: "You tried to open the same frame twice. This is not permitted. Solution: Open each frame only once."
I partially understand the problem but can't figure out how to solve it.
07-31-2024 09:06 AM - edited 07-31-2024 09:11 AM
I managed to somehow merge the two loops together, see picture. However, I'm getting error -1074384589 from XNET Create Session.vi: NI-XNET: (Hex 0xBFF63133) "A cluster with the same name already exists in the database. Solution: Use another name for this cluster."
I had to use XNET Clear before XNET Create Session. The reason is that I need the initial XNET session from the left in the block diagram to extract the list of signals. Then, I reassemble the signal list. As I can't re-write this new signal list into the initial session, I try to create a new one. Not sure if this is the best approach.
07-31-2024 06:58 PM
Instead of using two Signal Input sessions, you can open another Frame Input Stream session that acts like a Bus Monitor. You can use a timeout to poll if there is any traffic on the network. You can even check the ID for the incoming frames to see if they come from the expected device.
NI-XNET Error -1074384878: Maximum Number of Frames Has Been Exceeded
08-01-2024 09:10 AM
This did the trick! I didn't realize that CAN frames include a timestamp while CAN signals don't.
While Hooovahs solution seems possible, I managed to implement your suggestion quite easily. For anyone interested I'll share my implementation. Not sure if my implementation with the many property nodes is the cleanest though.