09-29-2021 11:49 AM
For this message ID, I have 16 different payloads to rotate through for XNET Write Frame Output.
Initially, I used Event Data timing type and XNET Write with Frame Output Single-Point mode in a while loop that keeps changing the payload.
Every once in a while, loop iterations took much longer than normal and caused a critical error with the DUT.
Now I'm trying to use Cyclic Data timing type and Frame Output Queued mode to avoid using a while loop.
If I simply queue 16 payloads, it will end up sending the last payload repeatedly after the first 15 payloads.
Is there any clean way to rotate through the payloads? After that last one, the first payload should be sent and so on.
Any helpful input would be appreciated.
Solved! Go to Solution.
09-29-2021 12:39 PM
Oh yes, the bucket filling technique. I mentioned this in a blog post Part 9 of my CAN blog. You are on the right track and you do need to use a Frame Output Queued, but you need to write more frames over and over again, making sure the queue doesn't get empty.
Now if you are doing this because you have a counter or CRC that needs to be updated, then I'd suggest you also read Part 10 of my CAN blog. You see XNet hardware has the ability to have code loaded on it, that will modify the frame payload before sending it out. So if you need a counter to go up, or a CRC to be calculated you can have the card do that work for you without needing to constantly fill a bucket with frames to go out.
This technique is not documented, and NI doesn't advertise the feature but the demo code I have in that post should show you how it works, and you can then decide if you want to use this feature or go back to the bucket filling technique which takes more work, is harder to maintain, and uses more system resources but is officially supported.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-29-2021 12:46 PM
Awesome, Hooovahh. Extremely helpful! In fact, I bookmarked your blog a while ago but haven't checked everything yet. Yes, it is for CRC 🙂