using c++ to write HAL module in linuxcnc

More
16 Mar 2021 14:25 #202479 by mikeshan97
using c++ to write HAL module in linuxcnc was created by mikeshan97
I'm new to linuxcnc, and I currently want to implement a chatter detection module as a linuxncnc HAL module.
the data acquisition module is written as a hal module already, and it uses C.
my plan is to write another CPP module since there is a more comprehensive library on digital sensor processing. And then using the data acquired from the above module via shared memory to calculate a bool variable that represents if the machine is in a chatter state or not.
Can someone tell me if there is anything wrong with my plan? Or any other advice is welcomed!

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

More
17 Mar 2021 00:31 #202551 by Roiki
Replied by Roiki on topic using c++ to write HAL module in linuxcnc
Depends if you're talking about realtime or userspace components. Realtime components have to be written in C. For userspace you should be able to use C++ with the C api.

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

More
17 Mar 2021 07:49 #202568 by Grotius
Replied by Grotius on topic using c++ to write HAL module in linuxcnc
Hi Roiki,

If you want to compile with c++ you need to install the linuxcnc dev files.
And you need the linuxcnc compile flags :

To compile your c++ code, this should be enough :
INCLUDEPATH += yourpath/linuxcnc/src/hal/utils
LIBS += -Iinclude -Isrc/emc/rs274ngc -Llib -lnml -llinuxcnc -llinuxcnchal -llinuxcncini -DULAPI -lposemath

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

More
17 Mar 2021 07:56 #202569 by mikeshan97
Replied by mikeshan97 on topic using c++ to write HAL module in linuxcnc
Thanks for your advice! I'll keep that in mind!

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

Time to create page: 0.068 seconds
Powered by Kunena Forum