LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Read data from a CSV file

hi,
i've managed to make a CSV file which includes logged data of how much my NXT car is turning left(L),right(R) or going straight(S). format is:direction/timer value (L/1922 means it went to left for 1922 ms).
where i got stuck is how can i read those time and direction values from csv file in such way that those values could be used for the motor move input?
 
Actually what i'm trying to do is severeal VIs which function like record/play action in NXT Toolkit.
 
(i've attached the vi and the csv file, the file extension is CSV but it is not written in csv format 🙂 it's a basic txt file actually )


Message Edited by szemawy on 05-23-2008 10:34 AM
Download All
0 Kudos
Message 1 of 7
(8,839 Views)
any suggestions? :manindifferent:
0 Kudos
Message 2 of 7
(8,808 Views)
First, don't put your code in an infinite while loop.Smiley Wink
 
Take the string and feed it to a Spreadsheet String to array function.  You may have to play with the format codes.  A delimiter of /, format string of %s, and a string constant for array type seem to work.  Then you will have a 2-D array where the first column is the letter, and the 2nd column is the time as a string.  You could convert that string to a number as you index out each element.


Message Edited by Ravens Fan on 05-31-2008 12:36 AM
0 Kudos
Message 3 of 7
(8,778 Views)
thx for the suggestion, i'll try that.
0 Kudos
Message 4 of 7
(8,757 Views)
after i get the data in 1-D array format I cannot convert it to string so that i can send it by write BT message. i tried flatten to string but didnt work out 😞
 
[nevermind the mess, just see the part where the 1-D string is being converted to string]
Download All
0 Kudos
Message 5 of 7
(8,538 Views)

Hi everyone,

 

I wish to export data from a CSV file into a RSS feed. Can someone help me out on this?

0 Kudos
Message 6 of 7
(8,176 Views)

Hi navneet023 -

 

Your question doesn't appear related to LEGO MINDSTORMS NXT.  This board is meant for discussions related to LEGOs and LabVIEW.  Perhaps you meant to post on one of the more general LabVIEW discussion boards?

 

In any case, your question of converting a CSV file into an RSS feed doesn't have a simple answer.  (I'm not aware of a "Convert CSV to RSS" VI.)  I imagine you'll need to use several of LabVIEW's file I/O and string processing functions to acheive your goal.  I would recommend that you try to ask a more specific question on one of the LabVIEW discussion boards.

------
James Blair
NI R&D
Message 7 of 7
(8,166 Views)