Hello Guest it is May 29, 2023, 08:31:11 PM

Author Topic: Is there any additional documentation or sample plugins?  (Read 1993 times)

0 Members and 1 Guest are viewing this topic.

Is there any additional documentation or sample plugins?
« on: November 25, 2018, 09:38:15 PM »
I'm able to create a DLL and have it be loaded by Mach3, but I'm not sure how to actually interact with Mach3 internally.

So far from what I can tell you're supposed to implement InitControl() and store the TrajBuffer, setup, CMach4View, and TrajectoryControl pointers. However, I haven't seen any examples on how to make the software jog, or get the state of a button's LED.

How would I get the current coordinates of the spindle, and get the state of the X/Y/Z endstops? I want to check if the endstops are triggered while the spindle is in a certain position. Is the best way to get the software to jog to invoke Gcode, or should I set values in some data structure somewhere? The JoyStick example plugin seems to modify the TrajBuffer data (named Engine) by doing some obscure math and setting JoggDir/Acceleration/Jogging/Dec values in the AxisInfo for X and Y accordingly. Is this the best way to jog? 
Also, I'm running this "2011 Mini Arty CNC Control Interface" addon that changes the way Mach3 looks, and I now have a Park Spindle button. How would I go about triggering this particular button, or some other button? I'm guessing that's what the purpose of the DoButton function which takes a short is, but I haven't seen any lists of button IDs anywhere. I also haven't seen any DRO IDs anywhere... any help would be appreciated. Thanks.

Offline Tweakie.CNC

  • *
  •  9,037 9,037
  • Super Kitty
    • View Profile
« Last Edit: January 09, 2019, 03:02:38 AM by Tweakie.CNC »
Re: Is there any additional documentation or sample plugins?
« Reply #2 on: November 26, 2018, 01:50:04 AM »
Thank you very much Tweakie. This is exactly what I was looking!