Is there a way to test macro arguments to see if they are present?
In Haas if I call "G65 P100 A1 B2" I can check in the macro if the argument is or is not present by testing it against #0 (which is not-a-number)
O100 (macro)
(test for argument 1)
if [#1 NE #0] GOTO1
#3000 = 1 (argument #1 is not valid)
N1
argument #1 is valid
(test for argument 2)
if [#2 NE #0] GOTO1
#3000 = 1 (argument #2 is not valid)
N1
argument #1 is valid
If I call "G65 P100 B2" the first argument test will fail because it doesn't exist.
Macro - validation of arguments
Moderator: cnckeith
-
- Posts: 13
- Joined: Sun Mar 31, 2019 9:03 am
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: Yes
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Macro - validation of arguments
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
Re: Macro - validation of arguments
Unfortunately no.
On the Centroid control, any non-specified argument will appear to have been passed with a value of 0.0
If, in the context of your macro, zero is not allowed, then you can usefully test against it. If zero is a legitimate value, then there is nothing you can do.
On the Centroid control, any non-specified argument will appear to have been passed with a value of 0.0
If, in the context of your macro, zero is not allowed, then you can usefully test against it. If zero is a legitimate value, then there is nothing you can do.
(Note: Liking will "up vote" a post in the search results helping others find good information faster)