This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Write data in file using "fopen( )" in C51 - µVision2

Hello everybody giving a helping hand,

got me some trouble here. I was making a program that reads out the duty cycle of an ADXL202 sensor. Everything works, except the part were i want to print my data in a file using this :

 FILE *stream, *fopen();

                 if ( (stream = fopen(...)) != NULL)
                                 fscanf(stream,''%s'', string);

Ok this is were my problems start. The compiler gives me the error that he doesn't know this type FILE ore the function fopen (). This seems to be logical to me since i looked in my stdio.h header and found nothing really according to that declaration.
Is there a posibility that this is stored in another source file or does not exist???
Or .... how do i get my data's in a *.txt file ???

Thanks for the help i'm about to receive :))

P.S: Im using a 80C535 µC, sorry for not mantuening

Parents
  • "I am using HyperTerminal to comunicate with my µC. And i can see the data he's sending me via serial port but on the terminal window. Now if i want to have this data in a text or in a excel file (even better) i must record the transmision on the terminal."

    That's right - this is a PC question, not a Keil question.

    Hypoterminal can record the received data to a file - see 'Capture Text' on the 'Transfer' menu.

    Or you can write your own PC application to automate the process.

    To do it in Excel, see: www.windmill.co.uk/rs232.html

    Remember: as far as the PC is concerned, it's all just serial data - the fact that it happens to be coming from an 8051 is entirely irrelevant to the PC.

Reply
  • "I am using HyperTerminal to comunicate with my µC. And i can see the data he's sending me via serial port but on the terminal window. Now if i want to have this data in a text or in a excel file (even better) i must record the transmision on the terminal."

    That's right - this is a PC question, not a Keil question.

    Hypoterminal can record the received data to a file - see 'Capture Text' on the 'Transfer' menu.

    Or you can write your own PC application to automate the process.

    To do it in Excel, see: www.windmill.co.uk/rs232.html

    Remember: as far as the PC is concerned, it's all just serial data - the fact that it happens to be coming from an 8051 is entirely irrelevant to the PC.

Children
No data