02-21-2008 07:27 AM
Im trying to get a signal from a car CAN bus. The first few time I run my labview programme it works fine. However, after a while I get the above CAN read error and this description/solution:
"The data returned from this Read matches the data returned
from the previous call to Read. Solutions: If you merely want
the most recent data, ignore this warning; If you are using the
NI-CAN Frame API or NI-DNET, you can Wait for the Read
Avail state prior to calling Read."
The description makes sense as its likely the data returned from this read is equal to that returned from the last read. But I cant just ignore the warning as I'm now getting a readout of zero. I'm using the NI-CAN channel API so the Frame information doesnt help either. Is there any way I can progamme some sort of reset for every time I run? Or is there some other solution?
Many thanks, Tom.
03-03-2008 03:08 AM
03-03-2008 04:47 AM
03-03-2008 08:32 AM
The Channel API read as different modes. If you configure the read for "Input" it samples the incomming data frames with the sample rate you specified. If the sample rate is zero, it updates the values whernever the read is called.
If no Frame has arrived yet after you started the VI, the driver takes the default value specified within MAX or your db file for the channel. Thats most likely zero, but configurable. The driver updates the channel value when the next Frame arrives.
If you would like to update your value only when a Frame arrives, you could use the "timestamped Input" mode. This mode only reads values when a Frame arrives or the Read gets executed and the sample rate is ignored.
DirkW