Hello Guest it is April 19, 2024, 02:33:28 PM

Author Topic: Need help with marco??????  (Read 6206 times)

0 Members and 1 Guest are viewing this topic.

Offline lokey

*
  •  60 60
    • View Profile
Need help with marco??????
« on: April 04, 2009, 07:30:25 PM »
Hi, I am trying a macro that will:

 store the DRO value

Home all axis

Move axis back 0.0015 then reset to DRO’s to zero

Move axis to pervious stored values

 varx = GetDRO(0)
vary = GetDRO(1)
varz = GetDRO(2)

code "G28 X 0"
code "G28 Y 0"
code "G28 Z 0"

code "G28.1 X -0.0015"
code "G28.1 Y -0.0015"
code "G28.1 Z 0.0015"

While IsMoving()
Wend

code "G0 X varx" & varx

When it gets to the last line I receive “a unknown word where unary operation could be” error message. I am following the syntax from the training video. Is there a solution? Thanks in advance for feedback received.

 

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Need help with marco??????
« Reply #1 on: April 04, 2009, 11:26:51 PM »
Code ( "G0 X" & varx & " Y" & vary)
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

vmax549

*
Re: Need help with marco??????
« Reply #2 on: April 05, 2009, 12:01:56 PM »
YEP, or you could do

code "G0 X " & varx to replicate what you have on that line.  WHen you use the Code"" routine VB switches over to the Gcode side and the Gcode does not reconise  the varx inside of the " " so you add it on from the outside
"  " &varx

Hope that helps, (;-) TP


Offline lokey

*
  •  60 60
    • View Profile
Re: Need help with marco??????
« Reply #3 on: April 05, 2009, 03:09:36 PM »
Hi, thanks for the feed back.  Is there away to re-set the machine coordinates DROs?
Re: Need help with marco??????
« Reply #4 on: April 05, 2009, 06:35:59 PM »
SetMachZero(0)
SetMachZero(1)
SetMachZero(2)

In a macro will set X, Y and Z machine DROs to zero. The same as if they had just been homed.
I have that code in a macro called M900.m1s to zero Mach 3 when I have my Bridgeport mechanical counters at zero.

Offline lokey

*
  •  60 60
    • View Profile
Re: Need help with marco??????
« Reply #5 on: April 05, 2009, 07:02:05 PM »
Hi, I am trying to set machine coor. DRO's to a save variable. I have the OEM codes 83,84,85 but I can not get them to work in a macro. Is there a solution?
Re: Need help with marco??????
« Reply #6 on: April 05, 2009, 09:10:57 PM »
You can read the machine coords but I don't think you can set them other than to zero.

Offline lokey

*
  •  60 60
    • View Profile
Re: Need help with marco??????
« Reply #7 on: April 12, 2009, 10:36:39 AM »
Hi, I am using a Zenbot with Mach3, LazyCam, and TuboCad.  In the system I found there is a accumulating positive shift of 0.0015 after each axis movement that doesn‘t show up on the DRO‘s. . I am new to the software and there maybe a setting to deal with the problem but I am unable to find it. The problem becomes really apparent with a project that include cutting circles around a central point. The last outer circle would be so far off center that the part would be useless.
   I was able to write a macro that solved the problem. I have to run the macro after each axis movement. Because the Zenbot has drive belts the macro works really well it has increased the precision of the Zenbot to a surprising level. Great bang for the bucks.  I would not use the macro if the machine had ball screws.
    If you know of a solution to the problem without using the macro please let me know. Thanks for feedback and best regards.  
« Last Edit: April 12, 2009, 10:43:11 AM by lokey »
Re: Need help with marco??????
« Reply #8 on: April 12, 2009, 02:39:44 PM »
In Config/Motor Tuning what is the setting for Step Pulse and Dir Pulse? If they are not both 5, try setting them to 5.

Offline lokey

*
  •  60 60
    • View Profile
Re: Need help with marco??????
« Reply #9 on: April 15, 2009, 12:40:42 AM »
Hi, I noticed that after I ran 28.1 code that the DRO's would read a + or -0.0009, it should reset to zero. That is where the accumulating shift  is coming for. I had to rewrite my macro to adjust for it. I now run the macro after each chain is cut and the machine is now performing very well.

Is there a a way to chance the direction of a cut within LazyCam? I performed a search and found one reference. It was talking about a double clicking on a white arrow but I am unable to find any white arrows.

Thanks for all the help that I have received and if anyone knows a solution to the LazyCam problem please let me know.
Best Regards