(Solved) Is there a way of creating a dummy pin inside hal?
28 Nov 2021 21:06 #227845
by Blackwind
Hello to everybody,
i have a question that couldnt respond myself post it here if someone has an answer!
i want the machine to move to a certain position on shutdown.
i have an mdi_command in my .ini, but how i could run it in shutdown.hal on exit? (i was thinking on create a dummy bolean pin to modify it from 0 to 1 in shutdown to call mdi_command)
in the manual says something like hal_pin_new but that is for terminal.
Any comments?
regards
rick
i have a question that couldnt respond myself post it here if someone has an answer!
i want the machine to move to a certain position on shutdown.
i have an mdi_command in my .ini, but how i could run it in shutdown.hal on exit? (i was thinking on create a dummy bolean pin to modify it from 0 to 1 in shutdown to call mdi_command)
in the manual says something like hal_pin_new but that is for terminal.
Any comments?
regards
rick
Please Log in or Create an account to join the conversation.
28 Nov 2021 22:32 #227854
by cmorley
Replied by cmorley on topic (Solved) Is there a way of creating a dummy pin inside hal?
I don't think shutdown.jal is going to help you - I think at that point linuxcnc motion controller is already taken down.
You really need to catch the event in the screen code.
What screen are you using?
I'm sure someone already did this with AXIS
You really need to catch the event in the screen code.
What screen are you using?
I'm sure someone already did this with AXIS
The following user(s) said Thank You: Blackwind
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
29 Nov 2021 21:07 #227949
by Todd Zuercher
Replied by Todd Zuercher on topic (Solved) Is there a way of creating a dummy pin inside hal?
I've never tried this, but if you have set up a Halui command pin for the midi command, Try simply trying to setp the hal pin for the halui command in the shutdown.hal file.
a line like this (if the mdi command you set up in your ini is #01.)
a line like this (if the mdi command you set up in your ini is #01.)
setp halui.mdi-command-01 true
The following user(s) said Thank You: Blackwind
Please Log in or Create an account to join the conversation.
29 Nov 2021 23:33 - 29 Nov 2021 23:34 #227957
by Grotius
Replied by Grotius on topic (Solved) Is there a way of creating a dummy pin inside hal?
Hi,
In terminal or a with a bash file it is possible to do a crual shutdown attack like below:
#!/bin/bash
./halcmd unlink stepgen_motioncontrol (detach stepgenerator or pid controller from linuxcnc)
./halcmd setp motor.x 0 (sent motor x axis to zero)
echo "asta la vista"
shutdown -h +1 (wait one minute to shutdown)
In terminal or a with a bash file it is possible to do a crual shutdown attack like below:
#!/bin/bash
./halcmd unlink stepgen_motioncontrol (detach stepgenerator or pid controller from linuxcnc)
./halcmd setp motor.x 0 (sent motor x axis to zero)
echo "asta la vista"
shutdown -h +1 (wait one minute to shutdown)
Last edit: 29 Nov 2021 23:34 by Grotius.
The following user(s) said Thank You: Blackwind
Please Log in or Create an account to join the conversation.
02 Dec 2021 18:52 - 02 Dec 2021 22:29 #228214
by Blackwind
Replied by Blackwind on topic (Solved) Is there a way of creating a dummy pin inside hal?
Hi Chris, thanks for the answer!
Im in axis, i was working on shutdown.hal because id suppose is for that purpose, axis shutdowns fast but lcnc component continues working serveral seconds from exit. I dont want the event on screen, i just want the machine came close to home limits.
But judging by the error i get you are right!
Im in axis, i was working on shutdown.hal because id suppose is for that purpose, axis shutdowns fast but lcnc component continues working serveral seconds from exit. I dont want the event on screen, i just want the machine came close to home limits.
But judging by the error i get you are right!
Last edit: 02 Dec 2021 22:29 by Blackwind.
Please Log in or Create an account to join the conversation.
02 Dec 2021 18:54 #228215
by Blackwind
Replied by Blackwind on topic (Solved) Is there a way of creating a dummy pin inside hal?
Hi, thanks for the aswer
that is crude!, if i not come to a solution i will kill it with your code hehe.
that is crude!, if i not come to a solution i will kill it with your code hehe.
Please Log in or Create an account to join the conversation.
02 Dec 2021 22:28 #228231
by Blackwind
Replied by Blackwind on topic (Solved) Is there a way of creating a dummy pin inside hal?
Hi Todd, tks for the answer.
That was my first aproach, but get this error:
halui: emcCommandSend: no echo from Task after 5.000 seconds
halui: sendMdiCommand: failed to send mdi command 21
i think in this cmorley is right, at the time of shutdown motion controller is gone.
That was my first aproach, but get this error:
halui: emcCommandSend: no echo from Task after 5.000 seconds
halui: sendMdiCommand: failed to send mdi command 21
i think in this cmorley is right, at the time of shutdown motion controller is gone.
Please Log in or Create an account to join the conversation.
02 Dec 2021 23:07 #228237
by MaHa
Replied by MaHa on topic (Solved) Is there a way of creating a dummy pin inside hal?
Are you looking for something like that?
forum.linuxcnc.org/49-basic-configuratio...tion-shutdown#226443
forum.linuxcnc.org/49-basic-configuratio...tion-shutdown#226443
The following user(s) said Thank You: Blackwind
Please Log in or Create an account to join the conversation.
05 Dec 2021 14:46 #228387
by Blackwind
Replied by Blackwind on topic (Solved) Is there a way of creating a dummy pin inside hal?
Thanks for the answer MaHA!, that suits my needs, and works really well!.
I was posting this in hal shutdown section but to my surprise no everything could be done in hal.
To moderators, i want to modify the tittle including [solved!]
Many thanks to all!
I was posting this in hal shutdown section but to my surprise no everything could be done in hal.
To moderators, i want to modify the tittle including [solved!]
Many thanks to all!
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19209
- Thank you received: 6438
05 Dec 2021 15:10 #228388
by tommylight
Done.
Replied by tommylight on topic (Solved) Is there a way of creating a dummy pin inside hal?
To moderators, i want to modify the tittle including [solved!]
Done.
The following user(s) said Thank You: Blackwind
Please Log in or Create an account to join the conversation.
Time to create page: 0.080 seconds