CLEARALL; NFCOM.ClearBuff; WBLocation.GET(Location); WBLocation.TESTFIELD("No. Characters to Retrieve"); WBLocation.TESTFIELD("Weight String Length"); IF WBLocation."Integration Type" = WBLocation."Integration Type"::"Continuous Transmission" THEN WBLocation.TESTFIELD("Weight Identifier"); I := 1; WHILE I < 3 DO BEGIN NFCOM.ComX := WBLocation."COM Port"; NFCOM.BaudRate := WBLocation."Baud Rate"; NFCOM.DataBits := WBLocation."Data Bits"; NFCOM.Parity := WBLocation.Parity; NFCOM.StopBits := WBLocation."Stop Bits"; NFCOM.ClosePort; NFCOM.ClearBuff; NFCOM.OpenPort; TempRawStr := NFCOM.ReceiveStr(WBLocation."No. Characters to Retrieve"); IF WBLocation."Debug Mode" THEN BEGIN IF CONFIRM(Debug900, TRUE, TempRawStr, STRLEN(TempRawStr)) THEN; END; ErrNo := NFCOM.CommError; NFCOM.ClosePort; CLEAR(NFCOM); IF ErrNo = -2 THEN I += 1 ELSE I := 10; END; CASE TRUE OF ErrNo = -2: BEGIN ERROR(Err902); END; ErrNo <> 0: BEGIN ERROR(Err900, ErrNo); END; END; CASE WBLocation."Integration Type" OF WBLocation."Integration Type"::"Manual Trigger": BEGIN WBLocation.TESTFIELD("Weight Start Character"); TempRawStr := COPYSTR(TempRawStr, WBLocation."Weight Start Character",WBLocation."Weight String Length"); END; WBLocation."Integration Type"::"Continuous Transmission": BEGIN CASE WBLocation."Marker Position" OF WBLocation."Marker Position"::"Before Weight": BEGIN TempStrPos := STRPOS(TempRawStr, WBLocation."Weight Identifier") + 1; END; WBLocation."Marker Position"::"After Weight": BEGIN TempStrPos := STRPOS(TempRawStr, WBLocation."Weight Identifier") - WBLocation."Weight String Length"; END; END; IF TempStrPos <= 0 THEN CASE ReadingNo OF 1: BEGIN ERROR(Err901, Text901); END; 2: BEGIN ERROR(Err901, Text902); END; END; TempRawStr := COPYSTR(TempRawStr, TempStrPos, WBLocation."Weight String Length"); END; END; IF WBLocation."Debug Mode" THEN BEGIN IF CONFIRM(Debug901, TRUE, TempRawStr) THEN; END;
Comments
Thomas
My comport settings for both Hyperterminal and nav are as follows
Comport = Com1
BaudRate = 2400
Databits = 8
Parity = None
Stopbits = 1
Flowcontoll = Hardware.
HyperTeminal See's the values as it is supposed to see it ie $123456
but nav sees it differently.
I can post my form that controlls how it all works online if that will help
Can you test with another serial tool, just to be sure nfcom works ok. You can use a test version of active com port (http://www.activexperts.com/activcomport/), it's a very good tool.
Good luck
Thomas
Does anyone got a solution for this? Having the exact same problem
exact same thing. i see the post is really old so hopefully there's going to be someone updating/ posting a solution. thanks