Macro - validation of arguments

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
dplain
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

Post by dplain »

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.
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: Macro - validation of arguments

Post by cncsnw »

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.
Post Reply