linuxcnc-demo.awlpro 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2. <!-- Awlsim project file generated by awlsim-0.66.0-pre -->
  3. <awlsim_project date_create="2015-01-04 14:29:54.007468"
  4. date_modify="2018-07-08 18:00:06.516647"
  5. format_version="1">
  6. <!-- CPU core configuration -->
  7. <cpu>
  8. <!-- CPU core feature specification -->
  9. <specs call_stack_size="256"
  10. nr_accus="2"
  11. nr_counters="256"
  12. nr_flags="2048"
  13. nr_inputs="128"
  14. nr_localbytes="1024"
  15. nr_outputs="128"
  16. nr_timers="256"
  17. parenthesis_stack_size="7" />
  18. <!-- CPU core configuration -->
  19. <config clock_memory_byte="-1"
  20. cycle_time_limit_us="1000000"
  21. ext_insns_enable="0"
  22. mnemonics="0"
  23. ob_startinfo_enable="0"
  24. run_time_limit_us="-1" />
  25. </cpu>
  26. <!-- AWL/STL language configuration -->
  27. <language_awl>
  28. <!-- AWL/STL source code -->
  29. <source enabled="1"
  30. name="OB 1"
  31. type="0"><![CDATA[
  32. ORGANIZATION_BLOCK OB 1
  33. VAR_TEMP
  34. OB1_EV_CLASS : BYTE; // Bits 0-3 = 1 (Coming event), Bits 4-7 = 1 (Event class 1)
  35. OB1_SCAN_1 : BYTE; // 1 (Cold restart scan 1 of OB 1), 3 (Scan 2-n of OB 1)
  36. OB1_PRIORITY : BYTE; // Priority of OB execution
  37. OB1_OB_NUMBR : BYTE; // 1 (Organization block 1, OB 1)
  38. OB1_RESERVED_1 : BYTE;
  39. OB1_RESERVED_2 : BYTE;
  40. OB1_PREV_CYCLE : INT; // Cycle time of previous OB 1 scan (milliseconds)
  41. OB1_MIN_CYCLE : INT; // Minimum cycle time of OB 1 (milliseconds)
  42. OB1_MAX_CYCLE : INT; // Maximum cycle time of OB 1 (milliseconds)
  43. OB1_DATE_TIME : DATE_AND_TIME; // Date and time OB 1 started
  44. END_VAR
  45. BEGIN
  46. CALL "FC_heartbeat"
  47. CALL "FC_limit_switches"
  48. CALL "FC_home_switches"
  49. CALL "FC_spindle"
  50. CALL "FC_coolant"
  51. CALL "FC_estop"
  52. END_ORGANIZATION_BLOCK
  53. ]]></source>
  54. <!-- AWL/STL source code -->
  55. <source enabled="1"
  56. name="Heartbeat"
  57. type="0"><![CDATA[
  58. FUNCTION "FC_heartbeat" : VOID
  59. BEGIN
  60. // Generate the heartbeat output
  61. UN "HB_out_Tb"
  62. = "Heartbeat_out"
  63. L S5T#100ms
  64. SV "HB_out_Ta"
  65. UN "HB_out_Ta"
  66. L S5T#100ms
  67. SV "HB_out_Tb"
  68. // Check the heartbeat input
  69. U "Heartbeat_in"
  70. L S5T#500ms
  71. SA "HB_in_T"
  72. U "HB_in_T"
  73. = "Heartbeat_in_ok"
  74. END_FUNCTION
  75. ]]></source>
  76. <!-- AWL/STL source code -->
  77. <source enabled="1"
  78. name="E-stop"
  79. type="0"><![CDATA[
  80. FUNCTION "FC_estop" : VOID
  81. BEGIN
  82. // Create our emergency stop signal
  83. U "Estop_in_not"
  84. U "Heartbeat_in_ok"
  85. = "Estop_out_not"
  86. END_FUNCTION
  87. ]]></source>
  88. <!-- AWL/STL source code -->
  89. <source enabled="1"
  90. name="Limit switches"
  91. type="0"><![CDATA[
  92. FUNCTION "FC_limit_switches" : VOID
  93. BEGIN
  94. // Emulate limit switches
  95. // X
  96. O(
  97. L "X_position_in"
  98. L 1.0
  99. >=R
  100. )
  101. O(
  102. L "X_position_in"
  103. L -201.0
  104. <=R
  105. )
  106. = "X_limit_out"
  107. // Y
  108. O(
  109. L "Y_position_in"
  110. L 1.0
  111. >=R
  112. )
  113. O(
  114. L "Y_position_in"
  115. L -201.0
  116. <=R
  117. )
  118. = "Y_limit_out"
  119. // Z
  120. O(
  121. L "Z_position_in"
  122. L 1.0
  123. >=R
  124. )
  125. O(
  126. L "Z_position_in"
  127. L -201.0
  128. <=R
  129. )
  130. = "Z_limit_out"
  131. END_FUNCTION
  132. ]]></source>
  133. <!-- AWL/STL source code -->
  134. <source enabled="1"
  135. name="Home switches"
  136. type="0"><![CDATA[
  137. FUNCTION "FC_home_switches" : VOID
  138. BEGIN
  139. // Emulate home switches
  140. // X
  141. U(
  142. L "X_position_in"
  143. L -10.0
  144. <=R
  145. )
  146. U(
  147. L "X_position_in"
  148. L -15.0
  149. >=R
  150. )
  151. = "X_home_out"
  152. // Y
  153. U(
  154. L "Y_position_in"
  155. L -10.0
  156. <=R
  157. )
  158. U(
  159. L "Y_position_in"
  160. L -15.0
  161. >=R
  162. )
  163. = "Y_home_out"
  164. // Z
  165. U(
  166. L "Z_position_in"
  167. L -10.0
  168. <=R
  169. )
  170. U(
  171. L "Z_position_in"
  172. L -15.0
  173. >=R
  174. )
  175. = "Z_home_out"
  176. END_FUNCTION
  177. ]]></source>
  178. <!-- AWL/STL source code -->
  179. <source enabled="1"
  180. name="Spindle"
  181. type="0"><![CDATA[
  182. FUNCTION "FC_spindle" : VOID
  183. BEGIN
  184. // TODO: Handle spindle signals
  185. // "Spindle_cw_in"
  186. // "Spindle_ccw_in"
  187. END_FUNCTION
  188. ]]></source>
  189. <!-- AWL/STL source code -->
  190. <source enabled="1"
  191. name="Coolant"
  192. type="0"><![CDATA[
  193. FUNCTION "FC_coolant" : VOID
  194. BEGIN
  195. // TODO: Handle coolant signals
  196. // "Coolant_mist_in"
  197. // "Coolant_flood_in"
  198. END_FUNCTION
  199. ]]></source>
  200. </language_awl>
  201. <!-- Symbol table configuration -->
  202. <symbols>
  203. <!-- symbol table source code -->
  204. <source enabled="1"
  205. name="Inputs / outputs"
  206. type="3"><![CDATA[
  207. 126,X_position_in ED 0 REAL The current position (X)
  208. 126,Y_position_in ED 4 REAL The current position (Y)
  209. 126,Z_position_in ED 8 REAL The current position (Z)
  210. 126,Heartbeat_in E 12.0 BOOL LinuxCNC heartbeat input
  211. 126,Estop_in_not E 12.1 BOOL Emergency stop input
  212. 126,Spindle_cw_in E 12.2 BOOL Spindle "clockwise" enable input
  213. 126,Spindle_ccw_in E 12.3 BOOL Spindle "counterclockwise" enable input
  214. 126,Coolant_mist_in E 12.4 BOOL Mist coolant enable input
  215. 126,Coolant_flood_in E 12.5 BOOL Flood coolant enable input
  216. 126,X_limit_out A 0.0 BOOL Limit switch output (X)
  217. 126,Y_limit_out A 0.1 BOOL Limit switch output (Y)
  218. 126,Z_limit_out A 0.2 BOOL Limit switch output (Z)
  219. 126,X_home_out A 1.0 BOOL Home switch output (X)
  220. 126,Y_home_out A 1.1 BOOL Home switch output (Y)
  221. 126,Z_home_out A 1.2 BOOL Home switch output (Z)
  222. 126,Heartbeat_out A 2.0 BOOL LinuxCNC heartbeat output
  223. 126,Estop_out_not A 2.1 BOOL Emergency stop output
  224. ]]></source>
  225. <!-- symbol table source code -->
  226. <source enabled="1"
  227. name="Flags"
  228. type="3"><![CDATA[
  229. 126,Heartbeat_in_ok M 0.0 BOOL Result of the Heartbeat_in check
  230. ]]></source>
  231. <!-- symbol table source code -->
  232. <source enabled="1"
  233. name="Timers"
  234. type="3"><![CDATA[
  235. 126,HB_out_Ta T 1 TIMER Heartbeat_out timer A
  236. 126,HB_out_Tb T 2 TIMER Heartbeat_out timer B
  237. 126,HB_in_T T 3 TIMER Heartbeat_in check timer
  238. ]]></source>
  239. <!-- symbol table source code -->
  240. <source enabled="1"
  241. name="Functions"
  242. type="3"><![CDATA[
  243. 126,FC_heartbeat FC 1 FC 1 Function for heartbeat handling
  244. 126,FC_estop FC 2 FC 2 Function for emergency stop handling
  245. 126,FC_limit_switches FC 3 FC 3 Function for handling limit switches
  246. 126,FC_home_switches FC 4 FC 4 Function for handling home switches
  247. 126,FC_spindle FC 5 FC 5 Function for spindle handling
  248. 126,FC_coolant FC 6 FC 6 Function for coolant handling
  249. ]]></source>
  250. </symbols>
  251. <!-- Core server link configuration -->
  252. <core_link>
  253. <!-- Locally spawned core server -->
  254. <spawn_local enable="0"
  255. interpreters="$DEFAULT"
  256. port_range_begin="4183"
  257. port_range_end="8278" />
  258. <!-- Remote server connection -->
  259. <connect host="localhost"
  260. port="4151"
  261. timeout_ms="3000" />
  262. <!-- Transport tunnel -->
  263. <tunnel local_port="-1"
  264. type="0">
  265. <ssh executable="ssh"
  266. port="22"
  267. user="pi" />
  268. </tunnel>
  269. </core_link>
  270. <!-- Hardware modules configuration -->
  271. <hardware>
  272. <!-- Loaded hardware module -->
  273. <module name="dummy">
  274. <params>
  275. <param name="inputAddressBase"
  276. value="128" />
  277. <param name="outputAddressBase"
  278. value="128" />
  279. </params>
  280. </module>
  281. <!-- Loaded hardware module -->
  282. <module name="linuxcnc">
  283. <params>
  284. <param name="hal" />
  285. <param name="inputAddressBase"
  286. value="0" />
  287. <param name="inputSize"
  288. value="16" />
  289. <param name="outputAddressBase"
  290. value="0" />
  291. <param name="outputSize"
  292. value="8" />
  293. </params>
  294. </module>
  295. </hardware>
  296. <!-- Graphical user interface configuration -->
  297. <gui>
  298. <editor autoindent="1"
  299. paste_autoindent="1"
  300. validation="1" />
  301. </gui>
  302. </awlsim_project>