Go to Post As my boy Macklemore once said, "The greats weren't great because at birth they could paint, the greats were great because they paint a lot". - Andrew_L [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2011, 16:51
AB Steven AB Steven is offline
Registered User
FRC #0245
 
Join Date: Jan 2011
Location: Michigan
Posts: 15
AB Steven is an unknown quantity at this point
Saving Text to a File on cRIO

Does anyone know how to do it? The labview sample isn't working for me, and mine doesn't work either, Google just turns up getting started with labview pdfs from FRIST that don't explain this. Here is what I have right now.

"test" and "text" are both files I created on the cRIO. The "text" one is the example with a constant file path instead of the default variable one. The "test" version was the one I made. They both have the extension .txt and I've tried with and without the extension in the file path.
Thanks in advance,
Steven
Reply With Quote
  #2   Spotlight this post!  
Unread 26-01-2011, 17:37
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Saving Text to a File on cRIO

I use c:\test.txt for the path.
Reply With Quote
  #3   Spotlight this post!  
Unread 26-01-2011, 17:45
AB Steven AB Steven is offline
Registered User
FRC #0245
 
Join Date: Jan 2011
Location: Michigan
Posts: 15
AB Steven is an unknown quantity at this point
Re: Saving Text to a File on cRIO

I put a copy of each at C:\ on my computer, it didn't write to it. Our cRIO's directory is just / so "text.txt" would be /text.txt not C:\text.txt, at least I think so
Reply With Quote
  #4   Spotlight this post!  
Unread 26-01-2011, 18:08
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Saving Text to a File on cRIO

Here's an example of creating/opening/saving a file on the PC side.

I want to double check the cRIO version, because I haven't done it in awhile.
The file path is the only tricky part. Try out Joe's suggestion.
Attached Thumbnails
Click image for larger version

Name:	ASCII_data-file.jpg
Views:	69
Size:	50.4 KB
ID:	9832  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #5   Spotlight this post!  
Unread 26-01-2011, 18:35
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Saving Text to a File on cRIO

Quote:
Originally Posted by AB Steven View Post
I put a copy of each at C:\ on my computer, it didn't write to it. Our cRIO's directory is just / so "text.txt" would be /text.txt not C:\text.txt, at least I think so
When the robot program runs and sees c:\ it puts on the root directory of the cRIO, not your computer.
Reply With Quote
  #6   Spotlight this post!  
Unread 27-01-2011, 10:58
Omar's Avatar
Omar Omar is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Huntsville, AL
Posts: 122
Omar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of light
Re: Saving Text to a File on cRIO

Joe is right and if you want to get the file from the cRIO you will have to use FTP to get it from the cRIO to your computer.

Another option is to send the data with the dash board data and capture it there.

Omar
__________________
Omar
Reply With Quote
  #7   Spotlight this post!  
Unread 27-01-2011, 15:48
AB Steven AB Steven is offline
Registered User
FRC #0245
 
Join Date: Jan 2011
Location: Michigan
Posts: 15
AB Steven is an unknown quantity at this point
Re: Saving Text to a File on cRIO

Ok I checked the cRIO again and pointing labview to C:\ did work. Thanks guys! I got the spreadsheet writer working, but only a one column deal, does anyone know how to get it into two columns?

Last edited by AB Steven : 27-01-2011 at 16:27.
Reply With Quote
  #8   Spotlight this post!  
Unread 27-01-2011, 16:29
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Saving Text to a File on cRIO

Quote:
Originally Posted by AB Steven View Post
Ok I checked the cRIO again and pointing labview to C:\ did work. Thanks guys! I got the spreadsheet writer working, but only a one column deal, does anyone know how to get it into two columns?
Write a CSV text file. Excel can open that directly if you associate the file extension.


Reply With Quote
  #9   Spotlight this post!  
Unread 27-01-2011, 17:44
AB Steven AB Steven is offline
Registered User
FRC #0245
 
Join Date: Jan 2011
Location: Michigan
Posts: 15
AB Steven is an unknown quantity at this point
Re: Saving Text to a File on cRIO

I can get what I'm writing into Excel just fine, but I can only write one variable to the file. For example one potentiometer is at 70 the other at 450, I can only write the 70 or the 450 not both with a comma or some such thing in between. Currently I get it to write one number per line for example:
70
71
72
70
65
68
So that is keeping track of one potentiometer. I want both in one like this:
70,450
71,451
72,452
70,450
65,445
68,468
That would be potentiometer1,potentiometer2. Hope that helps, here is what I have right now.
Reply With Quote
  #10   Spotlight this post!  
Unread 27-01-2011, 18:09
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Saving Text to a File on cRIO

Quote:
Originally Posted by AB Steven View Post
I can get what I'm writing into Excel just fine, but I can only write one variable to the file. For example one potentiometer is at 70 the other at 450, I can only write the 70 or the 450 not both with a comma or some such thing in between. Currently I get it to write one number per line for example:
70
71
72
70
65
68
So that is keeping track of one potentiometer. I want both in one like this:
70,450
71,451
72,452
70,450
65,445
68,468
That would be potentiometer1,potentiometer2. Hope that helps, here is what I have right now.
I'm not a LabVIEW guru so I can only speculate:

Does LabVIEW have a function analogous to printf? If so use that to write both variables in one operation to one line in the file.

or...

Does the LabVIEW file output function you are using have an option to allow you to suppress the newline? If so, write the first variable without the newline, write the comma without the newline, and finally write the second variable with the newline.


Reply With Quote
  #11   Spotlight this post!  
Unread 27-01-2011, 18:27
AB Steven AB Steven is offline
Registered User
FRC #0245
 
Join Date: Jan 2011
Location: Michigan
Posts: 15
AB Steven is an unknown quantity at this point
Re: Saving Text to a File on cRIO

I got it working, hers a picture of how. Thanks for the help guys.
Reply With Quote
  #12   Spotlight this post!  
Unread 27-01-2011, 21:27
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Saving Text to a File on cRIO

Quote:
Originally Posted by Ether View Post
Does LabVIEW have a function analogous to printf?
Indeed it does. It's the Format Into String function.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi