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

    +state.time behavior

    Scheduled Pinned Locked Moved
    Gcode meta commands
    2
    2
    170
    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.
    • audryhomeundefined
      audryhome
      last edited by

      +state.time converts the present time to an absolute 1970 value.
      as the documentation says:

      • int->int, float->float Unary +
      • DateTime->int Converts a date & time value to a number of seconds since the datum. Available in RRF 3.4 and later.

      It is either an unary operator or a function.

      When I use it in expression if(+state.time - global.last_time) I get an error

      "Error: in file macro line 14 column 17: meta command: expected numeric or enumeration value after '+' " which means the it doesn't recognize the + operator function in this context.

      Solution is to declare a var then use it at the same place.

      Is it a desired behavior or did I miss something?

      Many thanks

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @audryhome
        last edited by

        @audryhome which firmware version are you using? Please try firmware 3.4 if you are not already using it.

        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
        • First post
          Last post
        Unless otherwise noted, all forum content is licensed under CC-BY-SA