Go to Post Gotta love the blurred robots :cool: - Steven Donow [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2004, 23:19
JoshJ JoshJ is offline
Registered User
#0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Salem County
Posts: 44
JoshJ is on a distinguished road
Send a message via AIM to JoshJ
Writing to Files

Ive been looking at all the stuff of EEPROM, and i dont think its gonna suit for what i want to do (not to mention we cant seem to get it to work). The other programmer on my team suggested writing to a file, say .txt, so that we could atleast copy and paste all our info. Is this any faster than EEPROM, and can it handle writing twice during each user_routine loop? Also can/ how do we do this with this compiler? If we cant, any other (simpler) suggestions? Thanks
  #2   Spotlight this post!  
Unread 29-01-2004, 23:24
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Writing to Files

Quote:
Originally Posted by JoshJ
Ive been looking at all the stuff of EEPROM, and i dont think its gonna suit for what i want to do (not to mention we cant seem to get it to work). The other programmer on my team suggested writing to a file, say .txt, so that we could atleast copy and paste all our info. Is this any faster than EEPROM, and can it handle writing twice during each user_routine loop? Also can/ how do we do this with this compiler? If we cant, any other (simpler) suggestions? Thanks
Umm could you please be a little clearer? There are no files on the RC.
Perhaps you could explain what it is you are trying to do.
__________________
1139 Alumni

Last edited by Rickertsen2 : 29-01-2004 at 23:27.
  #3   Spotlight this post!  
Unread 29-01-2004, 23:30
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Writing to Files

Quote:
Originally Posted by JoshJ
Ive been looking at all the stuff of EEPROM, and i dont think its gonna suit for what i want to do (not to mention we cant seem to get it to work). The other programmer on my team suggested writing to a file, say .txt, so that we could atleast copy and paste all our info. Is this any faster than EEPROM, and can it handle writing twice during each user_routine loop? Also can/ how do we do this with this compiler? If we cant, any other (simpler) suggestions? Thanks
Like Rickertsen said, there are no files on the robot controller, because there is no filesystem. EEPROM or FLASH are your only options for storing data when the RC is off. Both are fairly slow and both only allow a finite number of writes to a particular section, so you should not be writing to them every loop or anything like that. If you need to store off some data, you should probably only do it when a button is pushed by the driver or something.
  #4   Spotlight this post!  
Unread 29-01-2004, 23:31
WillyC's Avatar
WillyC WillyC is offline
"handy"
#1347
Team Role: Engineer
 
Join Date: Jan 2004
Location: Ottawa, Canada
Posts: 29
WillyC is on a distinguished road
Re: Writing to Files

Good idea, but if I'm not mistaken you'll have some trouble writing to a file from the C code in the robot. This is because the robot controller (microprocessor) doesn't even have a file system - "files" can't even exist within this processor. EEPROM is your best bet if you want to store something to memory and have it persist through a power cycle/reset. There are a few good threads on here about writing and reading with the EEPROM, and I'm sure a lot of people will answer any EEPROM-related questions you have. And on that note, here's a question for you guys: how do I insert a link to another thread into my post????
  #5   Spotlight this post!  
Unread 29-01-2004, 23:38
JoshJ JoshJ is offline
Registered User
#0316 (LuNaTeCs)
Team Role: College Student
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Salem County
Posts: 44
JoshJ is on a distinguished road
Send a message via AIM to JoshJ
Re: Writing to Files

What i was trying to do was write to a file on the PC, while the robot is tethered (instead of printf to a screen, output to a file). I understand that there is no place for it on the RC, except EEPROM and whatnot. We've just had problems with EEPROM, with trying to retrieve data, and we're not quite sure how to shift hex storage locations and all the other stuff that comes with using EEPROMs. Any more help would be appreciated, thanks again.
  #6   Spotlight this post!  
Unread 29-01-2004, 23:46
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Writing to Files

your best bet would be to find a dashboard program with logging/save capabilities - there are no functions to write to files, only whatever functionality the dashboard/output window provides.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #7   Spotlight this post!  
Unread 29-01-2004, 23:47
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: Writing to Files

Quote:
Originally Posted by JoshJ
What i was trying to do was write to a file on the PC, while the robot is tethered (instead of printf to a screen, output to a file). I understand that there is no place for it on the RC, except EEPROM and whatnot. We've just had problems with EEPROM, with trying to retrieve data, and we're not quite sure how to shift hex storage locations and all the other stuff that comes with using EEPROMs. Any more help would be appreciated, thanks again.
So you are tryign to write files on the computer from the RC? You will need to write a seperate program to do this. For information on coding for your PC's serial port search MSDN for info on MS COMM control.

Ok wait... besides using hyperterminal, you might want to look into a program called "Stamp Plot pro" It allows you to set up a GUI with all sorts of nifty graphs, text boxes etc to display seria lport input. It can save to files.
__________________
1139 Alumni

Last edited by Rickertsen2 : 29-01-2004 at 23:53.
  #8   Spotlight this post!  
Unread 29-01-2004, 23:47
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Writing to Files

Quote:
Originally Posted by WillyC
And on that note, here's a question for you guys: how do I insert a link to another thread into my post????
see the "Reply" button in the lower-right corner of every post? click that, and it will automatically open a reply window with the contents of that post quoted in it.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #9   Spotlight this post!  
Unread 29-01-2004, 23:48
WillyC's Avatar
WillyC WillyC is offline
"handy"
#1347
Team Role: Engineer
 
Join Date: Jan 2004
Location: Ottawa, Canada
Posts: 29
WillyC is on a distinguished road
Re: Writing to Files

Quote:
Originally Posted by JoshJ
What i was trying to do was write to a file on the PC, while the robot is tethered (instead of printf to a screen, output to a file). I understand that there is no place for it on the RC, except EEPROM and whatnot. We've just had problems with EEPROM, with trying to retrieve data, and we're not quite sure how to shift hex storage locations and all the other stuff that comes with using EEPROMs. Any more help would be appreciated, thanks again.
Ok, I see what you mean. How about this? Use the HyperTerminal program on your PC to capture the printf'd output from the robot (on a Windows-based PC it's at Start-Programs-Accessories-Hyperterminal). HyperTerminal has a logging function that lets you make a log file (.txt or .log) of all the text it captures. Just be careful that you "Disconnect" Hyperterminal before you try to use IFI loader to put a new load into the robot, because Hyperterminal blocks the serial port. After dumping a new load into the robot using the IFI loader, you can "Connect" to the robot from Hyperterminal again.
  #10   Spotlight this post!  
Unread 29-01-2004, 23:50
WillyC's Avatar
WillyC WillyC is offline
"handy"
#1347
Team Role: Engineer
 
Join Date: Jan 2004
Location: Ottawa, Canada
Posts: 29
WillyC is on a distinguished road
Re: Writing to Files

Quote:
Originally Posted by deltacoder1020
see the "Reply" button in the lower-right corner of every post? click that, and it will automatically open a reply window with the contents of that post quoted in it.
Cool, thanks. I figured this much out. But how do I put an inline link (like a hyperlink) into my post, that will let the reader link to another thread?
  #11   Spotlight this post!  
Unread 29-01-2004, 23:52
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Writing to Files

Quote:
Originally Posted by WillyC
Cool, thanks. I figured this much out. But how do I put an inline link (like a hyperlink) into my post, that will let the reader link to another thread?
See here:
http://www.chiefdelphi.com/forums/misc.php?do=bbcode

Also, any URL that you put in your post is automatically made into a link, as long as it begins in http:// or www. - this can be turned off by unchecking the "Automatically parse links in test" box below the reply form.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #12   Spotlight this post!  
Unread 30-01-2004, 14:06
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Writing to Files

Quote:
Originally Posted by JoshJ
What i was trying to do was write to a file on the PC, while the robot is tethered (instead of printf to a screen, output to a file). I understand that there is no place for it on the RC, except EEPROM and whatnot. We've just had problems with EEPROM, with trying to retrieve data, and we're not quite sure how to shift hex storage locations and all the other stuff that comes with using EEPROMs. Any more help would be appreciated, thanks again.
Write a program that takes the printf() transmissions and logs them in a file. Like he said, VB (or VBA if your desperate) and MSCOMM should do the trick. I have a feeling (don't quote me on this) that if you set it to text mode, the receive buffer should be whatever is sent. But I haven't tested this hunch (yet).
  #13   Spotlight this post!  
Unread 30-01-2004, 14:57
WillyC's Avatar
WillyC WillyC is offline
"handy"
#1347
Team Role: Engineer
 
Join Date: Jan 2004
Location: Ottawa, Canada
Posts: 29
WillyC is on a distinguished road
Re: Writing to Files

Quote:
Originally Posted by Astronouth7303
Write a program that takes the printf() transmissions and logs them in a file. Like he said, VB (or VBA if your desperate) and MSCOMM should do the trick. I have a feeling (don't quote me on this) that if you set it to text mode, the receive buffer should be whatever is sent. But I haven't tested this hunch (yet).
You could do this, and it would work well I'm sure. But the super-easy, no programming, no fuss way to just log all the printf's is to use the HyperTerminal program and get it to log the session. Hyperterminal is already installed on your machine and it's easy to use, so if all you want to do is make log files of your printf's, this is the easiest way, I believe. Try it out and let me know if you need help with it...
  #14   Spotlight this post!  
Unread 30-01-2004, 14:59
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Writing to Files

I would, but I don't have anything with me. I will, however, try to write a program to do exlusively that.

[edit]
UPDATE:
I wrote v.1 already. See attachment. If you need DLL's, pm me. (the install is at least 2 mB)
[/edit]
Attached Files
File Type: zip COMM_Logger.zip (6.5 KB, 47 views)

Last edited by Astronouth7303 : 30-01-2004 at 22:32.
  #15   Spotlight this post!  
Unread 30-01-2004, 15:16
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Writing to Files

There is a program available at members.cox.net/seanwitte that works sort of like a bi-directional dashboard. You can send 8 bytes, 6 16-bit signed integers, and 16 binary values back to the PC. The PC sends 8 bytes and 8 digital values to the RC. It will capture, plot, and save up to 10 of the IO values at once. This will not work if you have any printfs in your code.

Install the EDUController application (windows only). Grab pc_interface.h and pc_interface.c from the MPLAB project on the web site above and add them to your project. Heres how you would use it:

1) Add #include "pc_interface.h" to the top of user_routines.c
2) Call function "InitializePCInterface()" at the end of User_Initialization().
3) Call function "SendReceivePCData()" from Process_Data_From_Master_uP, right before the call to Putdata().

Now, whenever you set the values of the aliases in pc_interface.h those values will be sent to the EDUController application. To verify, try adding the line "sensor1 = 116;" to Default_Routine(). Make sure the RC is running and start the EDUController program. Select the correct COM port, and click Open. You should see the value for Analog Input 1 change to 116. The rest of the controls are pretty self explanatory. The connection is closed automatically when you stop a capture.
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
**IMPORTANT FIRST EMAIL**/DXF files posted on FIRST website miketwalker FIRST E-Mail Blast Archive 0 19-01-2004 19:53
tga files for animation LizJJury General Forum 1 15-02-2003 16:36
VKOP igs files JeffO Inventor 0 15-01-2003 20:37
Multiple files usage punarhero Programming 2 12-01-2003 11:45
writing contest Ken Leung General Forum 10 15-12-2002 16:15


All times are GMT -5. The time now is 23:59.

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