awlsim.hal 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # ---------------------------------------
  2. # --- Awlsim
  3. # --- LinuxCNC HAL configuration file
  4. # ------
  5. # --- Load the awlsim HAL userspace module ---
  6. #
  7. # Parameters:
  8. # --listen HOST:PORT : The HOST and PORT the core server should listen on.
  9. # Defaults to localhost:4151
  10. # You can connect with awlsim-gui to this port
  11. # to watch, debug or change the AWL program.
  12. #
  13. # --loglevel LVL : Change the log level.
  14. #
  15. # --nice NICE : Renice the process. -20 <= NICE <= 19.
  16. # Default: Do not renice.
  17. #
  18. # --rw-project : Enable project file writing after download of new program.
  19. # Default: Do not write to the project file.
  20. #
  21. # Last argument : The Awlsim AWL/STL project to load and run.
  22. #
  23. loadusr -Wn awlsim awlsim-linuxcnc-hal --listen localhost:4151 linuxcnc-demo.awlpro
  24. # --- Enable the used input pins ---
  25. # All input pins are deactivated by default.
  26. # So all input pins connected below, should be activated here by writing
  27. # a '1' to the '.active' pin.
  28. # Deactivated input pins will not be forwarded from LinuxCNC to the awlsim PLC program.
  29. setp awlsim.input.float.0.active 1
  30. setp awlsim.input.float.4.active 1
  31. setp awlsim.input.float.8.active 1
  32. setp awlsim.input.bit.12.0.active 1
  33. setp awlsim.input.bit.12.1.active 1
  34. setp awlsim.input.bit.12.2.active 1
  35. setp awlsim.input.bit.12.3.active 1
  36. setp awlsim.input.bit.12.4.active 1
  37. setp awlsim.input.bit.12.5.active 1
  38. # --- Connect input pins ---
  39. net xpos-cmd => awlsim.input.float.0 # "X_position_in"
  40. net ypos-cmd => awlsim.input.float.4 # "Y_position_in"
  41. net zpos-cmd => awlsim.input.float.8 # "Z_position_in"
  42. net heartbeat => awlsim.input.bit.12.0 # "Heartbeat_in"
  43. net estop-out-not => awlsim.input.bit.12.1 # "Estop_in_not"
  44. net spindle-cw => awlsim.input.bit.12.2 # "Spindle_cw_in"
  45. net spindle-ccw => awlsim.input.bit.12.3 # "Spindle_ccw_in"
  46. net coolant-mist => awlsim.input.bit.12.4 # "Coolant_mist_in"
  47. net coolant-flood => awlsim.input.bit.12.5 # "Coolant_flood_in"
  48. # --- Enable the used output pins ---
  49. # All output pins are deactivated by default.
  50. # So all output pins connected below, should be activated here by writing
  51. # a '1' to the '.active' pin.
  52. # Deactivated output pins will not be forwarded from the awlsim PLC program to LinuxCNC.
  53. setp awlsim.output.bit.0.0.active 1
  54. setp awlsim.output.bit.0.1.active 1
  55. setp awlsim.output.bit.0.2.active 1
  56. setp awlsim.output.bit.1.0.active 1
  57. setp awlsim.output.bit.1.1.active 1
  58. setp awlsim.output.bit.1.2.active 1
  59. setp awlsim.output.bit.2.0.active 1
  60. setp awlsim.output.bit.2.1.active 1
  61. # --- Connect output pins ---
  62. net limit-x <= awlsim.output.bit.0.0 # "X_limit_out"
  63. net limit-y <= awlsim.output.bit.0.1 # "Y_limit_out"
  64. net limit-z <= awlsim.output.bit.0.2 # "Z_limit_out"
  65. net home-x <= awlsim.output.bit.1.0 # "X_home_out"
  66. net home-y <= awlsim.output.bit.1.1 # "Y_home_out"
  67. net home-z <= awlsim.output.bit.1.2 # "Z_home_out"
  68. net awlsim-heartbeat <= awlsim.output.bit.2.0 # "Heartbeat_out"
  69. net estop-in-not <= awlsim.output.bit.2.1 # "Estop_out_not"
  70. # Always keep this at the end of this file.
  71. # This will activate data transfer between awlsim and LinuxCNC.
  72. setp awlsim.config.ready 1