2 minuten...
4.1.2 .M-codes
Macro codes can be called from code execution or via the MDI control. To program a macro call
Mx, where 'x' means a positive integer number and this number is the number of the macro to call.
Macros are text files and located in the folder of the machine profile.
There are default macros in the RS274 language and there are some other macros which we
prepared as an example. These macros and their functions are described in this section of the
documentation.
Macros can have parameters. The parameters are passed to the macro script file and can be used as
predefined variable values inside the macro script file.
There are 2 ways to pass variables to the macro, one way is to pass upto 3 parameters
programmable with the 'E', 'H' and 'Q' prefixes.
67/93
For example 'M300 E1.2 H3 Q4.5'.
The parameters are all optional and if a parameter is set it can be used inside the macro with the
Evar, Hvar and Qvar variables. These variables are always defined and set when the macro is called.
The default value of all these parameters are 'null', if the parameters does not exist when called then
the parameters will have a 'null' value.
The other way to pass parameters to macros is to place the variables in {} brackets next to the
macro call.
For example 'M300 {A1.2 B2.3 C3.4}'
Using the brackets for passing variables a much larger number of parameters can be passed, the
available letters for the parameters are: A, B, C, D, E, H, I, J, K, L, N, O, P, Q, R, U, V, W, X, Y, Z.
In the macro file the variables can be refered and used as a member of the 'Allvars' structure, for
example: Allvars.Avar , Allvars.Bvar.
If no variable is passed to the macro then the Allvars structure is not getting created it's value is
'null'. If a variable is not defined in the call code then that variable member will have a null value.
The macro writer should make a check whether a variable was passed or not before using the
variable in the macro. The check can be done as the following example shows. In the example code
the Allvars structure is checked if exists first and then if the X variable was defined and passed.
if(Allvars != null)
{
if (Allvars.Xvar != null)
{
MessageBox.Show(exec.mainform, ""+Allvars.Xvar); //Print the X variable to a MessageBox
}
}
en uit hoofdstuk 5 :
The macro codes are text files located in the Profiles\Macro_Name of profile\ folder, where the
"Name of profile" is the profile name the machine is running. A macro can contain simple or even
complex code to execute even a bunch of movements and I/O manipulations.
Voor zover ik kan zien Ja.. dat kan..
nogmaals.. 2 minuten.. en ik ken die hele besturing niet.. wat wil je eigenlijk?.. dat we die Macro even voor je schrijven?..zo moeilijk kan het niet zijn..