Coder Social home page Coder Social logo

Comments (4)

mluhmann avatar mluhmann commented on August 26, 2024

Hi Ole

sorry for the delay. I will try to workout an example. I know its working because our 61131 Library IP_COM (available in the PLCnext Store for free and in the bundle IT_Library), is based on the available C# functions and implements non blocking UDP and TCP communication. For your information, with the runtime profile 3.3 (implemented in FW 2021.0 LTS) the whole namespace Threading regarding to .NET Standard 1.0 is implemented. This does not include convenience features like Tasks and async/await. Probably you can also find an working example online based on .NET Standard 1.0.

from csharpexamples.

 avatar commented on August 26, 2024

from csharpexamples.

mluhmann avatar mluhmann commented on August 26, 2024

Unfortunately the GitHub project currently only supports C++ development for PLCnext. We are currently working on the release of the 2021.0 LTS Visual Studio extension for C# development. If everything works as planned, it should be available next week. With this the new profile is available as well.

There are two use cases we have to differentiate.
The first one is running your listener non blocking inside the cyclic task. For this you have to implement your own UDP client/server based on the socket class. For sockets a parameter blocking can be set to false. This is the way our 61131 IP function blocks are working. This way the socket buffer is checked every cycle. If lots of data should be send or received this could lead to a watchdog.
The second option is to run the UDP connection inside a Thread. For this you can simply run the UDP communication in a Thread. An example how to use threads is given here:
https://github.com/PLCnext/CSharpExamples/tree/master/PLCnext_CSharpExamples/12_Threads
On top of that you could combine the self build non blocking socket connection and threads. This is the safest and probably most reliable way to avoid watchdogs.

I have got some test code snippets from our internal development. I have to review them and try to build an example out of it. But this will take me at least some weeks.

from csharpexamples.

AshWhitear avatar AshWhitear commented on August 26, 2024

hey there, any updates on this? This is exactly what we're after! Thanks, Ash.

from csharpexamples.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.