OS win98; Programming language: BorlandC 3.1 How could i connect buffered bidirectional stream with COM1 fgets function returns NULL pointer My code: #define COM1 0x3F8 ... FILE *port; char buffer[BUFSIZ]; int num; port=fopen(COM1,"w+b"); setbuf(port,buffer); num=fprintf(port,"%s","*IDN?"); fgets(buffer, sizeof(buffer),port); printf("Send bytes=%d, buffer=%s",num,buffer); //Send bytes=5, buffer="*IDN?" if it work propely in buffer should be oscilloscope answer: serial number, manufacture Ginatre