We are using NI CAN Card and for the scripting side, we make use of the NI CAN inbuilt function ncRead to read the data from the NI CAN Card. We application software is sending the data packet at the rate of 40 ms. we are trying to read the data after 145ms, to ensure that the data is consistent. But we observe that there is a lag in the data. i.e. the software is sending the packet at the thrid time, but it is receiving only in the fourth time. Moreover, we tried using the ncWaitForState function also, but it was of no help.
What NI CAN card are you using? Also, what other CAN device are you communicating with using this CAN card?
Can you describe in more detail what you mean when you say there is a lag in the data? How long is the lag in the data, and is it just an offset or does it read too slowly for the rate data is coming in (and therefore fall behind)?
Finally, have you tried using some of the examples in the example finder? (Help --> Find Examples --> Hardware Input and Output --> CAN --> NI-CAN)
Product Support Engineer | NI-RIO R&D | National Instruments