Need help about a communication function

You need to run something like hyper terminal to take what is coming from the serial port of the arduino and dump it as a text file on the PC.

Otherwise you can write a program in some language like processing to do this.