svego

Members
  • Posts

    46
  • Joined

  • Last visited

Posts posted by svego

  1. hi, 

    I found somewhere bat file that runs ping test from  txt file..

    Results are saved in separate txt file  like here, IP address and ping result has" ;" delimiter

    192.168.1.1; is OK 
    192.168.1.3; is NOT OK 
    google.com; is OK 
    jadrtovac.dyndns.info; is OK 
    hans.dyndns.info; is OK 
    192.168.1.11; is NOT OK 
    jutarnji.hr; is OK 

    So, here in attachement is sample of code

    My plan is to make map with devices and change colour depending of ping result.

    I created sequence to activate bat file and save results in file pingresults.txt in format IP address, ping result.

    system.ShellExecute("D:\razno\ping_test_boje_ver3.bat","open","D:\razno","hide")   --> runs BAT file but I can't hide it from main screen ??

     

    How to read results from file pingresults.txt and store results in array ??

    what do you suggest ?

    blob.png.a549089e018b28baea434f4057fdc4fd.png

    ping_test_boje_ver3.bat

    servers.txt

  2. Hi, 

    To check if all devices work OK I'm using expression (  systime() - temp_gorice.time[0] > 5 )..Now I need to check other IP devices eg. TCP/RS232, access points, IP printers , IP cams that is not modbus so only solution is to ping them.

    so here I need to make sequence like this...

    function checkPing(string ip, string path)
       system.ShellExecute("cmd","","/C ping " + ip + " > " + path, "", "hide")
       delay(5)
       private h = file.Open(path,1,0,0,0)
       private string data = file.Read(h, file.GetLength(h))
       file.Close(h)
       return(find(data,"TTL=",0) != -1)

    I want to show for every device on network their TTL time like...

    node 12 ( Lexmark printer, room 12) : 12ms

    node 15 ( IP cam, room 14): 10ms

    etc...

    please see screen, is that OK ?  DF freezes..

    what should be there ... string path  --> path to txt file with ping results... ??

     

    blob.png.4c52ff22bdfe93cd079beae00986fe7f.png