11-28-2023 10:24 AM
I've attached the VI that I use to write to the bus. When I use the VI by itself, it works every time, but when I include it in a program, it will fail to write about half of the time. I've even tried putting it in a For loop and writing the frame multiple times with a wait in each iteration, but it will still fail. I have Echo enabled, and I've read that the is a built-in function in CAN that will write the frames over and over until a node acknowledges the frame, but this doesn't seem to happen.
In my database I have the transmit frequency set to 100 ms, which matches what it is transmitted at. I also have all of my frame data type set as event (and not cyclic because I could never get that to work).
11-28-2023 10:29 AM
Here is a copy saved for Labview 18.0.
11-28-2023 10:39 AM
Also, another thing that I just noticed is that everything works just fine with writing to the bus when I have the bus monitor open using the same CAN interface.
11-28-2023 10:45 AM
Try to debug with NI-XNET Bus Monitor
Enable Bus Error Frames and see if there are any error frames.
NI-XNET Troubleshooting Guide is useful as well.
11-28-2023 11:59 AM
Ok, so apparently this was a simple issue of timing. I added 1 second waits between the create session, write frame, and XNET Clear.