profibus.hal 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # ---------------------------------------
  2. # --- PROFIBUS DP
  3. # --- LinuxCNC HAL configuration file
  4. # ------
  5. # --- Load the pyprofibus HAL userspace module ---
  6. #
  7. # Parameters:
  8. # --loglevel LVL : Change the log level.
  9. #
  10. # --nice NICE : Renice the process. -20 <= NICE <= 19.
  11. # Default: Do not renice.
  12. #
  13. # The last parameter is the configuration file describing the PROFIBUS.
  14. #
  15. loadusr -Wn profibus pyprofibus-linuxcnc-hal pyprofibus.conf
  16. # --- Enable the used master-to-slave pins ---
  17. # MOSI = MasterOutputSlaveInput = Data flow from PB master to PB slave.
  18. # All master-to-slave pins are deactivated by default.
  19. # So all master-to-slave pins connected below, should be activated here by writing
  20. # a '1' to the '.active' pin.
  21. # Deactivated master-to-slave pins will not be forwarded from LinuxCNC to the PROFIBUS.
  22. setp profibus.slave.8.mosi.bit.0.0.active 1
  23. setp profibus.slave.8.mosi.bit.0.1.active 1
  24. setp profibus.slave.8.mosi.bit.1.0.active 1
  25. setp profibus.slave.8.mosi.bit.1.1.active 1
  26. #setp profibus.slave.8.mosi.float.4.active 1
  27. #setp profibus.slave.8.mosi.float.8.active 1
  28. #setp profibus.slave.8.mosi.float.12.active 1
  29. # --- Connect master-to-slave pins ---
  30. # MOSI = MasterOutputSlaveInput = Data flow from PB master to PB slave.
  31. net heartbeat => profibus.slave.8.mosi.bit.0.0
  32. net estop-out-not => profibus.slave.8.mosi.bit.0.1
  33. net spindle-cw => profibus.slave.8.mosi.bit.1.0
  34. net spindle-ccw => profibus.slave.8.mosi.bit.1.1
  35. #net xpos-cmd => profibus.slave.8.mosi.float.4
  36. #net ypos-cmd => profibus.slave.8.mosi.float.8
  37. #net zpos-cmd => profibus.slave.8.mosi.float.12
  38. # --- Enable the used slave-to-master pins ---
  39. # MISO = MasterInputSlaveOutput = Data flow from PB slave to PB master.
  40. # All slave-to-master pins are deactivated by default.
  41. # So all slave-to-master pins connected below, should be activated here by writing
  42. # a '1' to the '.active' pin.
  43. # Deactivated slave-to-master pins will not be forwarded from the PROFIBUS to LinuxCNC.
  44. setp profibus.slave.8.miso.bit.0.0.active 1
  45. setp profibus.slave.8.miso.bit.0.1.active 1
  46. setp profibus.slave.8.miso.bit.0.2.active 1
  47. setp profibus.slave.8.miso.bit.0.3.active 1
  48. # If the slave disconnects, then reset all slave-to-master pins to zero.
  49. setp profibus.slave.8.config.disconnect-clear-pins 1
  50. # --- Connect slave-to-master pins ---
  51. # MISO = MasterInputSlaveOutput = Data flow from PB slave to PB master.
  52. net limit-x <= profibus.slave.8.miso.bit.0.0
  53. net limit-y <= profibus.slave.8.miso.bit.0.1
  54. net limit-z <= profibus.slave.8.miso.bit.0.2
  55. net estop-in-not <= profibus.slave.8.miso.bit.0.3
  56. # Always keep this at the end of this file.
  57. # This will activate data transfer between pyprofibus and LinuxCNC.
  58. setp profibus.config.ready 1