fbpx

CS-Lab Support Forum for CNC Community

Help to run this brand-new forum and stay with us.
Ask your questions, we are here to help! 

 

Please or Register to create posts and topics.

Set a specific work coordinate

Hello!

I can`t get one thing to work. I want wo change one specific value(Y - equals [1] / 2nd Number 26) from the "WorkOffset" String, which is also shown in the python guide:

Index = 3

WorkOffset = [ 20, 26, -44, 55, -50, -70]

d.setWorkOffset( Index, WorkOffset )

This is from the Guide itself, does anybody know how to change only the 2nd one (26, in this case the Y axis coordinate).

When i leave the other numbers blank, there is an error. 

 

Regards

Dobbelju

maybe

New_Y_Value = 26

# Retrieve the current offsets
Index = 3
WorkOffset = d.getWorkOffset(Index) 

# Modify only the second value in the WorkOffset list
WorkOffset[1] = New_Y_Value

# Apply the modified new offsets
d.setWorkOffset(Index, WorkOffset)

Hello.

Erwan is right.

I would like to add that the same is done when we want to move the axes.

When we want to move the X-axis to machine position 0 :

vel = 100

pos = d.getPosition(CoordMode.Machine)

pos[Axis.X.value] = 0;

d.moveToPosition(CoordMode.Machine, pos, vel)

 

When we want to move the X-axis by 10mm in machine coordinates

vel = 100

pos = d.getPosition(CoordMode.Machine)

pos[Axis.X.value] += 10

d.moveToPosition(CoordMode.Machine, pos, vel)

 

Regards,

Wojtek

Hello!

Finally i could use your ideas on how to work this out. And it worked very well, thanks alot to you both!

Was very helpful. 

Regarfs

Dobbelju

erwan has reacted to this post.
erwan

PARTNERS:

 

USA

Germany

Slovenia / Bosnia

Spain

South Africa

UNI-CAM

The Netherlands

Portugal

Greece

  Distrib milionis logo

Hungary

Distrib logot

Bulgaria

Master

Kenya

Proteq Automation

Egypt

Germanelectronix

China

Jun Ma

Serbia

ALCO

Italy

LVL tech r

Denmark

Varntoft Dania

Finland

×

Hello!

Click one of our contacts below to chat on WhatsApp

× How can I help you?