awlsim.hal 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. # --input-base BASE : S7 input base-address byte-offset to use for the HAL module.
  14. # If 0 is used, address-mapping will start at I 0.0
  15. # If 1 is used, address-mapping will start at I 1.0
  16. # etc...
  17. # This overrides the value from the project file.
  18. #
  19. # --output-base BASE : S7 output base-address byte-offset to use for the HAL module.
  20. # If 0 is used, address-mapping will start at Q 0.0
  21. # If 1 is used, address-mapping will start at Q 1.0
  22. # etc...
  23. # This overrides the value from the project file.
  24. #
  25. # --input-size SIZE : Size of the input area mapping, in bytes.
  26. # This overrides the value from the project file.
  27. #
  28. # --output-size SIZE : Size of the output area mapping, in bytes.
  29. # This overrides the value from the project file.
  30. #
  31. # --loglevel LVL : Change the log level.
  32. #
  33. # --nice NICE : Renice the process. -20 <= NICE <= 19.
  34. # Default: Do not renice.
  35. #
  36. # Last argument : The Awlsim AWL/STL project to load and run.
  37. #
  38. loadusr -Wn awlsim awlsim-linuxcnc-hal --listen localhost:4151 linuxcnc-demo.awlpro
  39. # --- Enable the used input pins ---
  40. # All input pins are deactivated by default.
  41. # So all input pins connected below, should be activated here by writing
  42. # a '1' to the '.active' pin.
  43. # Deactivated input pins will not be forwarded from LinuxCNC to the awlsim PLC program.
  44. setp awlsim.input.float.0.active 1
  45. setp awlsim.input.float.4.active 1
  46. setp awlsim.input.float.8.active 1
  47. setp awlsim.input.bit.12.0.active 1
  48. setp awlsim.input.bit.12.1.active 1
  49. setp awlsim.input.bit.12.2.active 1
  50. setp awlsim.input.bit.12.3.active 1
  51. setp awlsim.input.bit.12.4.active 1
  52. setp awlsim.input.bit.12.5.active 1
  53. # --- Connect input pins ---
  54. net xpos-cmd => awlsim.input.float.0 # "X_position_in"
  55. net ypos-cmd => awlsim.input.float.4 # "Y_position_in"
  56. net zpos-cmd => awlsim.input.float.8 # "Z_position_in"
  57. net heartbeat => awlsim.input.bit.12.0 # "Heartbeat_in"
  58. net estop-out-not => awlsim.input.bit.12.1 # "Estop_in_not"
  59. net spindle-cw => awlsim.input.bit.12.2 # "Spindle_cw_in"
  60. net spindle-ccw => awlsim.input.bit.12.3 # "Spindle_ccw_in"
  61. net coolant-mist => awlsim.input.bit.12.4 # "Coolant_mist_in"
  62. net coolant-flood => awlsim.input.bit.12.5 # "Coolant_flood_in"
  63. # --- Enable the used output pins ---
  64. # All output pins are deactivated by default.
  65. # So all output pins connected below, should be activated here by writing
  66. # a '1' to the '.active' pin.
  67. # Deactivated output pins will not be forwarded from the awlsim PLC program to LinuxCNC.
  68. setp awlsim.output.bit.0.0.active 1
  69. setp awlsim.output.bit.0.1.active 1
  70. setp awlsim.output.bit.0.2.active 1
  71. setp awlsim.output.bit.1.0.active 1
  72. setp awlsim.output.bit.1.1.active 1
  73. setp awlsim.output.bit.1.2.active 1
  74. setp awlsim.output.bit.2.0.active 1
  75. setp awlsim.output.bit.2.1.active 1
  76. # --- Connect output pins ---
  77. net limit-x <= awlsim.output.bit.0.0 # "X_limit_out"
  78. net limit-y <= awlsim.output.bit.0.1 # "Y_limit_out"
  79. net limit-z <= awlsim.output.bit.0.2 # "Z_limit_out"
  80. net home-x <= awlsim.output.bit.1.0 # "X_home_out"
  81. net home-y <= awlsim.output.bit.1.1 # "Y_home_out"
  82. net home-z <= awlsim.output.bit.1.2 # "Z_home_out"
  83. net awlsim-heartbeat <= awlsim.output.bit.2.0 # "Heartbeat_out"
  84. net estop-in-not <= awlsim.output.bit.2.1 # "Estop_out_not"
  85. # Always keep this at the end of this file.
  86. # This will activate data transfer between awlsim and LinuxCNC.
  87. setp awlsim.config.ready 1