random number
-
Is rnd implemented?
If so what would be the correct syntax to generate a random X move between X30 to X100? -
Yes it is, but I don't think it's been updated in the meta command documentation
https://forum.duet3d.com/topic/17954/random-number-generation-with-meta-commands?_=1614626263724
It's now been added to the functions list.
https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Functions
-
Thanks, I'm trying to move X to a random place between X30 and X130.
I'm really not sure of the correct syntax, have tried
G1 X30+random(100) Y228 F3000
but all that happened was a move to X30
Any ideas on how to achieve this? -
Try:
G1 X{random(101) + 30} F3600
or for your exact example above use:
G1 X{30+random(100)} Y228 F3000
that will actually move to X between 30 & 129 actually - if you need 30 to 130 put 101 as the parameter to random().
-
thank you so much
-
@phaedrux What version RRF does this apply to?
I am on 3.1.1 and I get 'unknown function' errors when I try to use it or any of the above suggestions.
I have tried checking the Changelog file and the only thing I see referenced are the new gcode meta functions for version 3.1.0 and the redirect to the 'GCode_Meta_Commands' page where all this is listed.
-
@sinned6915 3.2 I believe