After Tom P. manually converted part of a HAL configuration into "dot format" to produce a nice png drawing, I have experimented with doing it automatically by parsing the output of halcmd. Here is the program, as well as some of the results.

The example files show the simulator mill (with check_constraints.hal loaded) and the simulator lathe.

With emc running and halcmd on your PATH, just run net2dot to create a .dot file, or pipe net2dot to dot to render an image:

    $ python net2dot.py > mymachine.dot
    $ python net2dot.py | dot -Tpng > mymachine.png

Update: A new version of net2dot also understands 'linkXX' commands, so it can be used on .hal files in addition to to working from a running hal. It will infer directions from arrows when they are given. Run it like so:

    $ python net2dot.py core_stepper.hal standard_pinout.hal > mill.dot
    $ python net2dot.py core_stepper.hal standard_pinout.hal | dot -Tpng > mill.png
Traceback (most recent call last):
  File "/home/jepler/gamma.unpythonic.net/index.cgi", line 766, in markup
    text = getattr(this_module, 'markup_'+command)(text, meta, **thing_context)
  File "/home/jepler/gamma.unpythonic.net/index.cgi-data/_lib/local_code.py", line 414, in markup_showfiles
    string.join(file_list, u'') +
AttributeError: module 'string' has no attribute 'join'

(originally posted on the AXIS blog)