- Posts: 20
- Thank you received: 1
How to read "Machine configuration directory" in HAL userspace component
- freisei
- Offline
- Junior Member
-
Less
More
5 years 10 months ago #193107
by freisei
How to read "Machine configuration directory" in HAL userspace component was created by freisei
Hi!
i am writing a timeinterval-component, and i want to save same data in configuration-directory.
I have often seen the os.environ 'CONFIG_DIR' in python - i think this is what i need.
If i try to get this in c i get an empty variable:
my componet was loaded after linuxcnc was startet with
Is there a header-file to include to get more of linuxcnc-environment?
Greets from Bavaria
Freisei
i am writing a timeinterval-component, and i want to save same data in configuration-directory.
I have often seen the os.environ 'CONFIG_DIR' in python - i think this is what i need.
If i try to get this in c i get an empty variable:
Code:
const char* s = getenv("CONFIG_DIR");
printf("CONFIG_DIR :%s\n",(s!=NULL)? s : "getenv returned NULL");
printf("end test\n");
my componet was loaded after linuxcnc was startet with
Code:
halcmd loadusr -W timeinterval filename=lubrication_timeinterval.sav
Is there a header-file to include to get more of linuxcnc-environment?
Greets from Bavaria
Freisei
Please Log in or Create an account to join the conversation.
- freisei
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 1
5 years 10 months ago #193169
by freisei
Replied by freisei on topic How to read "Machine configuration directory" in HAL userspace component
Hi,
i´ve found that the current working directory is the config-dir, when the component is loaded from linuxcnc himself/halfile.
But for develement it would be great if someone know how to access the "config_dir" Varaible.
Greets from Bavaria
Freisei
i´ve found that the current working directory is the config-dir, when the component is loaded from linuxcnc himself/halfile.
But for develement it would be great if someone know how to access the "config_dir" Varaible.
Greets from Bavaria
Freisei
Please Log in or Create an account to join the conversation.
- udoS
- Offline
- Elite Member
-
Less
More
- Posts: 216
- Thank you received: 25
4 years 1 day ago #255544
by udoS
Replied by udoS on topic How to read "Machine configuration directory" in HAL userspace component
@
freisei
Hallo freisei
did you find a solution getting the "config_dir" programmatically;
Best Regards
Hallo freisei
did you find a solution getting the "config_dir" programmatically;
Best Regards
Please Log in or Create an account to join the conversation.
- freisei
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 1
3 years 11 months ago #256014
by freisei
Replied by freisei on topic How to read "Machine configuration directory" in HAL userspace component
no sorry.
Please Log in or Create an account to join the conversation.
- udoS
- Offline
- Elite Member
-
Less
More
- Posts: 216
- Thank you received: 25
3 years 11 months ago #257248
by udoS
Replied by udoS on topic How to read "Machine configuration directory" in HAL userspace component
Hi @freisei
I found a way to get the ini Directory; if thats what you where looking for;
Best Regards
I found a way to get the ini Directory; if thats what you where looking for;
Best Regards
Please Log in or Create an account to join the conversation.
- freisei
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 1
3 years 11 months ago #257307
by freisei
Replied by freisei on topic How to read "Machine configuration directory" in HAL userspace component
Hi udoS,
fine!
Would be great if you share your answer, so others can benefit from it, too.
Thanks!
fine!
Would be great if you share your answer, so others can benefit from it, too.
Thanks!
Please Log in or Create an account to join the conversation.
Time to create page: 0.296 seconds