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

    Persistant storage of variable data

    Scheduled Pinned Locked Moved
    Firmware wishlist
    3
    6
    340
    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.
    • OwenDundefined
      OwenD
      last edited by

      Is there any plan to be able to store variable data in something akin to an .ini file?
      Or perhaps a couple of arrays could be stored in config.g
      Perhaps one for string values and one for floats and bools?
      The former would allow greater flexibility, but I imagine the latter has less overhead as the arrays could be loaded when config.g is parsed.

      I think this would enhance development of new uses without having to wait for the object model or firmware to catch up and I can't really see it being able to break anything

      1 Reply Last reply Reply Quote 0
      • A Former User?
        A Former User
        last edited by

        config-override.g maybe? its already on the checklist to have a look see when things go haywire. Although it does raise the question of flash wear.

        1 Reply Last reply Reply Quote 0
        • Danalundefined
          Danal
          last edited by

          Conditional g-code does not yet have variables. When it gets them, it will also get globals, at some point macro arguments.

          At that point, you can implement your own persistence, by writing the variables to a file (named anything) where each line in that file actually is the command to set a global variable to a value. Execute that macro after a power up, and... voilà! Persistence!

          Of course, deciding when (really, how often) to write that file gets very interesting. Time? Change detect? Do it in the daemon g-code task? Etc.

          Delta / Kossel printer fanatic

          OwenDundefined 1 Reply Last reply Reply Quote 1
          • OwenDundefined
            OwenD @Danal
            last edited by

            @Danal
            Yes, that is basically what I was suggesting when I mentioned and approach akin to .ini files
            We can open a file and write all subsequent gcode commands to create the file entries, then close it with M28/29 (from memory)
            I guess implementation is going to come down to how to manage the memory overhead of the variables. I mentioned a couple of arrays as an option as that allows the developers to control how many variables are stored. I have no idea of the available room.
            With some sort of file handling routine(s) it would be possible to load a single required value rather than all values.
            To be honest I don’t have a full usage case for why this would be necessary, but I’m sure it will be useful, although probably not always for 3D printing.
            For example I sell semi automated and robotic welding equipment.
            Persistent storage allows for saving “jobs” which would contain things like oscillating speeds, widths etc.

            Danalundefined 1 Reply Last reply Reply Quote 0
            • Danalundefined
              Danal @OwenD
              last edited by

              @OwenD said in Persistant storage of variable data:

              Persistent storage allows for saving “jobs” which would contain things like oscillating speeds, widths etc.

              I'm sure there are lots of use cases... but... the above literally is a gcode job.

              Delta / Kossel printer fanatic

              OwenDundefined 1 Reply Last reply Reply Quote 0
              • OwenDundefined
                OwenD @Danal
                last edited by

                @Danal
                Yes & no.
                Unlike a printer, you don’t generate new gcode for each different shape.
                A typical interface would simply allow the user to pick a weave shape pattern (toolpath) e.g sawtooth, square wave and then select/set width, oscillating speed and travel speed.
                Once optimised these settings are saved as a job.
                So your “job” file would only contain the variables of speed, width.
                The “pattern” or toolpath file remains unchanged an unknown to the user.

                E.g for square wave pattern
                (Loop until endstop)
                G1 X{weave-width} F{oscillating-speed}
                G4 S{pause-time}
                G1 Y{step-distance} F{travel-speed}
                G4 S{pause-time}
                G1 X{-weave-width} F{oscillating-speed}
                G4 S{pause-time}
                G1 Y{step-distance} F{travel-speed}
                G4 S{pause-time}

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA