- Posts: 2419
- Thank you received: 0
How would you design a real time application for cnc control in c / c++ ???
5 years 5 months ago #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 to join the conversation.
5 years 5 months ago #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
Please Log in to join the conversation.
5 years 5 months ago #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 to join the conversation.
- TheRoslyak
- Offline
- Elite Member
-
Less
More
- Posts: 238
- Thank you received: 0
5 years 5 months ago #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
Please Log in to join the conversation.
5 years 4 months ago #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 to join the conversation.
- TheRoslyak
- Offline
- Elite Member
-
Less
More
- Posts: 238
- Thank you received: 0
5 years 4 months ago #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.
Please Log in to join the conversation.
5 years 4 months ago #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 to join the conversation.
- TheRoslyak
- Offline
- Elite Member
-
Less
More
- Posts: 238
- Thank you received: 0
5 years 4 months ago #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 to join the conversation.
5 years 4 months ago #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!
Code:
# 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 to join the conversation.
- TheRoslyak
- Offline
- Elite Member
-
Less
More
- Posts: 238
- Thank you received: 0
5 years 4 months ago #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 uncomment
in 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
Code:
#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
Please Log in to join the conversation.
Time to create page: 0.281 seconds
