Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM port communication failed

Status
Not open for further replies.

agedoorn

Programmer
Nov 7, 2000
28
BE
Hi,

The communication between a balance and our application works pretty well via COM1 port.
However since we upgraded to a PC with a PIII 700 MHz or higher, an with the operating system from W95 to W98, the communication fails....

We have to send a character to the balans, as a result the weight is returned by the balance to the COM buffer.
The value in the buffer is read.
However since the new PC's when we read the buffer after the character was sent, we just read the initial sent character and not the weight...

So it seems that the sent character remains in het buffer and the balance doesn't respond...

Is there any relation between the clockfrequency of the processor and the communication????
Are the funcions COM_SEND() and COM_READ() not compatible with the fast processors ????


Below the subject routine:

**************************
FUNCTION TOLEDO
***************************

INITTOLEDO()
IF "C1" $ USUP
ONTVANG=VAL(SUBSTR(TOLEDOSEND(CHR(5)),2))/1000 && DIG CARIN weegschaal !
ELSE
ONTVANG=VAL(SUBSTR(TOLEDOSEND("W"),2)) &&GOEDE VERSIE VOOR TOLEDO
ENDIF


RETURN ONTVANG
********************************************************************************
FUNCTION TOLEDOSEND(PAR)
********************************************************************************

COM_FLUSH(UWEE)
COM_SEND(UWEE,PAR)
A=0
DO WHILE COM_COUNT(UWEE) < 10
A=A+1
TEKST= COM_READ(UWEE)

IF LEN(TEKST) >5
EXIT
ENDIF
IF A=5
TEKST=&quot; &quot;
EXIT
ENDIF
INKEY(0.2)
Q_SOUND(1)

ENDDO
RETURN TEKST
********************************************************************************
FUNCTION INITTOLEDO
********************************************************************************

COM_OPEN(UWEE,300,300,.T.)
COM_INIT(UWEE,9600,&quot;E&quot;,7,2) &&9400 vroeger OK
COM_SOFT(UWEE,.F.)
COM_HARD(UWEE,.F.)

RETURN
******************************************************************************


ANY IDEE ??????????


Wim
 
What COM library are you using?

I'm using SilverClip in an application that receives data streams from several diiferent diagnostic machines in a lab through the com port and have not had any problem with it under Windows '95 or '98. NT is the platform that gives me the problems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top