Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Communicate with TCP port

Posted on by 650

Hi,

To read data from a weight bridge, I need to send / receive a text from NAV to an external IP addres + Port. 

In the past, you could use the Nav communication component, but I think it does no longer exist.

Any tips to do this easily in NAV 2016

Thanks,

Regards,

Steven

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Communicate with TCP port

    Hi Steven,

    Please share the .net assembly. It would inspire me to try something similar for NAV 18. Planning to Trigger Weigh Machine and get the response which will be stored in SO. Any advice?

  • stevdeb Profile Picture
    stevdeb 650 on at
    RE: Communicate with TCP port

    Thx for your replies.

    I created a .net assembly and it works.

    Regards,

    Steven

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Communicate with TCP port

    hi,

    in that case, as ahmed suggests, the only way is to use .net classes. you could try to develope a codeunit using according .net classes like TcpClient or develope a little .net assembly for that issue.

    helpful links:

    csharp.net-informations.com/.../csharp-socket-programming.htm

    msdn.microsoft.com/.../system.net.sockets.tcpclient(v=vs.110).aspx

  • Verified answer
    Rashed Profile Picture
    Rashed 3,765 on at
    RE: Communicate with TCP port

    Hello Steven

    You need to create a .net assembly that will do the TCP/IP communication. 

    You could try and do it in NAV using socket dotnet datatype but they are event based and have to maintain connection etc.  As well as you have to handle the packets being received partially from the socket.

    I have had in past do a socket integration with credit card pin pad, and created a dotnet assembly in csharp was the easiest solution.

  • stevdeb Profile Picture
    stevdeb 650 on at
    RE: Communicate with TCP port

    Hi,

    Thanks already for the answers.

    The only way to read data from the weight bridge is by sending a text to a tcp port and then it sends the weight back.

    I do not really see how I can do that with web services?

    Could you be more specific please?

    Thanks,

    Regards,

    Steven

  • Suggested answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: Communicate with TCP port

    I would recommend to use SOAP web service for that purpose. Check msdn.microsoft.com/.../dd355398(v=nav.90).aspx

  • keoma Profile Picture
    keoma 32,675 on at
    RE: Communicate with TCP port

    hi, standard method is using nav web services.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans