attempt to divide by zero
- jefsaro
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 98
- Thank you received: 3
06 Feb 2019 05:45 #125788
by jefsaro
Replied by jefsaro on topic attempt to divide by zero
thanks for your response ,
I am reassured that the problem does not come from me, I mechanic and computer is not easy for me, that 's why I make my program in gcode, it' s a language that I know.
I will try to find another solution.
I made this machine, a machine to cut the gears and I retrofit a fanuc milling machine.
i find linuxcnc genial, i have a mazak lathe and a cincinati milling machine, but linuxcnc is really the best.
regards
jf
I am reassured that the problem does not come from me, I mechanic and computer is not easy for me, that 's why I make my program in gcode, it' s a language that I know.
I will try to find another solution.
I made this machine, a machine to cut the gears and I retrofit a fanuc milling machine.
i find linuxcnc genial, i have a mazak lathe and a cincinati milling machine, but linuxcnc is really the best.
regards
jf
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 10938
- Thank you received: 3629
06 Feb 2019 09:55 #125794
by rodw
Replied by rodw on topic attempt to divide by zero
There is a way to access a hal pin from gcode but I remember the documentation is in a very obscure place and I can't for the life of me find it for you
![:( :(](/media/kunena/emoticons/sad.png)
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
-
Less
More
- Posts: 407
- Thank you received: 163
06 Feb 2019 11:23 #125796
by MaHa
Replied by MaHa on topic attempt to divide by zero
Have a look here and No.20
linuxcnc.org/docs/2.7/html/remap/remap.html#remap:ini-features
linuxcnc.org/docs/2.7/html/remap/remap.html#remap:ini-features
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 10938
- Thank you received: 3629
06 Feb 2019 11:35 #125797
by rodw
Thank you. I told you its obscure. Section 20 is actually a bit further down and is exactly what I wanted to share.
linuxcnc.org/docs/2.7/html/remap/remap.h...ap:referto-hal-items
So jf, by referencing the pin name that is connected to the motion.analog-out.nn you should be able to work with gcode variables you are familiar with.
Replied by rodw on topic attempt to divide by zero
Have a look here and No.20
linuxcnc.org/docs/2.7/html/remap/remap.html#remap:ini-features
Thank you. I told you its obscure. Section 20 is actually a bit further down and is exactly what I wanted to share.
linuxcnc.org/docs/2.7/html/remap/remap.h...ap:referto-hal-items
So jf, by referencing the pin name that is connected to the motion.analog-out.nn you should be able to work with gcode variables you are familiar with.
Please Log in or Create an account to join the conversation.
- jefsaro
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 98
- Thank you received: 3
06 Feb 2019 13:15 #125801
by jefsaro
Replied by jefsaro on topic attempt to divide by zero
thank you very much, but I do not understand what I have to do, it exceeds my skills
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4960
- Thank you received: 1444
06 Feb 2019 13:32 - 06 Feb 2019 13:35 #125803
by Todd Zuercher
Replied by Todd Zuercher on topic attempt to divide by zero
Does this g-code work for you?
(o<MortaiseuseDiviseur> sub)
g54g17g90g21
g0z0
g0y0
g0 a-10
g0 a0
#2=6
M66 E0 L0
#2=#5399 (_nb_division)
o102 if [#2 EQ 0]
(MSG, Error Nbre de Devisions=0)
m2
0102 else
#3=[360/#2] (angle 360/ nbre de rainure)
o102 endif
M66 E1 L0
#4=#5399 (_Prof)
#6=[#4/0.05] (calcul du nbre passe)
M66 E2 L0 (longueur)
#7=#5399
M66 E3 L0 (retour)
#8=#5399
o100repeat[#1]
o101 repeat[#6] (nbre de passe)
g91 g1 y0.05 f200 (profondeur de passe constante de 0.1mm)
g90 g1 z-[#7]f25000
g91y-.7
g90 g0 z0
g91g0y.7
o101 endrepeat
g0g90y0
(m0)
g0y[-#8]
g0g91a[#3]
o100endrepeat
g0z0
g0y0
g0a0
g0g90a-10
g0a0
g0 y-150
(o<MortaiseuseDiviseur> endsub)
m2
Last edit: 06 Feb 2019 13:35 by Todd Zuercher.
Please Log in or Create an account to join the conversation.
- jefsaro
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 98
- Thank you received: 3
06 Feb 2019 16:54 #125828
by jefsaro
Replied by jefsaro on topic attempt to divide by zero
thank you very much i test tomorow
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 10938
- Thank you received: 3629
06 Feb 2019 21:24 #125877
by rodw
The following variables should exist in your g code
So where you have
You might be able to replace it with
And likewise remove the other M66 /#5399 commands and use
I'm not sure that these pins will be there in a subroutine though so they might need to be passed as parameters to the subroutine.
Replied by rodw on topic attempt to divide by zero
thank you very much, but I do not understand what I have to do, it exceeds my skills
The following variables should exist in your g code
#<_hal[pyvcp.diviseur]>
#<_hal[pyvcp.profondeur]>
#<_hal[pyvcp.Longueur]>
#<_hal[pyvcp.retour]>
So where you have
M66 E0 L0
#2=#5399 (_nb_division)
#2 = #<_hal[pyvcp.diviseur]>
And likewise remove the other M66 /#5399 commands and use
#4 = #<_hal[pyvcp.profondeur]>
#7 = #<_hal[pyvcp.Longueur]>
#8 = #<_hal[pyvcp.retour]>
I'm not sure that these pins will be there in a subroutine though so they might need to be passed as parameters to the subroutine.
Please Log in or Create an account to join the conversation.
- jefsaro
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 98
- Thank you received: 3
07 Feb 2019 14:50 #125927
by jefsaro
Replied by jefsaro on topic attempt to divide by zero
hello ,
i test , but i think i make a mistake , when a change it's ok in parameter , but i 'am error , parameter is not defined.
regards
jf
i test , but i think i make a mistake , when a change it's ok in parameter , but i 'am error , parameter is not defined.
regards
jf
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 10938
- Thank you received: 3629
07 Feb 2019 19:31 #125945
by rodw
Remove the spaces in the variable name in your gcode file and it might have a better chance of working
Replied by rodw on topic attempt to divide by zero
hello ,
i test , but i think i make a mistake , when a change it's ok in parameter , but i 'am error , parameter is not defined.
regards
jf
Remove the spaces in the variable name in your gcode file and it might have a better chance of working
![:ohmy: :ohmy:](/media/kunena/emoticons/shocked.png)
Please Log in or Create an account to join the conversation.
Time to create page: 0.076 seconds