Reading Hal pin value in G-Code
- mighty_mick
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 37
- Thank you received: 5
08 Jan 2024 10:01 #290195
by mighty_mick
Reading Hal pin value in G-Code was created by mighty_mick
Hello.
Recently i've encountered issue about reading hal pin value from gcode. Then, i followed steps that has been shared in this forum and i've been able to read hal pin values in my G-code except one little problem by setting FEATURES=12 in my ini file.
As you know, interpreter reads hal pins when it gets started. After that, it reads always same value. The problem is, i am trying make a process automatic, and the best way to implement this automatization is using g-code. When machine moves, the pin that i am reading is changing (i am measuring something inside this hal component). It might be other couple of ways to do it, but i want to do it with g-code, so i need to read hal pin value in that time.
Is there any way to make this in g-code? I have knowledge about preset global variables in g-code. And they are actually implementing this at the core. The reason that i am saying this is, the X,Y,Z coordinates for example, they are actually stored in a hal component and with preset global variables, we are actually accessing whatever their value is in that time.
Here is my ideas:
* Recompiling RS74 interpreter, adding new preset variables, replacing with old one (difficulty: hard)
* Making this automatization with python. It gives me ability to read Machine variables, measurement data at the same time.
The reason that i don't want to do it with python is i want to make everyone understand about it. And writing G-code is usually easier than writing python code. (this is my idea.) The process is gonna be like one hal component and the g-code that logs measurement and machine coordinates stuff. It's like plug and play.
And i am also more curious about recompiling RS274 interpreter, if you have experience about it, i would be greatful. Actually i have experience about compiling machinekit and linuxcnc softwares and making contact with programmers in this context would be very good.
Thank you for your time, if you share your knowledge with me, i appreciate that.
Berkay.
Recently i've encountered issue about reading hal pin value from gcode. Then, i followed steps that has been shared in this forum and i've been able to read hal pin values in my G-code except one little problem by setting FEATURES=12 in my ini file.
As you know, interpreter reads hal pins when it gets started. After that, it reads always same value. The problem is, i am trying make a process automatic, and the best way to implement this automatization is using g-code. When machine moves, the pin that i am reading is changing (i am measuring something inside this hal component). It might be other couple of ways to do it, but i want to do it with g-code, so i need to read hal pin value in that time.
Is there any way to make this in g-code? I have knowledge about preset global variables in g-code. And they are actually implementing this at the core. The reason that i am saying this is, the X,Y,Z coordinates for example, they are actually stored in a hal component and with preset global variables, we are actually accessing whatever their value is in that time.
Here is my ideas:
* Recompiling RS74 interpreter, adding new preset variables, replacing with old one (difficulty: hard)
* Making this automatization with python. It gives me ability to read Machine variables, measurement data at the same time.
The reason that i don't want to do it with python is i want to make everyone understand about it. And writing G-code is usually easier than writing python code. (this is my idea.) The process is gonna be like one hal component and the g-code that logs measurement and machine coordinates stuff. It's like plug and play.
And i am also more curious about recompiling RS274 interpreter, if you have experience about it, i would be greatful. Actually i have experience about compiling machinekit and linuxcnc softwares and making contact with programmers in this context would be very good.
Thank you for your time, if you share your knowledge with me, i appreciate that.
Berkay.
Please Log in or Create an account to join the conversation.
- Aciera
- Away
- Administrator
Less
More
- Posts: 4001
- Thank you received: 1728
08 Jan 2024 10:28 - 08 Jan 2024 10:31 #290197
by Aciera
Replied by Aciera on topic Reading Hal pin value in G-Code
Generally the problem with reading hal-pins in gcode is that the read ahead might actually do it before machine movement actually reaches the relevant line in the gcode.
I don't know which version you are using but 'FEATURES' have been removed from the INI a while ago:
linuxcnc.org/docs/devel/html/config/ini-config.html
I don't know which version you are using but 'FEATURES' have been removed from the INI a while ago:
linuxcnc.org/docs/devel/html/config/ini-config.html
Last edit: 08 Jan 2024 10:31 by Aciera.
Please Log in or Create an account to join the conversation.
- mighty_mick
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 37
- Thank you received: 5
08 Jan 2024 11:21 #290205
by mighty_mick
Replied by mighty_mick on topic Reading Hal pin value in G-Code
This is my 'linuxcnc_var all' command output.
LINUXCNCVERSION=0.1
REALTIME=/bin/realtime
SIMULATOR=@SIMULATOR@
LINUXCNCVERSION=0.1
REALTIME=/bin/realtime
SIMULATOR=@SIMULATOR@
Please Log in or Create an account to join the conversation.
Time to create page: 0.047 seconds