I'm using Labview and X-NET LIN hardware to interface with a DUT. The DUT receives a single "command" frame periodically every 33ms as per definition in a LDF file.
For this command frame, the DUT implements the "AUTOSAR Profile 2 Protocol". That is, the frame not only contains several usual signals, but also an 8bit CRC (yes, in the payload, not the LIN CRC) and a 4bit message counter, which increases from one transmitted frame to the next. After 15 frames, the counter overflows to 0.
It is crucial that the master does not stutter! If counter values are repeated or omitted, the DUT refuses to handle the signals in the frame.
Currently, I calculate the next few payloads, and write them to a queued frame session. This works as expected, but this needs a timed loop which fills the queue for it not to run empty. On the other side, the number of frames in the queue should not be too big, because when new frames with new signal values are to be transmitted, the old frames in the queue will be transmitted, first. But... too few frames in the queue, a moment of high CPU load, and the master stutters...
Is there a more elegant way to solve this?