Weighbridge integration

anton1987
Member Posts: 35
I have recently done a weighbridge integration with the Nfcomm OCX.
But getting strange return from the weighbridge.
The weighbridge is supposed to send a text string as follows
$123456 for example but this seems to look correct in hyper terminal that it is indeed sending this value.
but when it get to navision and other software the string is read as follows
$0±6²60
One other strange thing is when I use a virtual comport everything seems fine.
Any ideas would greatly be appreciated.
But getting strange return from the weighbridge.
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;
The weighbridge is supposed to send a text string as follows
$123456 for example but this seems to look correct in hyper terminal that it is indeed sending this value.
but when it get to navision and other software the string is read as follows
$0±6²60
One other strange thing is when I use a virtual comport everything seems fine.
Any ideas would greatly be appreciated.
0
Comments
-
Are you sure your com port (not the virtual one) is configured properly concerning parity, etc.?
Thomas0 -
Hi Tomas.
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 help0 -
Hi Anton
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
Thomas0 -
Hi Tomas.
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
Does anyone got a solution for this? Having the exact same problem0 -
exact same thing. i see the post is really old so hopefully there's going to be someone updating/ posting a solution. thanks0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions