SPINBOX DATA to G-Code Variable

More
01 Sep 2018 12:11 #116948 by andypugh
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.

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

More
03 Sep 2018 09:57 #117007 by JesusAlos
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.

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

More
03 Sep 2018 13:40 #117010 by Todd Zuercher
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
M66 E0
#<_your parameter>=#5399
The following user(s) said Thank You: Nico2017

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

More
02 Mar 2019 13:43 - 02 Mar 2019 19:30 #127493 by jurod
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


.

File Attachment:

File Name: pyvcp-panel.xml
File Size:4 KB

File Attachment:

File Name: aplikovat_...3-02.txt
File Size:0 KB
Attachments:
Last edit: 02 Mar 2019 19:30 by jurod.

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

More
02 Mar 2019 17:19 #127522 by Askjerry
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

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

More
03 Mar 2019 07:52 #127572 by pl7i92
you may also do
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.

More
03 Mar 2019 10:38 #127586 by jurod
Thanks
today I will test.

to Askjerry: With ENTER it works. I am :blush: :blush:

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

More
05 Mar 2019 16:32 #127797 by andypugh
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.

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

More
07 Mar 2019 16:53 #128000 by jurod
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

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

Time to create page: 0.091 seconds
Powered by Kunena Forum