Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: dah79 on May 23, 2016, 08:30:51 AM
-
Is there a way to simulate a input so I can test a macro script using Mach4 Demo version in simulation mode?
Thanks
-
You could use the keyboard plugin and assign a key to an input.
DazTheGas
-
Thanks Daz, that worked.
I have another question.. I have created a macro, that for some reason I cannot get to work (using DEMO version of Mach4 Hobby). If I open the script and debug and run, it will work. If I use MDI and type m1002, nothing happens. I have diagnostics tab open so I can see if the output comes on. Also, If I change the output to 0, then it will work in MDI. I am at a loss.
-
can you post the code instead of a picture....
a lot easier to debug.
DazTheGas
-
Sorry. As stated, I am able to run this macro when in McLua, but not through calling it in a Gcode or MDI.
Thanks for any assistance.
-
Well this is what I have done using the out of box mach4mill profile.
1. Removed local rc = 0; --return code. on line 7, as your not using a return code anywhere within the function
2. Replaced local state, rc = mc.mcSignalGetState (mc.mcSignalGetHandle (0, mc.ISIG_INPUT5)) with local state = mc.mcSignalGetState (mc.mcSignalGetHandle (0, mc.ISIG_INPUT5)) on line 19
3. Removed duplicate local inst = mc.mcGetInstance() on line 21
4. copied to my profile/macros folder
5. from mdi - m1002
All worked as expected, so thought I would try in demo mode again all worked, finally I decided to try without any motion device selected and it didnt run.
Check that you have the sim plugin activated and selected as motion device then try the mdi again.
DazTheGas
-
Thanks Daz! After I replied last time, everything starting working (other than in MDI mode). I was able to simulate a running gcode with my macro in it and it worked...
As far as the rc - I have no idea what that is even for, I just copied some code somewhere. I am still learning, yet very slowly. I will modify as you have and try in MDI mode again.
Thanks again for your help!!
-
Works now in MDI mode as well, not sure why. Everything was enabled.