Variables in HAL from INI

More
16 Jul 2013 23:32 #36716 by btvpimill
Variables in HAL from INI was created by btvpimill
It appears to me we can use a limited variable set in a HAL file. (Prolly better to think of it as a macro substitution) as in this example:
setp hm2_[HOSTMOT2](BOARD).0.stepgen.00.dirsetup        [AXIS_0]DIRSETUP

Now of course I have a question, why does board need () around it but not DIRSETUP?

can I name my own section and bring values to HAL in this same manner? Are there any published guidelines for doing this? In all my reading over the last 2+ years, I have never noticed them. Not a big surprise. And I assume there can be no actual computing such as X+Y.

Please Log in or Create an account to join the conversation.

More
16 Jul 2013 23:50 - 16 Jul 2013 23:56 #36719 by ArcEye
Replied by ArcEye on topic Variables in HAL from INI
Hi

My SWAG would be that [INI_SECTION] INIVALUE returns a value
and [INI_SECTION] (INIVALUE) allows its use as a string literal instead of a value

(a bit like VALUE and $(VALUE) in bash)

I have never seen documentation for this either, you might find the answers in halcmd and what it does when it parses inifiles and executes .hal files

And I assume there can be no actual computing such as X+Y.


Try it, see what value gets passed for say ( [AXIS_0]DIRSETUP + [AXIS_0]DIRSTEP ) (might have to play with the syntax)

regards
Last edit: 16 Jul 2013 23:56 by ArcEye.
The following user(s) said Thank You: btvpimill

Please Log in or Create an account to join the conversation.

More
17 Jul 2013 01:37 #36722 by btvpimill
Replied by btvpimill on topic Variables in HAL from INI
I would say your SWAG (although maybe just WAG? snicker) is prolly spot on. At least it makes sense - passing strings or actual values.

As for the try it part, I will give it a go, though not sure how I will prove it to myself what if anything happened. But the value passing part could be VERY nice to use in my setup!.

Thanks ArcEye

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum