587,035 active members*
2,908 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2010
    Posts
    0

    Creating a new module in HAL

    Hi all,

    I was wondering if it is possible to create a new module in HAL so that i can customize my own functions, pins and parameters.

    Something like "loadrt pid" but instead i would like to have "loadrt MY_MODULE".

    Someone mentioned using .comp. Is it possible using comp? And how to go about doing it? Cuz i keep getting the following message when i type "$ comp ddt.comp"

    "The program 'comp' can be found in the following packages:
    * mailutils-mh
    * nmh
    Try: sudo apt get install "

    Thanks.

    BQ

  2. #2
    Join Date
    Jul 2003
    Posts
    1754
    Yes - you should be able to do that.

    read up on
    Comp: a tool for creating HAL components

    also - take a look at other comps

    git.linuxcnc.org Git - emc2.git/tree - src/hal/components/

    sam

    love to see your fuzzy pid

  3. #3
    Join Date
    Nov 2005
    Posts
    496
    you have to add the development packages to compile components.
    look here:
    EMC Documentation Wiki: ContributedComponents

  4. #4
    Join Date
    Sep 2010
    Posts
    0
    I tried installing emc2-dev by '$ sudo apt-get install emc2-dev'
    But the following error msg keep coming up.

    dpkg: error processing /var/cache/apt/archives/emc2-dev_1%3a2.4.4_i386.deb (--unpack):
    trying to overwrite '/usr/share/man/man1/comp.1.gz', which is also in package nmh 0:1.3-1
    dpkg-deb: subprocess paste killed by signal (Broken pipe)
    Processing triggers for man-db ...
    Errors were encountered while processing:
    /var/cache/apt/archives/emc2-dev_1%3a2.4.4_i386.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    Help?

  5. #5
    Join Date
    Nov 2005
    Posts
    496
    hmm not sure what that means but I might guess that the package is already installed or the versions are wrong.

    How did you get EMC and what version is it? What distribution on Ubuntu are you using?

    Are you trying to compile the comp file correctly now?
    (The last way you said you tried it is not right)
    You did read the instructions right

    Chris M

  6. #6
    Join Date
    Sep 2010
    Posts
    0
    Ok it seems like the comp command is working after I restarted my computer, but there are still some minor issues.

    "$ comp ddt.comp" creates a ddt.c file in my desktop

    But when i type "$ comp --install ddt.comp" to install the .ko into my emc2 dir
    it outputs an error message Unable to locate Makefile.modinc

    Am I still missing anything?

  7. #7
    Join Date
    Sep 2010
    Posts
    0
    Well, after i reformatted my whole system and reinstall emc2 followed by emc2-dev there is now a different error after i tried compiling the module

    "$ comp install BQ.comp"

    WARNING: "hal_init" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "rtapi_print_msg" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "hal_exit" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "hal_export_funct" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "hal_malloc" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "rtapi_get_msg_level" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "hal_pin_bit_newf" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "hal_pin_s32_newf" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "rtapi_snprintf" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "hal_ready" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "hal_pin_float_newf" [/tmp/tmpXwbloT/BQ.ko] undefined!
    WARNING: "rtapi_set_msg_level" [/tmp/tmpXwbloT/BQ.ko] undefined!
    CC /tmp/tmpXwbloT/BQ.mod.o
    LD [M] /tmp/tmpXwbloT/BQ.ko
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-122-rtai'
    cp BQ.ko /usr/realtime-2.6.32-122-rtai/modules/emc2/
    cp: cannot create regular file `/usr/realtime-2.6.32-122-rtai/modules/emc2/BQ.ko': Permission denied
    make: *** [install] Error 1


    never seen this error previously..

  8. #8
    Join Date
    Apr 2004
    Posts
    40
    Try prepending sudo:
    sudo comp install BQ.comp

  9. #9
    Join Date
    Oct 2011
    Posts
    0
    I had the same problem.

Similar Threads

  1. laser module to a new cnc
    By stregoi in forum Laser Engraving / Cutting Machine General Topics
    Replies: 4
    Last Post: 05-19-2010, 07:20 AM
  2. MasterCam art module
    By gabi68 in forum Mastercam
    Replies: 1
    Last Post: 02-25-2008, 04:21 AM
  3. if you need ic and module,please tell me.
    By keithshen in forum Want To Buy...Need help!
    Replies: 0
    Last Post: 01-07-2008, 02:07 PM
  4. Lathe Module
    By rodneydeeeee in forum BobCad-Cam
    Replies: 9
    Last Post: 08-28-2007, 12:09 AM
  5. Please need help on I/O Module
    By yeager in forum CNC Machine Related Electronics
    Replies: 9
    Last Post: 01-13-2006, 03:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •