(Solved) Is there a way of creating a dummy pin inside hal?

More
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

 

Please Log in or Create an account to join the conversation.

More
28 Nov 2021 22:32 #227854 by cmorley
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
The following user(s) said Thank You: Blackwind

Please Log in or Create an account to join the conversation.

More
29 Nov 2021 21:07 #227949 by Todd Zuercher
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.)
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.

More
29 Nov 2021 23:33 - 29 Nov 2021 23:34 #227957 by Grotius
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)

 
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.

More
02 Dec 2021 18:52 - 02 Dec 2021 22:29 #228214 by Blackwind
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!
Last edit: 02 Dec 2021 22:29 by Blackwind.

Please Log in or Create an account to join the conversation.

More
02 Dec 2021 18:54 #228215 by Blackwind
Hi, thanks for the aswer
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.

More
02 Dec 2021 22:28 #228231 by Blackwind
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.

Please Log in or Create an account to join the conversation.

More
02 Dec 2021 23:07 #228237 by MaHa
The following user(s) said Thank You: Blackwind

Please Log in or Create an account to join the conversation.

More
05 Dec 2021 14:46 #228387 by Blackwind
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!

Please Log in or Create an account to join the conversation.

More
05 Dec 2021 15:10 #228388 by tommylight

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.168 seconds
Powered by Kunena Forum