How do I find what the linuxcnc status memory buffer contains?
- vmihalca
- Offline
- Platinum Member
Less
More
- Posts: 344
- Thank you received: 21
23 Sep 2021 08:46 - 23 Sep 2021 08:47 #221410
by vmihalca
How do I find what the linuxcnc status memory buffer contains? was created by vmihalca
Hi guys,
I know this question might be more in the linuxcnc developers spectrum, but I don't know if there is a group where the linuxcnc developers discuss, so I ask the question here.
I am looking in how to consume the linuxcnc library from Java/Kotlin as I want to build my custom functionalities in a java based language.
As a starting point, I have the code made by Django Reindard, which was an awesome help in getting me started with this.
Thtough JNI he has managed to obtain a ByteBuffer which is updated by linuxcnc, and periodically, he is parsing that buffer to obtain, position, active codes, machine states.....basically all you would need for an UI.
Just as an example, I am pasting a few lines from his code:
I know this question might be more in the linuxcnc developers spectrum, but I don't know if there is a group where the linuxcnc developers discuss, so I ask the question here.
I am looking in how to consume the linuxcnc library from Java/Kotlin as I want to build my custom functionalities in a java based language.
As a starting point, I have the code made by Django Reindard, which was an awesome help in getting me started with this.
Thtough JNI he has managed to obtain a ByteBuffer which is updated by linuxcnc, and periodically, he is parsing that buffer to obtain, position, active codes, machine states.....basically all you would need for an UI.
Just as an example, I am pasting a few lines from his code:
bufferEntries.put("absPosX", new BufferEntry("absPosX", [b]1464, 8, BufferEntryType.Double));
bufferEntries.put("relPosX", new BufferEntry("relPosX", [b]1536, 8, BufferEntryType.Double));
bufferEntries.put("g5xOffsX", new BufferEntry("g5xOffsX", [b]760, 8, BufferEntryType.Double));
bufferEntries.put("g92OffsX", new BufferEntry("g92OffsX", [b]840, 8, BufferEntryType.Double));
bufferEntries.put("toolOffsX", new BufferEntry("toolOffsX", [b]920, 8, BufferEntryType.Double));
bufferEntries.put("dtgX", new BufferEntry("dtgX", [b]1736, 8, BufferEntryType.Double));
bufferEntries.put("rotationXY", new BufferEntry("rotationXY", [b]912, 8, BufferEntryType.Double));
The parameters with bold, are representing the offset from the buffer on which I can find that specific information.
What I am trying to figure out now, is how can I find what values are written to what offsets.
In what file in the linuxcnc library are these offsets specified, or how do I decode the buffer?
If someone knows the answer or it could guide me to the linuxcnc developers that might know the answer, please let me know!
Thanks in advance!
[/b][/b][/b][/b][/b][/b][/b]
Last edit: 23 Sep 2021 08:47 by vmihalca.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 4957
- Thank you received: 1441
23 Sep 2021 16:22 - 23 Sep 2021 16:27 #221440
by Todd Zuercher
Replied by Todd Zuercher on topic How do I find what the linuxcnc status memory buffer contains?
I don't know the answer to your problem but here is a good place to contact Linuxcnc developers.
sourceforge.net/p/emc/mailman/emc-developers/
(PS Linuxcnc used to be called EMC2 until a law suit made us change it, the old site still uses the old name.)
sourceforge.net/p/emc/mailman/emc-developers/
(PS Linuxcnc used to be called EMC2 until a law suit made us change it, the old site still uses the old name.)
Last edit: 23 Sep 2021 16:27 by Todd Zuercher.
Please Log in or Create an account to join the conversation.
Time to create page: 0.047 seconds