Reading and writing variables with Python

More
25 Jun 2016 06:57 #76635 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

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

More
25 Jun 2016 21:43 #76662 by BigJohnT
It might help to know what your trying to accomplish.

JT

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

More
26 Jun 2016 06:06 #76669 by terkaa
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

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

More
08 Nov 2016 10:23 #82581 by pawelosyp
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

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

More
08 Nov 2016 13:39 #82584 by andypugh
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.

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

More
08 Nov 2016 13:53 #82585 by pawelosyp
Thanks for reply. I will read that and try to do this.

Pawel

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

Time to create page: 0.065 seconds
Powered by Kunena Forum