Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-03

Re: com port using prolific driver

6 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gene Buckle
to John Lee: I'm trying to get data from a device via a serial (com) port, 9600 baud, connected via…
John Lee wrote 7 lines
I'm trying to get data from a device via a serial (com) port, 9600 baud, connected via the prolific cable (serial to usb). This allows one to connect a serial device via a usb port (many new PCs do not have a real serial port. I've loaded the prolific driver. Anyone have fpc program that'll work on win xp.

John, any unit that will talk to a "standard" COM port should work - when you plug in the cable, it should enumerate as a COM port - I do this with an FTDI adapter board that I use with my custom Arduino projects. Granted, my stuff is Delphi, but under Win32, there shouldn't be any difference in how the ports are accessed from FPC.

g.

Proud owner of F-15C 80-0007 http://www.f15sim.com - The only one of its kind. http://www.simpits.org/geneb - The Me-109F/X Project ScarletDME - The red hot Data Management Environment A Multi-Value database for the masses, not the classes. http://www.scarletdme.org - Get it _today_! Political correctness is a doctrine, fostered by a delusional, illogical minority, and rabidly promoted by an unscrupulous mainstream media, which holds forth the proposition that it is entirely possible to pick up a turd by the clean end.
John Lee

I'm trying to get data from a device via a serial (com) port, 9600 baud, connected via the prolific cable (serial to usb). This allows one to connect a serial device via a usb port (many new PCs do not have a real serial port. I've loaded the prolific driver.

Anyone have fpc program that'll work on win xp.

John

Paul Breneman
to John Lee

John,

Show quoted text 6 lines
I'm trying to get data from a device via a serial (com) port, 9600 baud, connected via the prolific cable (serial to usb). This allows one to connect a serial device via a usb port (many new PCs do not have a real serial port. I've loaded the prolific driver. Anyone have fpc program that'll work on win xp.

I have some files here that might help you get started using the SynaSer package with FPC:
http://www.turbocontrol.com/simpleserial.htm

Regards, Paul Breneman www.dbReplication.com - VCL database replication components www.TurboControl.com - Hardware and software development services - Educational programming project for environment monitoring - Information on using FreePascal for embedded systems - Support information for the TurboPower open source libraries
Jorge Aldo G. de F. Junior
to Paul Breneman

try synaser, its portable across various O.S. and provides a very modern interface.

2011/3/12 Paul Breneman :

Show quoted text 27 lines
John, > I'm trying to get data from a device via a serial (com) port, 9600 baud, > connected via the prolific cable (serial to usb). This allows one to > connect > a serial device via a usb port (many new PCs do not have a real serial > port. > I've  loaded the prolific driver. > > Anyone have fpc program that'll work on win xp. I have some files here that might help you get started using the SynaSer package with FPC:  http://www.turbocontrol.com/simpleserial.htm -- Regards, Paul Breneman www.dbReplication.com - VCL database replication components www.TurboControl.com - Hardware and software development services - Educational programming project for environment monitoring - Information on using FreePascal for embedded systems - Support information for the TurboPower open source libraries _______________________________________________ fpc-pascal maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Unknown author
to Paul Breneman: I have some files here that might help you get started using the SynaSer package with FPC:

Paul and other responders, thanks. Think I'ma bit clearer how to do it now.

q1) My com device is an energy monitor that sends a block of xml data, 1000 bytes or so, every 6 secs. Guess this means I might be better 'using getbuf or whatever it's called in synaser, rather than single char at a time? Any examples of using this welcome.

q2) does synaser work on win98/me?

Regards John

Paul Breneman wrote
John,
Show quoted text 9 lines
I'm trying to get data from a device via a serial (com) port, 9600 baud, connected via the prolific cable (serial to usb). This allows one to connect a serial device via a usb port (many new PCs do not have a real serial port. I've loaded the prolific driver.
Anyone have fpc program that'll work on win xp.
I have some files here that might help you get started using the SynaSer package with FPC: http://www.turbocontrol.com/simpleserial.htm
Show quoted text 21 lines
-- Regards, Paul Breneman www.dbReplication.com - VCL database replication components www.TurboControl.com - Hardware and software development services - Educational programming project for environment monitoring - Information on using FreePascal for embedded systems - Support information for the TurboPower open source libraries _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Luca Olivetti
to Unknown author

Al 20/03/11 19:47, En/na ha escrit:

Paul and other responders, thanks. Think I'm a bit clearer how to do it now. q1) My com device is an energy monitor that sends a block of xml data, 1000 bytes or so, every 6 secs. Guess this means I might be better 'using getbuf or whatever it's called in synaser, rather than single char at a time? Any examples of using this welcome.

If each line of xml has a terminator (say, crlf), you can use RecvTerminated to read line by line.
Or, you can use RecvBufferEx, RecvBufferString, RecvPacket. All methods are documented in synaser source.

q2) does synaser work on win98/me?

No idea. I works under xp.

Bye

Luca