On Mon, Aug 17, 2015, at 02:44 PM, andy pugh wrote: > > I give up, clearly I am incapable of describing the situation as I > understand it, and a real coder ought to look at the code and decide > what happens. > > > I think that the parameters are static from the first time they are > read, just like any other named parameter. > I don't know if you can change the value once you have initialised them. >
I was under the impression that named parameters (and the old numbered ones for that matter) are simply what would be called variables in any other language. You can assign a value to them (write): #<foo> = 10.00 or use them in an expression (read): G1 X[#<foo>] (not sure if [ ] are required here) G1 Y[#<foo> + #<bar>] ( [ ] are definitely required here) These special ini file and HAL parameters are read-only, so assignment isn't allowed But evaluation as part of an expression is allowed, and I believe it happens every time the interpreter encounters the expression, not just the first time. I can't test this, but what happens if you write: O100 while [1] (DEBUG, HAL says #<_hal[foo]>) G4 P1 O100 endwhile We have an infinite loop, printing the value of the hal item "foo" every second. Do we get the same value every time, or if the actual HAL value changes, does the printed value change as well? A couple other things in the documentation at http://www.linuxcnc.org/docs/html/remap/structure.html#_optional_interpreter_features_ini_file_configuration_a_id_sub_ini_features_a that are confusing: 1) it says "hal_name may be a pin, parameter or signal name." Originally, pins, parameters, and signals had completely different name-spaces. Has that been changed and I just missed it? If not, then it is possible to have the same name in all three name-spaces. What happens in this case? Are the name-spaces searched in a particular order, and the first match used? Needs to be documented. 2) it says "Note: The values are are only updated when the G code is not running" That kind of implies that somehow the interpreter captures a snapshot of the values of all HAL items wt the start of g-code execution, so that later if/when it encounters a #<_hal[foo]> expression it can look for the hal name and get the corresponding value. I find it hard to believe that the actual inplementation does that. -- John Kasunich [email protected] ------------------------------------------------------------------------------ _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
