Discussion:
how do I write CAN data to a tab delimited file efficently?
(too old to reply)
pmsl
2007-02-13 13:10:10 UTC
Permalink
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.


Read GPS.vi:
http://forums.ni.com/attachments/ni/30/2399/1/Read GPS.vi
DirkW
2007-02-13 14:40:13 UTC
Permalink
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

Loading...