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=" "
EXIT
ENDIF
INKEY(0.2)
Q_SOUND(1)
ENDDO
RETURN TEKST
********************************************************************************
FUNCTION INITTOLEDO
********************************************************************************
COM_OPEN(UWEE,300,300,.T.)
COM_INIT(UWEE,9600,"E",7,2) &&9400 vroeger OK
COM_SOFT(UWEE,.F.)
COM_HARD(UWEE,.F.)
RETURN
******************************************************************************
ANY IDEE ??????????
Wim
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=" "
EXIT
ENDIF
INKEY(0.2)
Q_SOUND(1)
ENDDO
RETURN TEKST
********************************************************************************
FUNCTION INITTOLEDO
********************************************************************************
COM_OPEN(UWEE,300,300,.T.)
COM_INIT(UWEE,9600,"E",7,2) &&9400 vroeger OK
COM_SOFT(UWEE,.F.)
COM_HARD(UWEE,.F.)
RETURN
******************************************************************************
ANY IDEE ??????????
Wim