Computer Engineers

 
Home | Computer engineering other top | Fiber / Wireless / Copper Tran | Semiconductor engineering
  Position:HOME>Programming language engineeri>Article Content
Serial port programming
Source:Internet Author:Unknow Pubdate:2008-04-14  
Hermit (Electrical) 18 Oct 02 22:08
Hello, I would like to know how to write a programme to
send\receive files over the serial\COM port and which
programming language would be most suitable?

As of now, I'm able write a program to send and receive
characters through the port using a C++ compiler. However,
even after gathering enough info from the help files and
websites to get this far, I still couldn't find anything
on sending files. = \

Anyhow, I would appreciate any info anyone can offer.

Thanks.


DH.

nbucska (Electrical) 19 Oct 02 16:13
I suggest use the ASCII "0" character to mark the end of file.

i=0;
While (b=file[i++] < 0)  {send(b); );
i=0;
while (b=receive()>0 ) ( data(i++)=b; );
<nbucska@pcperipherals.com>
字串8
Hermit (Electrical) 20 Oct 02 1:54
Right now I'm having a problem reading large files.
My program is only reading around 50k of the file. So my
question is if theres a method of reading large files into
the buffer, or am I just using the wrong commands?


Hermit (Electrical) 20 Oct 02 22:59
Ok, I 'think' I solved my first file problem; however, I
still can't tell it where the EOF is located.

I'm sending the file in binary mode, therfore, what can I
send in binary over the COM that the other computer can
interpret as an EOF command?

Btw, I tried the ASCII '0' suggestion. I'm not sure if I
was doing it correctly, but it kept cutting the file short.
= \



(Click:

Previous:Which programming application?   Next:VB : Problem with loops
[Add TO Favorites] [TOP] [PRINT] [CLOCE WINDOWS]  
  Hot Article
·PIC code for triac light dimme
·Connecting a Footswitch to an
·Siemens s7-200 PLC & Visua
·TETRIS source code is availabl
·XML Files and Terramodel
·controlling GPIB from VBA
·LINKING MSC PATRAN WITH INTRAN
·How to interface RS-485 / Modb
·VBA WITH AB PLC
·SIEMENS: I/O, NCDDE AND DCTL
·getch() function
·Visual Basic Serial Comms To S
  Related Articles
·VB : Problem with loops
·Can an MSFlexGrid be used with
·How to transfer data through P
·generate exe-files, crowded wi
·Import C to MatLab
·COMport programming
·Modem programming
·random numbers
·Topmost VB form name - active
·WellFlo data file structure/la
·Floting point
·Hide Rows Macro in Excel
Power by DedeCms