- Posts: 90
- Thank you received: 0
Divide Axis coordinate
- MarcoGaspar
- Topic Author
- Offline
- Premium Member
-
Less
More
9 years 7 months ago #89657
by MarcoGaspar
Divide Axis coordinate was created by MarcoGaspar
Hello,
It's possible and how to add one button to Divide the coordinates of axis?
Best Regards,
Marco Gaspar
It's possible and how to add one button to Divide the coordinates of axis?
Best Regards,
Marco Gaspar
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
9 years 7 months ago #89659
by Todd Zuercher
Replied by Todd Zuercher on topic Divide Axis coordinate
Probably.
What do you mean by "Divide"?
What exactly do you want?
Do you just want to take the number shown in the DRO and divide it by another number?
What will the divisor be? Will it always be the same or will it be a variable?
What do you want to do with the product?
What do you mean by "Divide"?
What exactly do you want?
Do you just want to take the number shown in the DRO and divide it by another number?
What will the divisor be? Will it always be the same or will it be a variable?
What do you want to do with the product?
Please Log in to join the conversation.
- MarcoGaspar
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 90
- Thank you received: 0
9 years 7 months ago #89660
by MarcoGaspar
Replied by MarcoGaspar on topic Divide Axis coordinate
i want to take the number shown in the DRO and divide it by 2 (to center a workpice)
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
9 years 7 months ago #89661
by Todd Zuercher
Replied by Todd Zuercher on topic Divide Axis coordinate
Are you also going to want to command the axis to move to that point, or do you just want the number for calculating purposes?
Please Log in to join the conversation.
- MarcoGaspar
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 90
- Thank you received: 0
9 years 7 months ago #89662
by MarcoGaspar
Replied by MarcoGaspar on topic Divide Axis coordinate
i just want for calculate
I just want to make 0 on one side of the workpiece and on the other side i want to divide the value by half to set the X0 Y0 to the middle of the pice.
I just want to make 0 on one side of the workpiece and on the other side i want to divide the value by half to set the X0 Y0 to the middle of the pice.
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
9 years 7 months ago #89666
by Todd Zuercher
Replied by Todd Zuercher on topic Divide Axis coordinate
I think you could create a button (with GladeVCP or PYVCP) that could do this but it seems a lot of trouble.
If all you want is the number spit out it will take 2 lines of MDI code, so you will need to make a sub program that the VCP button calls with its MDI command. If you would like the button to move the axis to that half way point, it is actually a little simpler as one line of MDI code can do the job and you wouldn't need the sub program(s). You would have to set up a different button for each axis you want to do this with.
Any way, the MDI commands to just spit out the numbers would be, 1st to create a parameter variable and set it equal to the value you are after. And the 2nd one prints it out. First you would jog to the left edge of your piece, touch off that axis, jog to the other edge, then issue these two commands. (or press your button once that is configured).
To just move to the mid point the line of code would be.
The parameter numbers for the other relative axis potions are #5421=Y, #5422=Z, #5423=A...
If all you want is the number spit out it will take 2 lines of MDI code, so you will need to make a sub program that the VCP button calls with its MDI command. If you would like the button to move the axis to that half way point, it is actually a little simpler as one line of MDI code can do the job and you wouldn't need the sub program(s). You would have to set up a different button for each axis you want to do this with.
Any way, the MDI commands to just spit out the numbers would be, 1st to create a parameter variable and set it equal to the value you are after. And the 2nd one prints it out. First you would jog to the left edge of your piece, touch off that axis, jog to the other edge, then issue these two commands. (or press your button once that is configured).
Code:
#<half x.>=[#5420/2]
(debug, #<half x>)
To just move to the mid point the line of code would be.
Code:
G0 X[#5420/2]
The parameter numbers for the other relative axis potions are #5421=Y, #5422=Z, #5423=A...
Please Log in to join the conversation.
- MarcoGaspar
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 90
- Thank you received: 0
9 years 7 months ago #89668
by MarcoGaspar
Replied by MarcoGaspar on topic Divide Axis coordinate
Thanks
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
Less
More
- Posts: 4739
- Thank you received: 2
9 years 7 months ago #89675
by Todd Zuercher
Replied by Todd Zuercher on topic Divide Axis coordinate
Maybe this line might be more useful, It would automatically change the touch off point to the mid point in one MDI command, without any movement of the machine.
First touch of the left edge (G54), then jog to the right edge, then issue this command, and the mid point will be set as the new G54 X0.
First touch of the left edge (G54), then jog to the right edge, then issue this command, and the mid point will be set as the new G54 X0.
Code:
G10 L20 P1 X[#5420/2]
Please Log in to join the conversation.
9 years 7 months ago #89765
by andypugh
If you are using the Axis interface and the Touch-off box then you can simply enter an arithmetic expression in the touch-off dialog.
Replied by andypugh on topic Divide Axis coordinate
MarcoGaspar wrote: i want to take the number shown in the DRO and divide it by 2 (to center a workpice)
If you are using the Axis interface and the Touch-off box then you can simply enter an arithmetic expression in the touch-off dialog.
Please Log in to join the conversation.
8 years 8 months ago #106560
by billykid
Replied by billykid on topic Divide Axis coordinate
I'm trying this function but I can not ... it seems to me to be # 5221 the g54 for x not 5420. however it does not divide me in half but does a random number.
thanks
Mauro
excuse me it was right 5420 works perfectly
thanks
Mauro
excuse me it was right 5420 works perfectly
Please Log in to join the conversation.
Time to create page: 0.570 seconds
