Hello Guest it is March 28, 2024, 05:12:17 AM

Author Topic: How to pass parameter to macro through Mach4 MDI?  (Read 993 times)

0 Members and 1 Guest are viewing this topic.

How to pass parameter to macro through Mach4 MDI?
« on: July 17, 2019, 06:10:14 AM »
Passing a parameter to my macro function through the Mach4 MDI - how would I go about that?

I've tried to trigger a couple of things from the MDI, which naturally isn't correct/ supported, among other:

- mdi101(666)
- mdi101 #666

Re: How to pass parameter to macro through Mach4 MDI?
« Reply #1 on: July 17, 2019, 07:56:22 AM »
take a look at this example I created of how to pass data, might help you.

https://www.machsupport.com/forum/index.php?topic=27162.msg261221#msg261221
Re: How to pass parameter to macro through Mach4 MDI?
« Reply #2 on: July 17, 2019, 05:56:40 PM »
Thanks a lot, that was really helpful! :)

So basically I need to pass a,b,c,d.... etc. a long with the a value, like: m101 a666

And then in my function I can read that A parameter by doing:
mc.mcCntlGetLocalVar(inst, hParam, mc.SV_A)

Getting passed value b would then be mc.SV_B etc.

Is that correctly understood?

And a bonus question: it's not possible to pass a string only to the function?