create GUI and use hal library!

More
22 Mar 2021 18:14 #203274 by veroski
Hello everybody. i am new to linuxcnc and i have a question for you. can i create a GUI and use linucnc libraries and then hal? I would like to control my parallel port stepper motors at the moment using my graphical interface. I have the basic knowledge of c. can you give me some ideas? which manual to follow or documentation? thank you ;)

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

More
22 Mar 2021 19:12 - 22 Mar 2021 19:27 #203283 by Grotius
Hi,

i am new to linuxcnc
Welcome at the linuxcnc forum. You can start with c. But you better start with c++ right away, unless
you want to become the kernel module specialist of this forum. Then please stay at c.
Anyway i hope you will enjoy it over here for many years to come !!

If you install linuxcnc, you have hal working.
You don't have to use linuxcnc in fact, you can only profit from the hal environment this way.

Then create hal file with stepgenerator, ltp port(s) etc.
Test this hal file with existing linuxcnc solutions, to be sure the halfile is ok.
You can also let linuxcnc stepconf. wizard produce a halfile for you. Ltp halfile's work trough this way.

Then connect your c app to hal and you are ready.

This is a c++ example. But for c you know what to do.
Use compile flags. And be sure you have linuxcnc build from source. (dev)

This should be oke to compile your c app.
Warning: Spoiler!


header file :
Warning: Spoiler!


source file :
Warning: Spoiler!


In the source file. First a user hal component is made.
When this is okey at the end. It load's your halfile.
Then everything is working.

So realize yourself this is a 2 stage HAL startup sequence.

Oke good luck !!
Last edit: 22 Mar 2021 19:27 by Grotius.

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

More
22 Mar 2021 22:12 #203304 by newbynobi
It might be easier to use python as interface to the GUI, as there are tutorials and also ready to use Guis to steel code from :)

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

More
23 Mar 2021 01:05 #203326 by andypugh
Most of the GUIs in LinuxCNC use Python. Though Axis makes use of Tcl, and the original Mocca GUI (that Gmoccapy is styled after) was written in Pascal.

I do a lot of C, but for a GUI I would go straight to Python.

I haven't been keeping up to date with the developments in QT, but you can look at Gscreen as a good starting point for a custom GUI. (but it might be outmoded now)
linuxcnc.org/docs/2.8/html/gui/gscreen.html
Talking of QT:
linuxcnc.org/docs/2.8/html/gui/qtdragon.html

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

More
23 Mar 2021 05:12 #203349 by newbynobi
may be there is already exactly the GUI you need, but to check we would need to know exactly what requirements you have to your GUI. Also my GUI gmoccapy may be a starting point, as it is highly customizable.

Norbert

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

More
23 Mar 2021 12:00 #203380 by veroski
thanks to all guys I will update you on this

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

Time to create page: 0.256 seconds
Powered by Kunena Forum