Asigning value from nc-code to HAL parameter

More
23 Jul 2020 15:42 #175554 by jsskangas
I have problem to write value from nc code to hal parameter.

I remapped G50 and defined to accept "S" parameter.

I would like this G50 command to pass value after "S" to Hal parameter.

How can i make this happen?

I can debug it like: (debug,value of S is #<S>) and it gives correct value. But how to write this to HAL parameter?

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

More
23 Jul 2020 16:34 #175555 by PCW
Is there some reason you cannot use M67 or M68?

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

More
23 Jul 2020 18:09 #175559 by jsskangas
I made "limit spindle max rpm" HAL component for lathe and I would like to use G50 as it is generally used as RPM limit in Fanuc based machines.

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

More
23 Jul 2020 19:48 - 23 Jul 2020 19:49 #175567 by jsskangas
I tried do it like this :

G50 S1200.0

G50 mapped to subprogram, which call M120 P#<S>


Inside M120

#!/bin/bash
rpmlimit=$1
halcmd setp spindlelimit.rpm-limit $rpmlimit
exit 0

But there is also problems with this one.
Even calling M120 P1200.0 directly in MDI,
will not change parameter, but goes thru without error and shuts down spindle.

Using line directly in "Show HAL Configuration" setp spindlelimit.rpm-limit 1200.0 will change parameter

Calling any even empty user defined M-command will shutdown Spindle???
Is this a bug? My mill 2.8 pre will not act this way.
Last edit: 23 Jul 2020 19:49 by jsskangas.

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

More
23 Jul 2020 20:54 #175572 by tommylight
Why do you insist on using 1200.0 ?????
Usually that is OK, but not always.
1200

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

More
23 Jul 2020 21:13 #175575 by jsskangas
I does not mater 1200 or 1200.0 same behavior.
I tried both, cause 1200.0 is float and 1200 could be read as integer.
The following user(s) said Thank You: tommylight

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

More
24 Jul 2020 09:23 #175612 by tommylight
Thank for the explanation.

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

Time to create page: 0.164 seconds
Powered by Kunena Forum