Changes

CONTROLS/Macros

824 bytes added, 17:40, 14 March 2017
new scripting commands
Click the '''Cancel''' button to discard changes.
== Macro Scripting (Starting in version 1.7) ==
Macro Scripting allows for the use of advanced functions in macros. These functions are called by using commands.
To use a macro scripting command, begin the line with the following function:
<code>; Commandhost.:</code>
Then add a command and any applicable parameters.
<code>; Command:[command] "([parameters])"</code>
The result should look something like this:
<code>; Commandhost.show_message(title:Message "Waiting for extruder to heat to [temperature].")</code>
=== Commands ===
<code>Messageding()</code> Play a bell sound. <code>show_message()</code>
Shows the specified message.
Optional parameter variables(content must be in quotes):
*ExpectedSecondstitle: [main text to show] *image: [a url of the image you wish to show]*wait_ok: [script execution will wait for the user to click 'ok']*repeat_gcode: [gcode to repeat until expire timereached (separate lines with a |)] *ExpectedTemperatureexpire: [tempthe max amount of time to run repeate_gcode or show this message]*count_down: [show a timer counting down from this time]
<code>ChooseMaterialchoose_material</code>
Shows the choose material window.
<code>WaitOK</code>Optional parameter variables (content must be in quotes):
Show the specified message and waits for user *title: [main text to click OK to continue sending code.show]
=== Example Script ===
The following box shows an example of a script used for loading filament:
<pre>; Commandhost.choose_material(title:ChooseMaterial "Choose the material that you are loading.")
; Command:Message "Waiting for extruder to heat to [temperature]."
M104 S[temperature] ; start heating up the extruder
 
; host.show_message(title:"Trim the end of the filament to ensure a good load.", image:"https://cdn.instructables.com/FSW/FEGA/HN4ZL57T/FSWFEGAHN4ZL57T.MEDIUM.jpg", wait_ok:"true")
M302 S0 ; Allow extrusion at any temperature
G91 ; CommandRelative positioning; host.show_message(title:WaitOK "Put filament into extruder and click Continue.", repeat_gcode:"G1 E.1 F150|G4 P10", expire:"90", image:"https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/5035400628/original/20150903_115628.jpg?1441307271")G90 ; CommandAbsolute positioning; host.show_message(title:Message "Loading filament..." ExpectedSeconds, count_down:"28")
G92 E0 ; reset the extruder position to 0
G91 ; Relative positioning
M302 S150 ; Set cold extrude temp back to reasonable
; Commandhost.show_message(title:Message "Waiting for extruder to heat to [temperature].")
M109 S[temperature] ; heat up the extruder
; Command:Message "Extruding filament..." ExpectedSeconds:19
; extrude slowly so that we can prime the extruder
G1 E100 F300 ; extrude the host.show_message(title:"Click 'Continue' when filament slowlyis running cleanly.", repeat_gcode:"G1 E1 F300|G4 P10", expire:"90")
G4 S1 ; wait for move to finish
G92 E0 ; reset the extruder position to 0
M104 S0 ; turn the extruder temperatuer temperature off</pre>
[[Category:Controls]]
[[Category:Features]]
18
edits