- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???
How would you design a real time application for cnc control in c / c++ ???
05 May 2021 03:16 #207924
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
Your errors are mostly typo's.
A "int" in not of type "pos".
When you take your time, you can solve this. And try to code as simple as possible.
Try to use only the std:: lib function's instead of using qt libs. Only use qt lib's if there are no other solutions.
Your errors are mostly typo's.
A "int" in not of type "pos".
When you take your time, you can solve this. And try to code as simple as possible.
Try to use only the std:: lib function's instead of using qt libs. Only use qt lib's if there are no other solutions.
Please Log in or Create an account to join the conversation.
14 May 2021 16:00 - 14 May 2021 23:02 #208814
by udoS
Replied by udoS on topic How would you design a real time application for cnc control in c / c++ ???
Hi Grotius
This call is made periodically to update the values in the HMI.
______________________________________________________
void update_status(){ //function used in display/display.h
const char *cstr = nmlfile.c_str();
RCS_STAT_CHANNEL *stat = new RCS_STAT_CHANNEL(emcFormat, "emcStatus", "xemc", cstr);
___________________________________________________________________________________
So every call you open a NEW channel. I don't see a "close" or "cleanup " or something like that.
I have a 'little' request.
Could you supply a very basic sample in Qt or other c++ app showing the initialisation and communication with linuxcnc over nml. I just don't get it extracted from your Qt_c++_hmi.
Specific: the shared mem semaphore part.
Best Regards
udo
This call is made periodically to update the values in the HMI.
______________________________________________________
void update_status(){ //function used in display/display.h
const char *cstr = nmlfile.c_str();
RCS_STAT_CHANNEL *stat = new RCS_STAT_CHANNEL(emcFormat, "emcStatus", "xemc", cstr);
___________________________________________________________________________________
So every call you open a NEW channel. I don't see a "close" or "cleanup " or something like that.
I have a 'little' request.
Could you supply a very basic sample in Qt or other c++ app showing the initialisation and communication with linuxcnc over nml. I just don't get it extracted from your Qt_c++_hmi.
Specific: the shared mem semaphore part.
Best Regards
udo
Last edit: 14 May 2021 23:02 by udoS.
Please Log in or Create an account to join the conversation.
17 May 2021 11:51 #209217
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
So every call you open a NEW channel. I don't see a "close" or "cleanup " or something like that.
That's correct. During code reverse engineering there is not been added something to close or cleanup the
channel. It's a while ago.
Could you supply a very basic sample in Qt or other c++ app showing the initialisation and communication with linuxcnc over nml.
I think on my github channel there is some info about that. link
About nml i have no more info. I did not use it, or extended the code after above example was made.
So every call you open a NEW channel. I don't see a "close" or "cleanup " or something like that.
That's correct. During code reverse engineering there is not been added something to close or cleanup the
channel. It's a while ago.
Could you supply a very basic sample in Qt or other c++ app showing the initialisation and communication with linuxcnc over nml.
I think on my github channel there is some info about that. link
About nml i have no more info. I did not use it, or extended the code after above example was made.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
31 May 2021 09:42 - 01 Jun 2021 09:16 #210783
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Hi grotius
Can you check project? Problem is same - I include "opencascade.h" in Robot.h and project is crash
dropmefiles.com/VUTzL
Can you check project? Problem is same - I include "opencascade.h" in Robot.h and project is crash
dropmefiles.com/VUTzL
Last edit: 01 Jun 2021 09:16 by TheRoslyak.
Please Log in or Create an account to join the conversation.
05 Jun 2021 14:45 #211218
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
Opencascade must be included in the mainwindow.h file, just as the example does.
You can not include opencascade several times. It will trow error's.
Opencascade must be included in the mainwindow.h file, just as the example does.
You can not include opencascade several times. It will trow error's.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
09 Jun 2021 08:52 - 09 Jun 2021 08:54 #211599
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Hi
My Robot.h is your mainwindow.h
I do this but it didn’t work.
My Robot.h is your mainwindow.h
I do this but it didn’t work.
Last edit: 09 Jun 2021 08:54 by TheRoslyak.
Please Log in or Create an account to join the conversation.
09 Jun 2021 09:45 #211603
by Joco
Replied by Joco on topic How would you design a real time application for cnc control in c / c++ ???
When you say "throws errors" are you referring to compile or running?
I have working code that includes opencascade.h multiple times other files need to reference the definitions. So I know that side of things works. Although you may need to be careful on the order of inclusion. I seem to recall that mattered.
If you are getting run time errors then that is a different kettle of fish.
I have working code that includes opencascade.h multiple times other files need to reference the definitions. So I know that side of things works. Although you may need to be careful on the order of inclusion. I seem to recall that mattered.
If you are getting run time errors then that is a different kettle of fish.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
09 Jun 2021 10:02 #211606
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Error when compile (Build)
Please Log in or Create an account to join the conversation.
09 Jun 2021 10:38 #211609
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
I checked the project. It works. The robot loads. To my surpise he actually uses the qml interface.
I had to set some includepaths. This is because he has a different linux version.
For the rest the code look fine. It's nice too to see code modified by other users.
I checked the project. It works. The robot loads. To my surpise he actually uses the qml interface.
I had to set some includepaths. This is because he has a different linux version.
Warning: Spoiler!
# lcnc
INCLUDEPATH += /usr/lib/ \
/opt/lib/linuxcnc/modules/ \
/opt/include/ \
/usr/include/linuxcnc/
#Hal
INCLUDEPATH+= /opt/linuxcnc/include/ \
/opt/linuxcnc/src/hal/ \
LIBS+= -L/opt/linuxcnc/lib/
LIBS+= -llinuxcnchal
#Opencascade
LIBS+= -L/usr/local/lib/ \
INCLUDEPATH += /usr/local/include/kdl/ \
/usr/local/include/opencascade/ \
/usr/include/eigen3/ \
/usr/include/ \
/usr/local/lib/ \
For the rest the code look fine. It's nice too to see code modified by other users.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
09 Jun 2021 11:05 - 09 Jun 2021 11:09 #211612
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Honestly, I don't understand what has changed
Error appears if I uncommentin Robot.h
I want to connect slider to 3d model, but this string crash all compile
PS. I have been working on the design of the project so far
Can you check forum.linuxcnc.org/38-general-linuxcnc-q...elerations?start=150 topic
Error appears if I uncomment
#include <opencascade.h>
I want to connect slider to 3d model, but this string crash all compile
PS. I have been working on the design of the project so far
Can you check forum.linuxcnc.org/38-general-linuxcnc-q...elerations?start=150 topic
Last edit: 09 Jun 2021 11:09 by TheRoslyak.
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???
Time to create page: 0.110 seconds