Read com port
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Read com port
I can't help you, it works for me.
EMG
EMG
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Read com port
This is what I use to read data from a medical device:
Code: Select all
Local cDataRead:=Space( 10 ) //length of data to read
Local cDCB
Local nComm
//Setup COM port
if ! BuildCommDcb( "COM1":9600,n,8,1", @cDcb )
MsgInfo("BuildComm Error")
endif
if ! SetCommState( nComm, cDcb )
MsgInfo("SetComm Error")
endif
if FlushComm( nComm, 1 ) != 0
MsgInfo("FlushComm Error")
endif
//Read the COM port
ReadComm( nComm, @cDataRead )
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Read com port
Jeff Barnes wrote:Code: Select all
if ! BuildCommDcb( "COM1":9600,n,8,1", @cDcb )
Code: Select all
if ! BuildCommDcb( "COM1:9600,n,8,1", @cDcb )
- Robert Frank
- Posts: 95
- Joined: Fri Nov 23, 2007 4:43 am
- Location: Gdynia-Poland
- Contact:
Re: Read com port
?
Jeff, have you got an example of ASTM communication in fivewin?
Jeff Barnes wrote:This is what I use to read data from a medical device:
Jeff, have you got an example of ASTM communication in fivewin?
Robert Frank
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Read com port
Thanks Enrico .... a slip of the finger
Robert ... What is ASTM ?
Robert ... What is ASTM ?
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
- Robert Frank
- Posts: 95
- Joined: Fri Nov 23, 2007 4:43 am
- Location: Gdynia-Poland
- Contact:
Re: Read com port
Standard of communication (via RS232 or sockets) between medical software and medical analysers.Jeff Barnes wrote:Thanks Enrico .... a slip of the finger
Robert ... What is ASTM ?
Robert Frank
- Jeff Barnes
- Posts: 912
- Joined: Sun Oct 09, 2005 1:05 pm
- Location: Ontario, Canada
- Contact:
Re: Read com port
Sorry ... I do not have an example of ASTM.
I simply just read the data on the port and process it. I wasn't even aware there was an actual protocol for RS2332 and medical devices.
I simply just read the data on the port and process it. I wasn't even aware there was an actual protocol for RS2332 and medical devices.
Thanks,
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Jeff Barnes
(FWH 12.01, xHarbour 1.2.1, Bcc582)
Re: Read com port
Everything I'd tried to solve the problem but to no avail! The only thing I said to use FWH2.7.
I only have a few questions:
- Do I need a library hbcomm.lib? If I need where I can find?
- If your example of you doing, what your opinion may be a reason for me not working?
I only have a few questions:
- Do I need a library hbcomm.lib? If I need where I can find?
- If your example of you doing, what your opinion may be a reason for me not working?
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Read com port
It could be a problem in your FWH release.
EMG
EMG
- Robert Frank
- Posts: 95
- Joined: Fri Nov 23, 2007 4:43 am
- Location: Gdynia-Poland
- Contact:
Re: Read com port
Favory, Jef and Enrico wrotes main point of this subiect.
You wrote in your exampleJeff Barnes wrote: if ! SetCommState( nComm, cDcb )
MsgInfo("SetComm Error")
endif
Did you correct it to them version? SetCommState( nComm, cDcb )favory wrote: if ! SetCommState( cDcb )
MsgStop( "Error SETCOMM!" )
return .f.
endif
Robert Frank
Re: Read com port
With version FW1.92 everything works without problems! So the problem is FWH2.7 or xHarbour. Why? I don't know! I have another question. how do I make a simultaneous communication with multiple serial ports?