Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    RRF 3.5B2 Error: meta command: unknown variable

    Scheduled Pinned Locked Moved Solved
    Beta Firmware
    7
    9
    574
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jp.douarvil 0undefined
      jp.douarvil 0
      last edited by jp.douarvil 0

      Hello all,

      I run RRF 3.5B2 on Duet 3 in standalone mode.

      I am puzzled by an unexpected "unknown variable error".

      Here is an extract from "G103.g":

      var uClean = false
      ...
      if {var.uClean}
      	G90 G1 H2 Y{125+random(226)} X{var.xForth} U{var.uForth}
      else
      	G90 G1 H2 Y{125+random(226)} X{var.xForth}
      if {var.uClean && var.xClean && {global.ioMotV!=null} && {global.ioMotW!=null}}
      	G90 G1 H2 V{var.vDive} W{var.wDive} F{move.axes[4].speed}
      elif {var.xClean && {global.ioMotV!=null}}
      ...
      

      And there the extract from the "eventlog.txt":

      YYYY-MM-DD HH:MM:SS [warn] Error: in file macro line 7 column 16: meta command: unknown variable 'uClean'
      

      However the "var.uClean" variable is being called (several times in the full "G103g" file) between its declaration line 1 and its call line 7 the error occurs line 7 nonetheless.

      Has anybody an idea of the possible reason for this issue?

      Thank you in advance for your help.

      Regards,

      Exerqtorundefined infiniteloopundefined dc42undefined 3 Replies Last reply Reply Quote 0
      • Exerqtorundefined
        Exerqtor @jp.douarvil 0
        last edited by Exerqtor

        @jp-douarvil-0
        I've been having some weird variable issues too (since 3.4 tbh).

        Try this out and see what happens

        var uClean = 0
        set var.uClean = false
        
        chrishammundefined 1 Reply Last reply Reply Quote 0
        • infiniteloopundefined
          infiniteloop @jp.douarvil 0
          last edited by

          @jp-douarvil-0

          Has anybody an idea of the possible reason for this issue?

          Did you verify the vars and expressions following 'uClean'? The error message blames 'uClean', but points at the following column.

          @Exerqtor
          Maybe a problem with type coercion? In line 1, 'uClean' might be set up as an int. To verify that, change line 1 to

          var uClean = false
          
          1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @jp.douarvil 0
            last edited by dc42

            @jp-douarvil-0 please attach your G103.g file to a post in this thread. It might contain a non-printing character; if not then I will try out your file here.

            PS - I suspect this is caused by the multiple file readers in RRF 3.5 and is related to https://forum.duet3d.com/topic/31812/3-5b2-macros-called-from-a-job-lose-parameters. I have added it to my list to investigate.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            1 Reply Last reply Reply Quote 0
            • chrishammundefined
              chrishamm administrators @Exerqtor
              last edited by

              @Exerqtor I've been able to reproduce your example and fixed the underlying bug. Unforunately, I have been unable to reproduce the other two reports so far.

              Duet software engineer

              AndMazundefined 1 Reply Last reply Reply Quote 1
              • AndMazundefined
                AndMaz @chrishamm
                last edited by AndMaz

                @chrishamm can you provide more details about the actual bug? What versions firmware version did it affect? Only 3.5B2?

                I'm asking this because I'm facing something similar and I can't find a way to isolate the issue.
                I have a g-file with 20 local vars. and I'm getting a unknown variable
                To give you a better idea, here are (simplified) contents of the file

                var convertedAstart=0
                var convertedAEnd=0
                
                var periodAStartHr=19
                var periodAStartMin=0
                
                var periodAEndHr=9
                var periodAEndMin=0
                
                
                set var.periodAStartHrToSec=var.periodAStartHr*3600
                set var.periodAStartMinToSec=var.periodAStartMin*60
                set var.convertedAstart=var.periodAStartHrToSec+var.periodAStartMinToSec
                
                set var.periodAEndHrToSec=var.periodAEndHr*3600
                set var.periodAEndMinToSec=var.periodAEndMin*60
                set var.convertedAEnd=var.periodAEndHrToSec+var.periodAEndMinToSec
                
                
                while true
                  if (var.convertedAstart<=global.legacyEpochSeconds || global.legacyEpochSeconds<=var.convertedAEnd)
                    ; Do stuff here
                

                And here's the error that I receive:

                Error: in GCode file line 45 column 26: meta command: unknown variable 'convertedAstart'

                The file is called with M98 P"<path-to-file>".
                This error usually happens when I call M25, M0 and then M98 P"<path-to-file>" to start printing again.

                ATM rebooting the device solves the issue, ie, after reboot M98 P"<path-to-file>" does not throw any error.

                chrishammundefined 1 Reply Last reply Reply Quote 0
                • chrishammundefined
                  chrishamm administrators @AndMaz
                  last edited by

                  @AndMaz The problem was that an invalid statement in a macro called by a job file caused the print to abort. The function aborting the print cleared all the variables from the scope of both file readers executing a macro file causing one file reader to output a bad error message.

                  Duet software engineer

                  T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                  • T3P3Tonyundefined
                    T3P3Tony administrators @chrishamm
                    last edited by

                    @Exerqtor please can you confirm if this is fixed for you in 3.5.0-beta4 ?

                    www.duet3d.com

                    Exerqtorundefined 1 Reply Last reply Reply Quote 0
                    • Exerqtorundefined
                      Exerqtor @T3P3Tony
                      last edited by

                      @T3P3Tony I haven't been able to run beta4 because of the crashing issues i'm having with it for more than one print. But if I remeber correctly this specific issue was fixed.

                      1 Reply Last reply Reply Quote 0
                      • dc42undefined dc42 marked this topic as a question
                      • dc42undefined dc42 has marked this topic as solved
                      • niocio01undefined niocio01 referenced this topic
                      • First post
                        Last post
                      Unless otherwise noted, all forum content is licensed under CC-BY-SA