keep check hal comp is exist problem
25 May 2018 09:29 #111107
by ccaayyww
keep check hal comp is exist problem was created 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?
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 or Create an account to join the conversation.
29 May 2018 13:33 - 29 May 2018 13:34 #111260
by andypugh
Replied by andypugh on topic keep check hal comp is exist problem
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)
Last edit: 29 May 2018 13:34 by andypugh.
Please Log in or Create an account to join the conversation.
Time to create page: 0.058 seconds