Hi all,
I'm trying to connect NAV2009 R2 SQL Classic with a weighbridge connected to a PC through a COM port (COM4) using nfcomm.ocx.
I'm using the same port parameters than other software is reading weights from the indicator but I'm getting an error value I can not understand.
My code, until error, is the following:
ComPort.ComX := 3; // 0=COM1, 1=COM2, 2=COM3, 3=COM4
ComPort.BaudRate := 6; // 4=2400, 5=4800, 6=9600, 7=19200, 8=38400, 9=57600, 10=11520
ComPort.DataBits := 4; // 0=4, 1=5, 2=6, 3=7, 4=8
ComPort.Parity := 0; // 0=none, 1=Odd, 2=Even, 3=Mark, 4=Space
ComPort.StopBits := 0; // 0=1, 1=1.5, 2=2
ComPort.ClearBuff;
ComPort.OpenPort;
//PortOpen := ComPort.OpenPort;
ErrorDesc := ComPort.CommError;
"ErrorDesc" is an integer variable that receives value "-2". Could someone explain me the meaning of this value?
Thanks,
Comments
We had some problems with nfcomm.ocx. We changed then to a commercial product:
http://www.activexperts.com/serial-port-component/
It contains demo code and is fully supported. Hope this helps
Thomas
viewtopic.php?p=252120#p252120
You can ask me for details
Hope this helps...