LinuxCNC for automation

More
06 Aug 2020 18:37 - 06 Aug 2020 18:41 #177541 by Grotius
Replied by Grotius on topic LinuxCNC for automation
Hi,

Today added the gcode preview into the opengl. I think you can call it a gcode parser. It works fine.
If you replace in the axis.ini file :

# Name of display program, e.g., axis
#DISPLAY = axis
DISPLAY = QT_Lcnc_interface

It will start as stand alone gui if the QT_Lcnc_interface file is in the bin folder.

Source code is attached.

I think i can use some help. A few c++ commands are not working :

-feed rate override
-max feedrate
-adaptive feed

When calling those functions i get error : ../linuxcnc/include/emc_nml.hh:548: undefined reference to `StateTag::StateTag()'

C++ code looks like :
const char *cstr = nmlfile.c_str();
    RCS_CMD_CHANNEL *c = new RCS_CMD_CHANNEL(emcFormat, "emcCommand", "xemc", cstr);
    EMC_TRAJ_SET_FO_ENABLE m;
    m.mode=1;
    c->write(&m);

It looks like m.tag has to have a value and be part of above code. But wich value must the tag have?
Tag is abracadabra for me.
Any idea's?



Todo is preview current gcode line in the gcode editor.
And try to make hal connections.
Attachments:
Last edit: 06 Aug 2020 18:41 by Grotius.
The following user(s) said Thank You: Clive S

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

More
07 Aug 2020 08:18 #177584 by Himarc3D
Replied by Himarc3D on topic LinuxCNC for automation

Hi Himarc,

The buckie videos on youtube are nice to follow.
If you compare buckies examples to my code style, you will see i use header only if possible.
Most of time i use a header file to do calculation's instead of a class wich contains a .h and .cpp file.

Private, public and so on don't interest me. The only thing that interest me is a compact program that does the job.
The downside of header only is, sometimes you cannot include a header twice in the same program.

Qt, look at : refractor -> rename under cursor
Qt, auto indent selection

For documentation i learned to use the standard c++ library (std) as much as possible. So when i can avoid a qt library i do so to
make program's more cross platform compatible.
If i need to know something about c++ i google for a example.

Warning: Spoiler!


Good luck. What will you write for a program, will it contain a graphical interface with opengl?

my background is from arduino, plc i have checked qtpyvcp but i dont know python yet and into industry they use a lot C/C++ so i think is better stay into the C/C++ path to learn. what i have wrote untill now i think my stuff is in plain C...very basic stuff.
what im looking for now is the way too support multiple language like that:
www.ics.com/blog/dynamic-language-selection-qt
doc.qt.io/qt-5/qtlinguist-index.html
probably ill use gmocappy or axis at begin and after that i use qt c++ with language support when i get the machine running consistently i can work in learn qt
i wish in near future help you into your effort if not in code i can at least help translated (thank you for give to us your code) but now im reading manuals and topics here, waiting my Mesa 7i76, motors, drivers etc to start, im very busy reading many new stuff i never used ballscrew, i just used home switch until now...ill use rodw idea for limit and home switch.
forum.linuxcnc.org/38-general-linuxcnc-q...ation?start=0#124659
The following user(s) said Thank You: Grotius

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

More
07 Aug 2020 20:35 - 07 Aug 2020 20:49 #177650 by Grotius
Replied by Grotius on topic LinuxCNC for automation
Hi Himarc,

Very nice !
I hope you make progess with Qt c++.

.ill use rodw idea for limit and home switch. Nice. Just read and learn from others.

Mesa 7i76 On youtube there is a german guy how explain how to program a mesa. Very interesting. I like the Mesa fpga idea. but never used it.

i wish in near future help you into your effort
Are you good in mathematics? Or maybe making cool program buttons to integrate in the gui.?

Today i did some work to try to connect the c++ app to hal.
I got no luck the first hours.

Then i decided to copy parts of the c++ halcommand code into my app to see if we can get lucky.
And that worked.

Now we can set pins, signals and parameters, etc very easy from c++

Look in the attachment, for hal/halsextion.h, the code is still raw, but is working.

Here we fill in the "name" and the "value" of the component and we are done !
//sets means set signal
int do_sets_cmd(char *name, char *value)

//setp means set parameter
int do_setp_cmd(char *name, char *value)

To save copy time i did make a symbolic link to the linuxcnc/bin folder from my qt compile directory.
Otherwise i had to copy the new compiled executable every time to the linuxcnc/bin folder.

Also added halshow to the app, so we can check the port and pins.

Tested 2 signals, set parameter motion.adaptive-feed from 1 to 0.
Set up a signal in c++ code, named xxx, change value from 0 to 120.

Source code attached.

Attachments:
Last edit: 07 Aug 2020 20:49 by Grotius.

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

More
08 Aug 2020 01:22 - 08 Aug 2020 01:51 #177673 by Himarc3D
Replied by Himarc3D on topic LinuxCNC for automation
Im average in mathematics. I think i can make buttons but usually i make HMI very simple, very basic, very boring...i try to follow SCADA/HMI standards.
www.asee.org/public/conferences/8/papers/3605/download

www.controleng.com/articles/how-to-best-design-an-hmi-system/
www.hmicons.com/2019/07/27/using-color-in-hmi-graphics-design/
after i send my machine to the client (total 8) the next one ill focus work into the HMI, customise it so i think i can help making buttons for you, i can use basic inkscape and gimp for my needs.
Can you show to me what is cool buttons for you?
Probably i will use you GUI and put one tab for camera and in all tabs one button to switch language, no need logout, here at the client fabric floor the operator and the supervisor dont have the same native language, for the operator is very simple layout to use, something you just need little time to understand, minimalist, simple because the operator rotation is high...usually they just take and put the work piece into the machine.
Last edit: 08 Aug 2020 01:51 by Himarc3D.
The following user(s) said Thank You: Grotius

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

More
09 Aug 2020 19:56 - 12 Aug 2020 11:33 #177774 by Grotius
Replied by Grotius on topic LinuxCNC for automation
Hi,

I think i can make buttons but usually i make HMI very simple, very basic, very boring
Perfect for this job. We don't like HMI cristmass tree's.

Can you show to me what is cool buttons for you?
If you can do it like this. You are the men, you got 2 fish !


Probably i will use you GUI and put one tab for camera
Do you want to integrate camara logic into the app? Then i need more info.

and in all tabs one button to switch language
Nice !

Okey i did write some code today.

1. The gcode preview is now interactive with the program.
2. We got several status connections now.
3. The most of the gui buttons and sliders are working except : spindle + and -, program reload.
4. The c++ code i refined some bit to make it usefull for beginning c++ users.

For every linux command or call i made a function. So for mdi command you simple write in c++:
mdi("G0 X0 Y0");

Just take a look at the code. If you want to try the app. You have to download QT c++ and open the project file.
When compiled place the executable file into the linuxcnc bin folder. Change display in the ini file to executable name and
you are done!

Result for today.

Source code attached.

Edit : For latest code update :
github.com/grotius-cnc/QT_C-_Linuxcnc_in...ithub_screenshot.png
The most of code is done. Read the readme file for my comments.
Attachments:
Last edit: 12 Aug 2020 11:33 by Grotius.
The following user(s) said Thank You: tommylight, Clive S, Himarc3D

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

Time to create page: 0.098 seconds
Powered by Kunena Forum