A guy on the IRC was asking about some method to align sheets of stock on his plasma table and having a plasma table too sparked my interest in developing this. A suggestion from Andy about using global parameters while chatting on the IRC about ways to do this sparked what I came up with. Lots of sparks flying about it seems...
I added 4 buttons to my PyVCP panel Start Align, Align Y, Align X and Clear Offset. The attached file has the PyVCP code as well as all the rest of the code.
I then added 4 MDI commands to the [HALUI] section of my INI file.
[HALUI]
MDI_COMMAND o<start-align> call
MDI_COMMAND o<align-y> call
MDI_COMMAND o<align-x> call
MDI_COMMAND o<clear-offset> call
Then I connected the PyVCP buttons to the MDI commands in my postgui.hal file.
# MDI commands start at 00 in the order listed in the ini file.
net align-start halui.mdi-command-00 <= pyvcp.align-start
net align-y halui.mdi-command-01 <= pyvcp.align-y
net align-x halui.mdi-command-02 <= pyvcp.align-x
net clear-offset halui.mdi-command-03 <= pyvcp.clear-offset
Then I created the 4 subroutines that do the actual work when the button is pressed. They are also in the attached zip file.
To align along the Y axis jog to the left rear corner and press Start Align. Next Jog to the left front corner and press Align Y. You set to cut even if the sheet is not perfectly square to the plasma table.
To align along the X axis use the left front and right front corners and the Align X button.
After cutting use the Clear Offset button to do the obvious thing. A note I ASSUME you need to have the rotation cleared before locating the sheet edge...
Enjoy
John
This attachment is hidden for guests. Please log in or register to see it.