VERICUT Users' Forum

Due to relentless spammers, we are no longer automatically accepting new forum registrations. If you wish to register for this forum, please send an e-mail to: info@cgtech.com

You are not logged in.

#1 2013-10-31 20:08:23

jamesweed
Member
Registered: 2013-08-09
Posts: 13

Custom G-code call won't pass arguments.

I have a custom G-code to set work coord.
Works fine if I just program a G70 ( sets all axis' work coord positions)
If I want to pass arguments to macro, it doesn't work. G70X0R55, or anything like it does not work. Not only does it not pass the argument, it wont even process the macro.

I would add a image snippit of my G-code processing window, but attachment option doesn't seem to work on the forum?

G70(set work coord)
    **
        variable:4012  <---dont know what this does?
        variable:4212  <---dont know?
        varsUpdateMacroVars
        Call SubName

Offline

#2 2013-11-01 21:21:27

vhubbard
Beta User
From: Dallas, TX
Registered: 2004-11-11
Posts: 222
Website

Re: Custom G-code call won't pass arguments.

For each parameter you wish to pass, you must go to the register and add a condition for the G70 code.

In simple terms for the X register, check for G70 and if it is a G70 line, then define what you want to do with the X value.
Same with the R. 

To code the G70X0R55,   The G "70" code would need to be defined as well as the X and R registers.

This is an example of what to do with the "P" on a G10 line.  This shows just 3 of the many options for the "P" register,  depending on if L11 or 13,  L21 or some other setting was used along with G10.
Sorry picture upload wont work so this is the code, not the pretty interface.

      <ConditionMacro>
        <CondWord Logical="and" Name="G" Range="10"/>
        <CondWord Logical="and" Name="L" Range="11 13"/>
        <Macro Name="TableIndex" Scan="no" AfterMotion="no">
          <Override  Type="expression"  Value="$ +1000"/>
        </Macro>
      </ConditionMacro>
      <ConditionMacro>
        <CondWord Logical="and" Name="G" Range="10"/>
        <CondWord Logical="and" Name="L" Range="21"/>
        <Macro Name="WorkCoordIndex" Scan="no" AfterMotion="no">
          <Override  Type="expression"  Value="$ +60"/>
        </Macro>
      </ConditionMacro>
      <ConditionMacro>
        <CondWord Logical="and" Name="G" Range="10"/>
        <Macro Name="WorkCoordIndex" Scan="no" AfterMotion="no">
        </Macro>
        <Macro Name="TableIndex" Scan="no" AfterMotion="no">
        </Macro>
      </ConditionMacro>

Order is important,  If I had put the "L" checks after the G10 only check in the register, they would not have been found since the "first match" wins when processing for a register.

Offline

#3 2013-11-04 16:12:44

jamesweed
Member
Registered: 2013-08-09
Posts: 13

Re: Custom G-code call won't pass arguments.

Thanks vhubbard for your responce.

Offline

Board footer