Print to log file

Is there a way to put the information from a print into a log file?

Yes i would like to know the same thing, that way i could graph information in excel.

Then i could see the speed to time ratio of a robot/acceleration.

Like a DataLog…

Yea, i want to be able to output it to a file like .doc, .pdf ect…

Or the basic notepad format

There has to be a way, even copy and pasting would work for me.

It would be nicer to not cut and paste since I can do that now! :smiley: I made a macro program that takes the data info and puts into an excel, but something easier and more reliable would be better.

Hey could you pm that code?

I am getting into programming but i have not reached the level where i can make programs like that yet.

How did you copy and paste the data?

Actually I didn’t take the time to program it but got a demo of the Internet of Workspace Macro 4.6 and set it up from there…

Anyone know of any C programming that can do this?

Interesting… I’ll have to try that right now. You may be able to use fprintf (same as printf, but to a file)…

I’m testing it right now, I’ll report in a minute…

EDIT #1: no function for opening a file, which is kinda weird, since fprintf does exist…

EDIT #2: well, that’s a duh! I’m trying to store the values on the computer… that won’t work! hmm…

EDIT #3: well, I’m at a loss… If you could figure how the printtoscreen function works (ie how it interfaces with the computer) you may be able to get fprintf to work… But this is the ramblings of a not-so-techy person, so take this with a grain of salt

If you are talking about the statements you see in the Terminal Window, you only need to close the Terminal Window and open a Communication Program like HyperTerminal or TeraTerm or such and create a log file that way…

I got teratrem but it does not display data correctly, it is the ultrasonic test program and i set it and it displays ultrasonic = and then a bunch of random numbers.

Does anyone know how to set it up correctly?

I did a bunch of this for my project earlier this year. If you are using a windows based computer, hyperterminal worked for me. I’m not too clear on the ultrasonic test code, but if you just created like a for loop to increment a variable and use a printf statement to print it to the screen i bet it would work all right. I was able to capture a bunch of data off a gps and was capable of capturing data from the vex too. I printed a bunch of data and it all came out correctly.
Try a dummy program with printfs just to see what it does.
Now what I would like to see is the capacity to write files internally and send files to the computer later with some sort of command. That would be awesome because then you could get test data and monitor the robot’s performance ect.
VEXCAPTURE.txt (7.6 KB)
CAPTURE.TXT (2.26 KB)

When I did that hyperterminal was picking up data but it was just showing a few random symbols. What were the properties that you set up the connection to get it to work?

This is what it looks like:
test1.TXT (678 Bytes)

I got it to work using 115200 Baud, 8 Data Bits and 1 Stop Bit

This is what it looks like when you capture the text:
test2.TXT (2.07 KB)

What are the squares in the data? did you print that?

The squares in the data are what it signifies to separate the data. That is easy to change or take out and it really helps.

By the way, if you are running Vista you don’t have hyperterminal.

I see.
i think that is a dissapointment for vista is supposed to be the all powerful connections os. there might be a way to do it at the command line interface. The IFI loader also comes with a terminal window that works except you can’t save data collected from the stupid thing inconvinent… you certainly also could write your own program to get a handle on the com port and save to a file, but that’s truly inconvenient.

I dislike vista, the kernel takes up 700mb of ram min and then your programs push it over 1.5gb of used ram leaving little for gaming ect…

Unless you have a pc like mine with 8gb of ram it can run slow sometimes, i don’t see why company’s put vista on laptops with 512mb of ram lol! It takes really long to boot up.

On another note how do you separate the data on differnt lines in hyper terminal.

If you cannot separate them then i would think hyper terminal is not that great, my brother programmed a really good program for monitoring a charging unit from a serial port.

It would show you the charge of the capacitors and graph it for you and then when it reached full it would alert you.

That program can be modified to save the data from the vex into a file, if i can get mod it then i will post the software for free as it can be an valuable tool for everyone.

But in the mean time does anyone know how to get hyper terminal to separate the data in the log?

you need to use a new line character “\n” in your prinf statement. At least that’s all you should have to do or it’s an option under hyperterminal. It’s under properties the settings tab ASCII Setup button and on the recieving box, it says append line feeds to incoming line ends check that box and you should be set.
I’m running vista on my laptop and it drains the battery rly fast or makes the computer uber hot cause of how much ram it uses. It seems like they want to make you buy more ram or something… it’s like a conspiracy

Thanks a lot! I got it to work and it gave me flawless data from a limit switch.

It was nice and spaced with 1’s and 0’s with no weird symbols, now i am going to put a timer side by side with a limit switch to see if i can have 2 or more variables printed at the same time.

I will post my results in a couple of minutes.