Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I write CAN data to a tab delimited file efficently?

Hello, I'm wondering if someone might be kind enough to help me with a CAN READ and WRITE to TAB DELIMETED file issue. I am trying to read from a GPS device (which produces 100 samples per sec), display the data real time in a graph and write the data that I have recorded using START and STOP buttons. I currently have the TASK READ vi in a while loop with the NUMBER OF SAMPLES TO READ set to 100. I also have in the same while loop a EXPORT WAVEFORMS TO SPREADSHEET FILE. See the vi attached. My questions are: 1. Is this the most effecient way to use the TASK READ vi (ie to read 100 samples at a time)? I notice that when I decrease the NUMBER OF SAMPLES TO READ to say 10, the data displayed in the graph is not current.  How do I know what to choose for this variable? ie How do I ensure that I dont miss out pieces of data? 2. Should I be using the EXPORT WAVEFORMS TO SPREADSHEET FILE to write the data or something else? 3. I notice that the output file contains an exact multiple of the NUMBER OF SAMPLES TO READ.  I'm assuming then that when the STOP button is pressed it does not interupt the the TASK READ vi until all 100 samples are read. Is there any way of stopping the data read exactly when the STOP button is pressed?  Any help you can give me would be much appreciated. Cheers.

0 Kudos
Message 1 of 3
(4,410 Views)

Hi,

The NI CAN driver  2.3 and later brings examples for how to log channel data and replay the data to a graph or to the bus.

Check these examples:   ProgramFiles\National Instruments\LabVIEW 7.1\examples\nican\LoggingPlaybackReplay.llb

DirkW

0 Kudos
Message 2 of 3
(4,406 Views)
0 Kudos
Message 3 of 3
(3,883 Views)