Frage zum TINA_Ping

  • 1
  • 2
  • 3
  • Page 1 of 3
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2077
Registered: 03 / 2003
Subject:

Frage zum TINA_Ping

 · 
Posted: 29.11.2020 - 11:18  ·  #1
Hallo Zusammen,

endlich läuft mein LAN :) ..... ich habe aber noch eine Verständnisfrage zur TINA_Ping-Function.
Der Aufruf lautet ja
Code
Function TINA_Ping (PingAdr : TIPAddr; TimeOut : Word) : Word;

Der Parameter TimeOut verwirrt mich. Ich verstehe das so, daß die Funktion max. TimeOut in ms wartet, ob ein Request erfolgt. Das heißt für mich aber, daß der µC diese TimeOut auch tatsächlich wartet, oder?

Anscheinend ist es aber doch nicht so, denn sonst dürft das hier nicht funktionieren, was es aber tut:
Code
    gDrawString(0,32,1,1,TxtRot0,IntToStr(TINA_Ping(IP1,1000):5:'0')+'ms');
    gDrawString(0,40,1,1,TxtRot0,IntToStr(TINA_Ping(IP2,1000):5:'0')+'ms');
    gDrawString(0,48,1,1,TxtRot0,IntToStr(TINA_Ping(IP3,1000):5:'0')+'ms');
    gDrawString(0,56,1,1,TxtRot0,IntToStr(TINA_Ping(IP4,1000):5:'0')+'ms');


Dann stellt sich mir die Frage: Wieviele Pings kann ich denn auf einmal absetzen?????

Gruss
Harry
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1362
Registered: 03 / 2005
Subject:

Re: Frage zum TINA_Ping

 · 
Posted: 29.11.2020 - 13:29  ·  #2
No, the time out is how long the program waits for a reply before giving up. When you execute a ping request you are sending a ping request request to a destination and waiting to see if that destination replies (which if it is not there, it obviously will not!)
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2077
Registered: 03 / 2003
Subject:

Re: Frage zum TINA_Ping

 · 
Posted: 29.11.2020 - 14:48  ·  #3
Hello Merlin,

is it possible to use 4 PING in 4 processes?

Harry
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1362
Registered: 03 / 2005
Subject:

Re: Frage zum TINA_Ping

 · 
Posted: 29.11.2020 - 15:59  ·  #4
Well... a simple sounding question but with a complicated answer. If you mean to ping the same address 4 times then no, that would be pointless and dangerous, and almost certainly cause a race hazard. If you mean to ping 4 different addresses, then yes, you could, in theory, provided you used 4 different sockets, but I don't know how AVRCo ping works internally so I don't know if it would work in your case. I personally wouldn't bother. Ping is so fast usually trying to do it in parallel wouldn't gain you that much. But that is just my opinion.
pvs-deck
PowerUser
Avatar
Gender:
Age: 52
Homepage: pvs-deck.de
Posts: 1340
Registered: 02 / 2009
Subject:

Re: Frage zum TINA_Ping

 · 
Posted: 29.11.2020 - 16:05  ·  #5
Quote by Harry

Hello Merlin,

is it possible to use 4 PING in 4 processes?

Harry



Hallo Harry,
warum machst Du nicht einfach nacheinander und wartest einfach den TimeOut / Rückmeldung ab.

Ich glaube wenn Du das gleichzeitig machen willst, musst Du das für jeden Ping über einen eigenen Socket machen schau mal hier

Soweit ich weiss, hat der Wiznet die PING Funktion fest eingebaut, hier kann man das über den RAW-Modus machen.

Thorsten
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1362
Registered: 03 / 2005
Subject:

Re: Frage zum TINA_Ping

 · 
Posted: 29.11.2020 - 16:39  ·  #6
Hi Thorsten.

Even with 4 sockets you can't ping the same address at the same time (but you could technically ping 4 different addresses). As far as RAW mode is concerned, it was my understanding that this was to receive and acknowledge a ping, not to generate and accept it which I think is what Harry wants and what AVRCo ping does.

Regards

Merlin
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2077
Registered: 03 / 2003
Subject:

Re: Frage zum TINA_Ping

 · 
Posted: 29.11.2020 - 17:37  ·  #7
Hallo Thorsten, hallo Merlin,

ganz einfach: Ich will zu Überwachungszwecken bis zu 100 IP-Adresse anpingen um deren Anwesenheit zu bestätigen. Das soll natürlich nicht ewig lang dauern. Ja es stimmt, es dauert maximal so lange, wie der angegebene Timeout. Bei meinen ersten Tests waren alle IPs erreichbar, weshalb es auch recht schnell ging. Da habe ich mich selber verkohlt. Als ich dann 192.168.0.1 - 32 durchgepingt habe, schaute es natürlich anderst aus.
Das mit den 4 Sockets probiere ich mal aus.

Was ich bisher überhaupt nicht geschafft hab, und ich probiere schon eine ganze Weile, ist eine IP-Adresse per DHCP zu bekommen.

Gruss
Harry
pvs-deck
PowerUser
Avatar
Gender:
Age: 52
Homepage: pvs-deck.de
Posts: 1340
Registered: 02 / 2009
Subject:

Re: Frage zum TINA_Ping

 · 
Posted: 29.11.2020 - 19:52  ·  #8
Quote by Harry

...
Was ich bisher überhaupt nicht geschafft hab, und ich probiere schon eine ganze Weile, ist eine IP-Adresse per DHCP zu bekommen.
...


Hallo Harry,

hast Du schon die Funktionen getestet oder wie machst Du den DHCP-Init?

Code
  function WzDHCPInit: boolean; 
  procedure WzSetDHCPcallback(Proc: TDHCPProc); 
  procedure WzSetHostName(HostName: string[15]); 
  
  procedure wzDHCPRestart; 
  process wzDHCPJob(128, 128: iData, 5, Suspended); 


Thorsten
  • 1
  • 2
  • 3
  • Page 1 of 3
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   135   149 · Page-Gen-Time: 0.028201s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI