SPINBOX DATA to G-Code Variable
01 Sep 2018 12:11 #116948
by andypugh
Replied by andypugh on topic SPINBOX DATA to G-Code Variable
Unfortunately #<_hal Pins are only updated when the G code starts, not live.
A tool change (even a dummy one) _might_ update them during G-code execution.
M66 and a Hal net is the dependable way.
A tool change (even a dummy one) _might_ update them during G-code execution.
M66 and a Hal net is the dependable way.
Please Log in or Create an account to join the conversation.
03 Sep 2018 09:57 #117007
by JesusAlos
Replied by JesusAlos on topic SPINBOX DATA to G-Code Variable
I tried:
G4 P[#5410]
The result is I have to reload the tool table to load the new diameter tool value.
G4 P#<_hal[pyvcp.spinbox0]>
M66 E<pin_number>
Both cases, have to stop the machine to load the new value.
I can't find a way to change a variable value during gcode execution.
Thank you.
G4 P[#5410]
The result is I have to reload the tool table to load the new diameter tool value.
G4 P#<_hal[pyvcp.spinbox0]>
M66 E<pin_number>
Both cases, have to stop the machine to load the new value.
I can't find a way to change a variable value during gcode execution.
Thank you.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1440
03 Sep 2018 13:40 #117010
by Todd Zuercher
Replied by Todd Zuercher on topic SPINBOX DATA to G-Code Variable
To update a parameter value in g code using m66.
In your hal file connect the pin "motion.analog-in-00" (motion.analog-in-nn) to the hal pin you are reading your analog value from.
Then in your G-code when you what the value updated insert
In your hal file connect the pin "motion.analog-in-00" (motion.analog-in-nn) to the hal pin you are reading your analog value from.
Then in your G-code when you what the value updated insert
M66 E0
#<_your parameter>=#5399
The following user(s) said Thank You: Nico2017
Please Log in or Create an account to join the conversation.
02 Mar 2019 13:43 - 02 Mar 2019 19:30 #127493
by jurod
Replied by jurod on topic SPINBOX DATA to G-Code Variable
Hi everybody
I have two problems with spinbox.
1. G code (aplikovat) is unchanged if I write to a spinbox with a keyboard. The number on the
screen is changed but gcode is without change.
A change with arrow G code (aplikovat) its OK. It works with changes.
2. I wood like change "Z coordinate relative to workpiece" with button "Aplikovat" .
Why? Help please.
My config:
In file .ini.
[HALUI]
MDI_COMMAND= o <aplikovat> call
[DISPLAY]
PYVCP = pyvcp-panel.xml
[RS274NGC]
FEATURES = 12
In file pyvcp_options.hal
net appc halui.mdi-command-10 pyvcp.appc
.
I have two problems with spinbox.
1. G code (aplikovat) is unchanged if I write to a spinbox with a keyboard. The number on the
screen is changed but gcode is without change.
A change with arrow G code (aplikovat) its OK. It works with changes.
2. I wood like change "Z coordinate relative to workpiece" with button "Aplikovat" .
Why? Help please.
My config:
In file .ini.
[HALUI]
MDI_COMMAND= o <aplikovat> call
[DISPLAY]
PYVCP = pyvcp-panel.xml
[RS274NGC]
FEATURES = 12
In file pyvcp_options.hal
net appc halui.mdi-command-10 pyvcp.appc
.
Last edit: 02 Mar 2019 19:30 by jurod.
Please Log in or Create an account to join the conversation.
02 Mar 2019 17:19 #127522
by Askjerry
Replied by Askjerry on topic SPINBOX DATA to G-Code Variable
When you put a value into the SPINBOX, you must hit ENTER to lock it in... otherwise no change.
Also... the SPINBOX will not effect the TOUCHOFF screen... they are separate.
If you are attempting to set the Z-Axis G54 HOME to the new measurement... for example 20mm as shown in your code... then the command would be
#TEMP = [#<_hal[pyvcp.stock]> * [-1]]
G10 L20 Z #TEMP P1
When the command is executed... TEMP is calculated... so if you set the SPINBOX to 20... then TEMP would be -20.
When the routine executes G10 L20 Z #TEMP P1 it tells LinuxCNC that you are now 20mm lower then the ZERO (HOME) position.
The current location will then be set as 20mm above the surface.
Is that what you are attempting to do?
Jerry
Also... the SPINBOX will not effect the TOUCHOFF screen... they are separate.
If you are attempting to set the Z-Axis G54 HOME to the new measurement... for example 20mm as shown in your code... then the command would be
#TEMP = [#<_hal[pyvcp.stock]> * [-1]]
G10 L20 Z #TEMP P1
When the command is executed... TEMP is calculated... so if you set the SPINBOX to 20... then TEMP would be -20.
When the routine executes G10 L20 Z #TEMP P1 it tells LinuxCNC that you are now 20mm lower then the ZERO (HOME) position.
The current location will then be set as 20mm above the surface.
Is that what you are attempting to do?
Jerry
Please Log in or Create an account to join the conversation.
03 Mar 2019 07:52 #127572
by pl7i92
Replied by pl7i92 on topic SPINBOX DATA to G-Code Variable
you may also do
User Mcode to Reload the Screen for correct Display
User Mcode to Reload the Screen for correct Display
#!/bin/bash
# axis reload after g92 M100
axis-remote --reload
exit 0
Please Log in or Create an account to join the conversation.
03 Mar 2019 10:38 #127586
by jurod
Replied by jurod on topic SPINBOX DATA to G-Code Variable
Thanks
today I will test.
to Askjerry: With ENTER it works. I am
today I will test.
to Askjerry: With ENTER it works. I am
Please Log in or Create an account to join the conversation.
05 Mar 2019 16:32 #127797
by andypugh
Replied by andypugh on topic SPINBOX DATA to G-Code Variable
When I had an interface with spinboxes I was in the habit of clicking up-arrow then down-arrow to lock the value. (I think that this was before the enter key was mapped to the control....)
It's an annoying feature of PyVCP.
It's an annoying feature of PyVCP.
Please Log in or Create an account to join the conversation.
07 Mar 2019 16:53 #128000
by jurod
Replied by jurod on topic SPINBOX DATA to G-Code Variable
I created ngc. It's ok. Thanks.
O<aplikovat> sub
#<TEMP> = #<_hal[pyvcp.stock]> + #<_hal[pyvcp.suct]>] *[-1
G0 G53 Z0
G10 L20 P0 Z[140.27 + [#<TEMP>]]
O<aplikovat> endsub
M2
O<aplikovat> sub
#<TEMP> = #<_hal[pyvcp.stock]> + #<_hal[pyvcp.suct]>] *[-1
G0 G53 Z0
G10 L20 P0 Z[140.27 + [#<TEMP>]]
O<aplikovat> endsub
M2
The following user(s) said Thank You: Nico2017
Please Log in or Create an account to join the conversation.
Time to create page: 0.169 seconds