Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Ping Netzwerkadressen

Chris87
2017-03-24
2018-02-03
  • Chris87 - 2017-03-24

    Hallo Comunity,

    ich versuche seit einer weile über SysSockPing eine IP adresse im Hiemnetzwerk anzupingen, leider mag das bis jetzt nicht wirklich. Im Netzt habe ich zwar schon ein paar Anhaltspunkte gefunden, aber nichts in Codesys V3.
    Im Endefekt will ich am Schluss nur ein True oder Fals haben wenn die Adesse erreicbar ist.

    Hoffe hier kann mir jmd helfen.
    Danke schonmal.

    MfG Chris

    IMG: Ping.png

     
  • plcmax - 2017-03-24

    Hallo,

    ich würde es so machen:

    IF xPing THEN
       Result:=SysSockPing(szIPAddress:='192.168.188.1', ulTimeout:=500, pulReplyTime:= ADR(PingTime));
       IF PingTime > 0 THEN
          iPingCount:=iPingCount+1;
          IF iPingCount > 50 THEN
             iPingCount:=0;
             xDeviceavailable:=true;
          END_IF
       END_IF
    END_IF
    

    das pingen eventuell in einer eigenen Task aufrufen...!

    Viele Grüße
    plcmax

     
  • Nandi0710 - 2018-02-03

    Hallo Chris87, Hallo plcmax,

    seit ihr hier schon auf eine Lösung gekommen? Ich hätte das gleiche Problem wie Chris87 das ich mehrere Geräte im 5min. Takt anpingen möchte und hier dann einen False oder True wert erhalten will.

     

Log in to post a comment.