Hello Guest it is April 19, 2024, 10:38:39 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ataheri

Pages: 1
1
General Mach Discussion / Camera capture Macro
« on: July 07, 2016, 05:46:04 PM »
I am planning to use the CNC system for automatic imaging from objects at specific xy coordinates and was wondering if there is a macro for it in Mach3?

2
Hello Octathorpe and Jason,
How and where did you put this code? Did you add it in the macro file? It is an interesting project and I am planning to implement similar system as well.

Jason totally Rocks!

I have added a blerb of script to do the movements, and (amazingly), it worked!

Since this is running as a macropump and goes through and then restarts, it isn't necessary to have logic for stepping through the spots in sequence, all that has to be done is just move X + 9 unless the end of a row has been reached.  This is easly figured out based on the number of files. 

If anyone has comments please let me know, otherwise I'll put it on the actual machine today and see what happens.
----------------------- (code below - I coudn't figure out how to make the 'code' box)

'for all cases not described in select below set move to be X+9

MoveX = GetOemDRO(800) + 9
MoveY = getoemdro(801) + 0

'for the special cases at end of rows override previous settings

Select Case  GetFileCount
  Case 12   
    MoveY = getoemdro(801) - 9
    MoveX = GetOemDRO(800) - 99
  Case 24
    MoveY = getoemdro(801) - 9
    MoveX = GetOemDRO(800) - 99
  Case 36
    MoveY = getoemdro(801) - 9
    MoveX = GetOemDRO(800) - 99
  Case 48
    MoveY = getoemdro(801) - 9
    MoveX = GetOemDRO(800) - 99
  Case 60
    MoveY = getoemdro(801) - 9
    MoveX = GetOemDRO(800) - 99
  Case 72
    MoveY = getoemdro(801) - 9
    MoveX = GetOemDRO(800) - 99
  Case 84
    MoveY = getoemdro(801) - 9
    MoveX = GetOemDRO(800) - 99
  Case 96
    MoveY = getoemdro(801) - 63
    MoveX = GetOemDRO(800) - 99
end select

'Move Y
Code ("G1 Y" & MoveY)
'Move X
Code ("G1 X" & MoveX)


Pages: 1