Access Windows CSV files from a Prop
Phil Pilgrim (PhiPi)
Posts: 23,514
Attached is a project I've been working on for the past week. It's a Propeller object and a companion Windows PC program that allows Propeller programs to read and write CSV files on the PC. The PC program acts as a server for the Propeller program, running as a client via a serial connection (using FullDuplexSerial). With this facility, a Propeller program can create, append to, and read from CSV files on the PC, using strings, integer, fixed-point, and floating-point data. For safety, the files must all be rooted in a named subdirectory of any file device's root directory and not the root directory itself, but the Propeller program can create any number of subdirectories of that directory. (If you happen to choose "c:/Windows/system32" or somesuch, the consequences are your own fault. I bear no responsibility for stupidity. )
Here's a screen capture of the server program in action:
There are only two things to specify: the active directory and the serial port. Once these are specified, the enable button can be pressed and file transfers can begin. Pressing the Enable button will reset the Propeller, so you will need to have your program saved in EEPROM to use this system.
Documentation for the Propeller client object is embedded in the source code and is AutoDoc (Gold Standard) compatible. See this link for access to the AutoDoc facility:
The demo program exercises most of the client's features, and you should read over it, run it, and understand what's going on before writing your own programs.
Questions and comments, as always, are welcome!
-Phil
Here's a screen capture of the server program in action:
There are only two things to specify: the active directory and the serial port. Once these are specified, the enable button can be pressed and file transfers can begin. Pressing the Enable button will reset the Propeller, so you will need to have your program saved in EEPROM to use this system.
Documentation for the Propeller client object is embedded in the source code and is AutoDoc (Gold Standard) compatible. See this link for access to the AutoDoc facility:
The demo program exercises most of the client's features, and you should read over it, run it, and understand what's going on before writing your own programs.
Questions and comments, as always, are welcome!
-Phil
Comments
This is great!
Several times a day I need to access files from my Prop data logger. Normally I move a SD card from the Prop to the PC. This should free me from the need of stopping data collecting in order to transfer information to the PC.
I'll try it out (probably tomorrow) and let you know what I think.
Thanks,
Daune
I have not tested it, but I am sure it works
Anyhow, good job, and I am sure a lot of people will find this useful!
Bruce
OBC
-Phil
I will have to set aside some time to check it out.
Bruce
For some data acquisition projects, this might eliminate the SD card altogether.
Thanks, Phil!
Maybe send the data with a pair of XBees, and call it a day. Boy, this would be nice to have. Will have to archive this stuff, just in case the need arises.
Hi Phil! I am trying to implement your program to modify CSV files on a windows pc and I am having some issues. I am using a propeller demo board connected to my PC using the serial port on the demo board. I have your server program running and when I try to run the client program I keep getting an error of "unable to acess com3", even though my demo board is on and connected to my pc. Would you know why this is happening? Thank you!
You need to make sure the com port setting matches the same port as the one used by the Prop Tool to communicate with your Demo Board.
When you press F7 from the Prop Tool which com port does it use? You'll want to use this same port in Phil's program.
I am using COM3. What I don't understand is that when Phil's server program is running I am unable to detect COM3 which is keeping me from compiling my client program.
Is the server program disabled when you try to compile and load the client? If not, you need to do so first. Two programs cannot claim the serial port at the same time.
-Phil
I should have known that you can't have two programs on the serial port at once. I have the whole thing figured out now. Excellent program. Thank you~
Edit: I ran into an issue that maybe you could help me with Phil. I tried a simple example of just creating a file and everything works fine.
However, when I try to implement it in my program it does not work. In my program everything after the csv.start command seems to not compile. I tried moving around the csv commands within my code to try and get it to work but to no avail. Am I missing something?
The server has to be running and enabled for your program to get past the csv.start.
-Phil
I was looking at AutoDoc website but could not find the AutoDoc Gold Standard specs. Perhaps you might like to place a link on your webpage for this?
For others, here is the link
http://forums.parallax.com/showthread.php/127233-Automatic-Spin-Program-Documenter-(Online-version-now-available)?highlight=autodoc
I have a quick question. Is there any way to insert a carriage return in a CSV file so two sets of data are printed in two separate rows? Something like the following: