Reading and writing variables with Python
25 Jun 2016 06:57 #76635
by terkaa
Reading and writing variables with Python was created by terkaa
Hi,
I would like to know if it is possible to read and write ie. variable number 4999 from .var file with Python? Is there an example?
Tero
I would like to know if it is possible to read and write ie. variable number 4999 from .var file with Python? Is there an example?
Tero
Please Log in or Create an account to join the conversation.
25 Jun 2016 21:43 #76662
by BigJohnT
Replied by BigJohnT on topic Reading and writing variables with Python
It might help to know what your trying to accomplish.
JT
JT
Please Log in or Create an account to join the conversation.
26 Jun 2016 06:06 #76669
by terkaa
Replied by terkaa on topic Reading and writing variables with Python
Hi,
This was considered as one option for saving tool on spindle number to variable number 4999. GladeVCP panel for ATC alredy had some Python script for showig ATC states. But we solved saving tool number with Remapping M6 with file containing:
M6
#4999 = #5400
M2
This seems to work ok.
Tero
This was considered as one option for saving tool on spindle number to variable number 4999. GladeVCP panel for ATC alredy had some Python script for showig ATC states. But we solved saving tool number with Remapping M6 with file containing:
M6
#4999 = #5400
M2
This seems to work ok.
Tero
Please Log in or Create an account to join the conversation.
08 Nov 2016 10:23 #82581
by pawelosyp
Replied by pawelosyp on topic Reading and writing variables with Python
Hi all, I am new with LinuxCNC.
I have made macro to automatic tool measure. Now I think about saving parameters of starting milling (position, XY in respect to machine cordinates, Z to tool sensor etc).
What is the simplest way to save those parameters in occurrence to crash / tool broke. I now that it will not be ideal.
I thought about any system parameters. Is it good way?
Pawel
I have made macro to automatic tool measure. Now I think about saving parameters of starting milling (position, XY in respect to machine cordinates, Z to tool sensor etc).
What is the simplest way to save those parameters in occurrence to crash / tool broke. I now that it will not be ideal.
I thought about any system parameters. Is it good way?
Pawel
Please Log in or Create an account to join the conversation.
08 Nov 2016 13:39 #82584
by andypugh
Replied by andypugh on topic Reading and writing variables with Python
You might look at the (abort, xxxxx) "magic comment" if using a G-code routine.
linuxcnc.org/docs/2.7/html/remap/remap.h...g_dealing_with_abort
It is possible to set and read G-code parameters in Python, this code here does it:
github.com/LinuxCNC/linuxcnc/blob/master...athe-fanucy/remap.py
It sets the #<tool> parameter. But I am not 100% sure what the requirements are for that to work if you are not using remap.
linuxcnc.org/docs/2.7/html/remap/remap.h...g_dealing_with_abort
It is possible to set and read G-code parameters in Python, this code here does it:
github.com/LinuxCNC/linuxcnc/blob/master...athe-fanucy/remap.py
It sets the #<tool> parameter. But I am not 100% sure what the requirements are for that to work if you are not using remap.
Please Log in or Create an account to join the conversation.
08 Nov 2016 13:53 #82585
by pawelosyp
Replied by pawelosyp on topic Reading and writing variables with Python
Thanks for reply. I will read that and try to do this.
Pawel
Pawel
Please Log in or Create an account to join the conversation.
Time to create page: 0.134 seconds