Wiki source code of Другие команды
Last modified by writer on 2023/09/08 18:37
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | ===== void FloodEnable() ===== | ||
2 | |||
3 | Turn on the flood coolant. | ||
4 | |||
5 | ===== void FloodDisable() ===== | ||
6 | |||
7 | Turn off the flood coolant. | ||
8 | |||
9 | ===== void MistEnable() ===== | ||
10 | |||
11 | Turn on spray coolant. | ||
12 | |||
13 | ===== void MistDisable() ===== | ||
14 | |||
15 | Turn off the spray coolant. | ||
16 | |||
17 | ===== void Sleep(number milliseconds) ===== | ||
18 | |||
19 | Waiting for the specified number of milliseconds. | ||
20 | |||
21 | Options: | ||
22 | |||
23 | * number milliseconds – the number of milliseconds during which the macro will pause. | ||
24 | |||
25 | ===== void DisplayMessage(string message) ===== | ||
26 | |||
27 | Displays a macro message in the user interface. | ||
28 | |||
29 | Options: | ||
30 | |||
31 | * string message – the text of the message that should be shown to the user. | ||
32 | |||
33 | ===== void Stop() ===== | ||
34 | |||
35 | Stopping G code execution. Immediately after calling this function, it is recommended to exit the macro using the “return” operator. | ||
36 | |||
37 | ===== void EStop() ===== | ||
38 | |||
39 | Switching to Estop mode. Immediately after calling this function, it is recommended to exit the macro using the “return” operator. | ||
40 | |||
41 | ===== number GetUserVariable(number index) ===== | ||
42 | |||
43 | Getting the value of a user variable. | ||
44 | |||
45 | Options: | ||
46 | |||
47 | * number index – the number of the variable, an integer from 0 to 99. | ||
48 | |||
49 | Return value: | ||
50 | |||
51 | * current value of the user variable (real number). | ||
52 | |||
53 | ===== void SetUserVariable(number index, number value) ===== | ||
54 | |||
55 | Setting the value of a user variable. This value can be read when another macro is executed, including after restarting PUMOTIX. | ||
56 | |||
57 | Options: | ||
58 | |||
59 | * number index – variable number, integer from 0 to 99; | ||
60 | * number value – the value of the user variable (real number) that must be set. | ||
61 | |||
62 | ===== string str(number value) ===== | ||
63 | |||
64 | Convert a real number to a string. | ||
65 | |||
66 | The Lua language supports implicit conversion of a number into a string, but by default for a very small real number the conversion result can have an exponential format, which does not allow using the string as part of a G-code string. For convenience, you can use the str function, which ensures that the number has a decimal representation. | ||
67 | |||
68 | Options: | ||
69 | |||
70 | * number value – a real number to be converted. | ||
71 | |||
72 | Return value: | ||
73 | |||
74 | * string representation of a given number. | ||
75 | |||
76 | ===== void ExecuteMDI(string command) ===== | ||
77 | |||
78 | Execution of a given line of G-code. The function returns control only after the command specified in the G-code line is executed and the movement caused by this command is completed. Thus, several calls to the ExecuteMDI function can be made sequentially without additional synchronization. | ||
79 | |||
80 | Options: | ||
81 | |||
82 | * string command – the G-code string to be executed. | ||
83 | |||
84 | ===== string GetMessage(number value) ===== | ||
85 | |||
86 | Get the string representation of a message. | ||
87 | |||
88 | Options: | ||
89 | |||
90 | * number value – message identifier (one of the constants defined in the [[**Messages** >>]]list must be passed as this parameter). | ||
91 | |||
92 | Return value: | ||
93 | |||
94 | * message text. | ||
95 | |||
96 | //Example: //**DisplayMessage(GetMessage(Messages.ProbeActive))** | ||
97 | |||
98 | ===== double GetAnalogInput(number index) ===== | ||
99 | |||
100 | Get the value of an analog input (from 0 to 1) as a real number. | ||
101 | |||
102 | Options: | ||
103 | |||
104 | * number index – analog input number (starting from 0). | ||
105 | |||
106 | Return value: | ||
107 | |||
108 | * analog input value (from 0 to 1). | ||
109 | |||
110 | ===== number GetExecutingMCode() ===== | ||
111 | |||
112 | Returns the number of the running macro. Returns -1 if the macro is not running. | ||
113 | |||
114 | Return value: | ||
115 | |||
116 | * macro number. | ||
117 | |||
118 | ===== bool GetLedUserValue(number index) ===== | ||
119 | |||
120 | Getting the value of a user variable. | ||
121 | |||
122 | Options: | ||
123 | |||
124 | * number index – variable namber, an integer from 0 to 29. | ||
125 | |||
126 | Return value: | ||
127 | |||
128 | * bool – user variable value. | ||
129 | |||
130 | ===== void SetLedUserValue(number index, bool a_value) ===== | ||
131 | |||
132 | Setting the value of a user variable. This value can be read when executing another macro including after restarting PUMOTIX. | ||
133 | |||
134 | Options: | ||
135 | |||
136 | * number index – variable number, an integer from 0 to 29; | ||
137 | * bool a_value – user variable value. | ||
138 | |||
139 | ===== number GetNumUserValue(number index) ===== | ||
140 | |||
141 | Getting the value of a user variable. | ||
142 | |||
143 | Options: | ||
144 | |||
145 | * number index – variable namber, an integer from 0 to 29. | ||
146 | |||
147 | Return value: | ||
148 | |||
149 | * number – user variable value. | ||
150 | |||
151 | ===== void SetNumUserValue(number index, number value) ===== | ||
152 | |||
153 | Setting the value of a user variable. This value can be read when executing another macro including after restarting PUMOTIX. | ||
154 | |||
155 | Options: | ||
156 | |||
157 | * number index – variable number, an integer from 0 to 29; | ||
158 | * number value – the value of the user variable (real number) to be set. | ||
159 | |||
160 | ===== string GetStrUserValue(number index) ===== | ||
161 | |||
162 | Getting the value of a user variable. | ||
163 | |||
164 | Options: | ||
165 | |||
166 | * number index – variable number, an integer from 0 to 29. | ||
167 | |||
168 | Return value: | ||
169 | |||
170 | * string – user variable value. | ||
171 | |||
172 | ===== void SetStrUserValue(number index, string value) ===== | ||
173 | |||
174 | Setting the value of a user variable. This value can be read when executing another macro including after restarting PUMOTIX. | ||
175 | |||
176 | Options: | ||
177 | |||
178 | * number index – variable number, an integer from 0 to 29; | ||
179 | * string value – the value of the user variable (string) to be set. | ||
180 | |||
181 | ===== bool IsGCodeRunning() ===== | ||
182 | |||
183 | Allows you to check if the PUMOTIX is in G-code execution mode. | ||
184 | |||
185 | Return value: | ||
186 | |||
187 | * true – if PUMOTIX is in G-code execution mode. | ||
188 | |||
189 | ===== bool IsMDIRunning() ===== | ||
190 | |||
191 | Allows you to check if the PUMOTIX is in manual command execution mode. | ||
192 | |||
193 | Return value: | ||
194 | |||
195 | * true – if the PUMOTIX is in manual command execution mode. | ||
196 | |||
197 | ===== number GetGantryAlignmentRectLengthX() ===== | ||
198 | |||
199 | Gets the distance along X specified in the gantry alignment settings. | ||
200 | |||
201 | Return value: | ||
202 | |||
203 | * distance along X, mm. | ||
204 | |||
205 | ===== number GetGantryAlignmentRectLengthY() ===== | ||
206 | |||
207 | Gets the distance along Y specified in the gantry alignment settings. | ||
208 | |||
209 | Return value: | ||
210 | |||
211 | * distance along Y, mm. | ||
212 | |||
213 | ===== number GetGantryAlignmentTotalLength() ===== | ||
214 | |||
215 | Gets the width of the portal specified in the gantry alignment settings. | ||
216 | |||
217 | Return value: | ||
218 | |||
219 | * gantry width, mm. | ||
220 | |||
221 | ===== number GetGantryAlignmentAxis() ===== | ||
222 | |||
223 | Gets the portal axis specified in the gantry alignment settings. | ||
224 | |||
225 | Return value: | ||
226 | |||
227 | * axis number, an integer from 0 to 1 (one of the constants defined in the (% style="text-align:left" %)**[[Axes>>doc:Руководство пользователя.Описание M-кодов.Описание функций макроязыка.Управление осями.WebHome||shape="rect" style="text-decoration: none;"]]**(%%) list). | ||
228 | |||
229 | ===== void WeldOscillatorEnable() ===== | ||
230 | |||
231 | Turn on the oscillator. | ||
232 | |||
233 | ===== void WeldOscillatorDisable() ===== | ||
234 | |||
235 | Turn off the oscillator. | ||
236 | |||
237 | ===== Messages: ===== | ||
238 | |||
239 | * ProbeActive; | ||
240 | * ProbeNotConfigured. |