Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: rcaffin on November 23, 2014, 04:25:20 AM
-
Hi all
Three related questions:
Does anyone know whether Mach3 supports M90 output #n and M91 output #n calls? Some systems allow you to turn on and off an output #n this way.
Alternately, is it possible to pass a parameter to an M-call? eg M90 3 - which will be translated internally to ActivateSignal(output3) if I can figure out how to get the '3' into the string in an acceptable manner.
Finally, the Reset/Init string defined in Config - can one include an M-call in that string? All I ever see are g-codes.
Cheers
-
You can create an Mcode to do about anything you want. User Mcodes are M100 and higher.
You could create M100 M101 for instance.
YES you can pass up to 3 paramaters to an Mcode M100 P# Q# R# .
It is all in the Mach programmers manua.
YES you can included Mcodes in the init stringl
-
Hi Terry
You can create an Mcode to do about anything you want. User Mcodes are M100 and higher.
Yes, I knew that. Actually, some references say M90 - M99 are reserved for users as well.
YES you can pass up to 3 paramaters to an Mcode M100 P# Q# R# .
It is all in the Mach programmers manua.
Wonderful, thank you.
I am sure it is in the manual, but I could not find it. Would you know the page number by any chance?
YES you can included Mcodes in the init stringl
Thanks. I thought so, but right now I am rebuilding the entire electronics part of my CNC and I can't test Init strings right now ...
Cheers
Roger
-
Better that that because the manual is kinda vauge I can give you an example. Create this example as M123 then call teh M123 P# Q# R# and the values will appear in the status bar in mach3.
'M123 example Macro Parameter call
Test1 = param1()
Test2 = param2()
Test3 = param3()
Message "" &Test1 &" , " &Test2 &" ," &Test3
End
-
Actually I think you can use ANY mcode # that is not already used by mach3. The range of m100 --> up was to keep OEM codes and USER codes seperated
Just a thought, (;-)
-
Hi Terry
I still can't find where that was in the manual, although I seem to have a vague memory of seeing it once. Oh Well.
Interesting discovery: the values are persistent. So missing out on one parameter in a call can give variable results.
Using your example:
M123 P1 Q2 R3 gives the expected 1,2,3 reply.
M123 P4 may give 4,-1,0 if it is the first call, or sometimes 4,-1,-1, but if it follows the previous example you get 4,2,3 . This can be problematic.
I tried using isnull(), but once the variable has been used once it is no longer null. So far I can see no way of releasing a variable name after use.
Cheers, and thanks
Roger
-
Customizing Mach2 Manual , Page 4-7
As you have noticed there are some quircks that were never fixed (;-)
Normally you ONLY specify Params that you are going to use in your routine. and IF you are not going to use a specific param all the time then do a
M123 P0 Q10 to zero out the unneeded values
-
I looked it up in the oldM3 notes and you USED to be able to Zero the Param values in CB with
Code"P0 Q0 R0 "
The R still works BUT the P Q are broken (;-(
(;-) TP
-
Hi Terry
I never looked at the Mach2 manuals ... on the ASSUMPTION that all the info needed would be in the Mach3 manuals. Sigh :-)
I have downloaded some of the older Mach2 docs and will read through them. Thanks!
> The R still works BUT the P Q are broken
Yeah, I have found differences in the responses for Q and R already. Fuzz-testing.
Anyhow, given what you have told me, I can work around it. Shouldn't be too ugly.
Back to the rebuild.
Cheers
Roger
-
Hi Terry
PQR work fine for my needs. Machine now rebuilt and running well.
Thanks.
Cheers
Roger