keep check hal comp is exist problem

More
8 years 5 months ago #111107 by ccaayyww
I wrote a hal,need to keep running.
in hal main()
{
restart:
id=hal_init("testhal");
..
hal_ready(id);
while(1)
{
...
n=hal_comp_name(id);
if(n==NULL)
{
printf("restart testhal");
goto restart;
}
}
hal_exit(id);
}

and run it and linuxcnc.
but when shutdown linuxcnc,and testhal it unload.
run halcmd show comp,there isn't anything but halcmd.but don't get "restart testhal"output.
and try change hal_comp_name to hal_init
in hal main()
{
restart:
id=hal_init("testhal");
..
hal_ready(id);
while(1)
{
...
i=hal_init("testhal");
if(i>0)
{
printf("restart testhal");
goto restart;
}
}
hal_exit(id);
}
and keep get output "HAL ERROR:duplicate component name testhal"and there isn't string "restart testhal"
where is the problem?

Please Log in to join the conversation.

More
8 years 5 months ago #111260 by andypugh
Can you re-post the code in code tags so that it is legible? (You can type them, or there is a button in the editor bar)

Please Log in to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum