Forum categories for conditional Gcode & macros



  • Now that 3.1 is released, I think it would be beneficial to have a forum category dedicated to conditional gcode & macros.
    This should probably be broken down into various kinematic types.
    Furthermore it may be good to have some sort of “duet approved” marker like the “solved” marker, once the macros have been peer reviewed and improved where necessary.
    I usually try to make macros “portable” by not hard coding anything, but the very fact that certain parts of the object model are not visible if you don’t run that type of configuration, probably makes putting them in the categories for which they were designed beneficial and will reduce angst and support time.
    (Yes, I know we should be checking for null objects and kinematic types as a matter of course in every macro)
    Which leads to my final point, which is once we have some documentation on the object model, perhaps someone could do a small tutorial on best practice when writing macros.
    My programming background is not in C or its variants so I admit I’m constantly searching for proper syntax etc.
    To a non-programmer it is just gobbledygook.
    If there’s going to be dozens of people learning to do it, they may as well learn to do it in a way that ensure portability and reduces the chance of unexpected issues.
    I’ve always found it usually takes 10 lines of code to do the job, the another 50 lines of code to stop people trying to do it out of order or in a way you never imagined 😉



  • @OwenD said in Forum categories for conditional Gcode & macros:

    ’ve always found it usually takes 10 lines of code to do the job, the another 50 lines of code to stop people trying to do it out of order or in a way you never imagined

    Thats the 80/20 rule isn't it? People are 80% stupid - although I might have paraphrased.

    Jokes aside, big yes ☝



  • BTW, I'm happy to pen a draft for "best practice" which can be reviewed and altered as required.
    Is it possible to add a category & submit to the wiki?



  • @OwenD said in Forum categories for conditional Gcode & macros:

    .................Which leads to my final point, which is once we have some documentation on the object model, perhaps someone could do a small tutorial on best practice when writing macros.

    Yes please!

    To a non-programmer it is just gobbledygook.

    That hits home with me!. It's all like a foreign language to this 67year old retarded retired mechanical engineer. 🙂


  • administrators

    good idea! how about a sub category of "tuning and tweaking"?


  • administrators

    Also i think the way to have a "Duet approved" macro if thats helpful/possible with the amount of variation, would be discuss on the fourm and then expand this page in the documentation to link to the macro itself: https://duet3d.dozuki.com/Wiki/Macros

    The best place to store the macros themselves is possibly github, then updates as the object model changes will be easier to do and track.



  • Both sound like good ideas


Log in to reply