Visualizing hal nets with graphviz
- kostas
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 111
- Thank you received: 6
05 Nov 2011 13:01 #14592
by kostas
Visualizing hal nets with graphviz was created by kostas
I'm learning some python and I needed a quick hack to get a visual map on hal nets, so I made this little python script that reads input from "halcmd show" and outputs a graphviz file. Maybe you will find it useful.
You need to:
1) install graphviz, using "sudo apt-get install graphviz"
2) download the hal_sigs_graphviz.py attachment in a directory of your choice.
3) make a shell script inside the same dir, with the following lines in it and run it:
Attached is an example of what I get when running it with my (stepconf generated) hal configuration I use on my first cnc router. Tables are components and circles are nets.
I will probably add more features like colors and some fine tuning on how graphviz outputs the image, when I find some time to learn more about this excellent application. But it's probably good enough for a quick visualization as it is now.
You need to:
1) install graphviz, using "sudo apt-get install graphviz"
2) download the hal_sigs_graphviz.py attachment in a directory of your choice.
3) make a shell script inside the same dir, with the following lines in it and run it:
halcmd -s show pin | grep "==" > pin.out
halcmd -s show sig | grep -v "^$" > sig.out
python hal_sigs_graphviz.py > gv.in
dot -Tpng gv.in > gv.png
Attached is an example of what I get when running it with my (stepconf generated) hal configuration I use on my first cnc router. Tables are components and circles are nets.
I will probably add more features like colors and some fine tuning on how graphviz outputs the image, when I find some time to learn more about this excellent application. But it's probably good enough for a quick visualization as it is now.
The following user(s) said Thank You: TurBoss, ikkuh, Muecke
Please Log in or Create an account to join the conversation.
- kostas
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 111
- Thank you received: 6
05 Nov 2011 13:05 #14594
by kostas
Replied by kostas on topic Visualizing hal nets with graphviz
Forum does not let me attach a .py file, so I renamed it as .txt. You need to rename it back as a .py
I also had to resize the image file.
I also had to resize the image file.
The following user(s) said Thank You: tjtr33, TurBoss, Muecke
Please Log in or Create an account to join the conversation.
- Muecke
-
- Offline
- Platinum Member
-
Less
More
- Posts: 832
- Thank you received: 89
29 Mar 2022 13:57 #238609
by Muecke
Replied by Muecke on topic Visualizing hal nets with graphviz
-- DE --
DANKE für das kleine jedoch sehr Effiziente Tool.
Es hilft mir sehr die HAL Daten einzuordnen was ich erstelle oder auch nicht .
DANKE, machen Sie weiter so!
Beim Ausführen hatte ich Probleme, mir war nicht bewusst das LinuxCNC gestartet sein muss. Es wird die Aktuelle HAL von LinuxCNC dargestellt.
-- EN --
THANK YOU for the small but very efficient tool.
It helps me a lot to classify the HAL data what I create or not .
THANK YOU, keep up the good work!
I had problems running it, I wasn't aware that LinuxCNC had to be started. The current HAL of LinuxCNC is displayed.
DANKE für das kleine jedoch sehr Effiziente Tool.
Es hilft mir sehr die HAL Daten einzuordnen was ich erstelle oder auch nicht .
DANKE, machen Sie weiter so!
Beim Ausführen hatte ich Probleme, mir war nicht bewusst das LinuxCNC gestartet sein muss. Es wird die Aktuelle HAL von LinuxCNC dargestellt.
-- EN --
THANK YOU for the small but very efficient tool.
It helps me a lot to classify the HAL data what I create or not .
THANK YOU, keep up the good work!
I had problems running it, I wasn't aware that LinuxCNC had to be started. The current HAL of LinuxCNC is displayed.
The following user(s) said Thank You: kostas
Please Log in or Create an account to join the conversation.
- Muecke
-
- Offline
- Platinum Member
-
Less
More
- Posts: 832
- Thank you received: 89
30 Mar 2022 18:33 - 03 Apr 2022 08:17 #238783
by Muecke
Replied by Muecke on topic Visualizing hal nets with graphviz
Last edit: 03 Apr 2022 08:17 by Muecke.
Please Log in or Create an account to join the conversation.
- pgf
- Offline
- Senior Member
-
Less
More
- Posts: 65
- Thank you received: 8
25 Mar 2025 22:56 #324928
by pgf
Replied by pgf on topic Visualizing hal nets with graphviz
I took the liberty of upgrading the original python, posted above, from python2 to python3. Attached. Somehow the filename got changed somewhere along the way. Sorry 'bout that.
The following user(s) said Thank You: kostas, tommylight
Please Log in or Create an account to join the conversation.
- kostas
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 111
- Thank you received: 6
27 Mar 2025 17:42 #325079
by kostas
Replied by kostas on topic Visualizing hal nets with graphviz
Hey, nice to know that this has been used by someone!
Please Log in or Create an account to join the conversation.
- pgf
- Offline
- Senior Member
-
Less
More
- Posts: 65
- Thank you received: 8
27 Mar 2025 19:20 #325091
by pgf
Replied by pgf on topic Visualizing hal nets with graphviz
I didn't say I'd used it. 
Okay, okay, I did! It's definitely more useful for looking at small sections of the HAL.
The whole thing is a little too much for the tool, but if there's a subset that you're trying to understand better, it's definitely useful.
Thanks for writing it -- I found it because I was setting out to do the exact same thing, also using graphviz, but decided I should look around to see what was already available. You saved me a bunch of work!
paul

Okay, okay, I did! It's definitely more useful for looking at small sections of the HAL.
The whole thing is a little too much for the tool, but if there's a subset that you're trying to understand better, it's definitely useful.
Thanks for writing it -- I found it because I was setting out to do the exact same thing, also using graphviz, but decided I should look around to see what was already available. You saved me a bunch of work!
paul
Please Log in or Create an account to join the conversation.
Time to create page: 0.112 seconds