LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Inetping NRP-Z11

Solved!
Go to solution

bonjour je suis débutante ,je veux faire un ping sur un power sensor NRP Z11 avec le IDE labwindows CVI donc j'ai écrit ce code 


#include <cvintwrk.h>
#include <ansi_c.h>
#include <cvirte.h>

int main (int argc, char *argv[])
{

InetPing ("192.168.8.1",1, 10000);

return 0;
}

 

mais toujours il y a un errreur :

12, 30 Type error in argument 2 to `InetPing'; found 'int' expected 'pointer to int'.

vous pouvez m'aider ?

0 Kudos
Message 1 of 6
(3,019 Views)
Solution
Accepted by topic author anna12

the second argument is where the function returns the answer to your query, so you need to provde a variable, not a number:

 

int answer = 0;

InetPing ("192.168.8.1",&answer, 10000);

0 Kudos
Message 2 of 6
(3,003 Views)

merci mais toujours il y a un problème voila le code 


int answer=0 ;

InetPing ("192.168.8.1", &answer, 10000);
printf("réponse",answer);
getchar();

 

c'était l'erreur : 

NON-FATAL RUN-TIME ERROR: "stage.c", line 13, col 22, thread id 0x00001B1C: Too many parameters.

0 Kudos
Message 3 of 6
(2,997 Views)

unfortunately we do not know your line numbers but I guess that the problem now is your printf command... you miss a format specifier

0 Kudos
Message 4 of 6
(2,993 Views)

merci ça bien marché

 

0 Kudos
Message 5 of 6
(2,979 Views)

de rien Smiley Wink

0 Kudos
Message 6 of 6
(2,975 Views)