Hello Guest it is April 26, 2024, 01:05:09 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - newmacher

Pages: 1
1
Well, I found a problem with my plugin.  It's an annoyance.  If the Griffin Powermate is plugged in, and I try to open the config menu, the griffin is blocking the menu.  I have to click the Griffin in order to have the menu pop up.  I hope I don't have to spawn a thread to read from the Griffin.  Anyone else have this solved?

2
Mach SDK plugin questions and answers. / Re: Step increase in feedrate.
« on: August 10, 2011, 11:42:28 AM »
That's great, Thanks George, I changed the code to the following, and it definitely changes the value by one.  This evening, I'll install the plugin on my mill PC, and try it for real on the mill.

            int rotated = MG::usbDeviceAction->rotated(MG::usbCommData->inputBuffer);
            //821 is the feed rate override DRO
            int val = GetDRO(821);
            if(rotated > 0)
               val++;
            else
               val--;
            SetDRO(821,val);


3
Mach SDK plugin questions and answers. / Re: Step increase in feedrate.
« on: August 09, 2011, 04:31:16 PM »
Mine is simpler.  I am using the Mach includes from the Plugin Wizard.  This code gets called in a timer that I setup to run every 5ms.  MG::usbDeviceAction is a static class where I decode what action was performed on my Griffin powermate

            int rotated = MG::usbDeviceAction->rotated(MG::usbCommData->inputBuffer);
            if(rotated > 0){
               DoButton(108);
            }else{
               DoButton(109);
            }

If I rotate the grffin powermate clockwise, it returns a positive number, otherwise it is negative, and based on direction I call the Mach 3 DoButton method.

Just like you, it only changes in increments of 10% unless it is under 10% since it mimicks the operation of the clickable buttons on the Mach 3 screen.

Did you get your code to change it only 1% at a time?  It looks like your code should work.

4
Mach SDK plugin questions and answers. / Re: Step increase in feedrate.
« on: August 04, 2011, 01:37:25 PM »
I have this same problem.  I put the feed rate override functionality into my Griffin Powermate plugin, but can't figure out how to make it move more than 10% at a time using the DoButton method.

I tried TrajectoryControl.FeedInc just to see if that was it, but it didn't work.  Maybe you just have to change the TrajectoryControl.FeedRate directly instead of using the buttons. Hopefully someone with chime in with the answer. 

I also found another weird problem.  When I issue the DoButton(1014) for the feed rate override reset button, it resets to 80% instead of 100%.  Do you also have this problem?

5
Well, I spruced up the new Griffin PowerMate plugin today.  I added some configuration settings so you can turn off axis's you aren't using and so that you can change your increment per pulse, and feed rate.  Seems to work pretty well.  Same link as before, but now it is version 5.0.1

Let me know how it works.

http://www.corvettediy.com/powermate/GriffinPowerMatePluginV5.dll

6
Thanks Tweakie, glad to help. 

One other thing I found while building the Griffin Plugin was that I couldn't build a plugin dll with Visual Studio 2010 Pro and then get it to run under Mach3.  I had both the .net framework version 4, and version 3.5 installed on my test box, and made sure I had compiled the dll as release dll instead of debug, but Mach3 still said it was a defective plugin.  I finally dropped back and built it with studio 2008 Pro, which works fine, and that is why my plugin has  the .net framework 3.5 dependency.

I'm wondering if anyone else has had experience using studio 2010 for plugin development, and might know what I was doing wrong.

7
Ok guys, I was someone who didn't read the forum before purchasing a power mate, so hooked it up and realized the plugin was old.  Difference was, that I'm a programmer, so I downloaded the plugin wizard, and coded a plugin for it.  It's pretty simplistic, but it works.

I requires the .net framework version 3.5 since it was done using the plugin wizard, and if you don't have that or don't install that, then Mach 3 will tell you that your plugin is damaged.  Anyway, here is the dll.

Hope it works well for everyone.  It basically just steps the axis by .001, and I haven't tried it with millimeters, so let me know how well or badly that works.  Clicking it changes axis just like the other broken plugin, but since nothing else on the other plugin worked for me, I don't know what else it did.

I know this is raw, but if people like it, I can probably find time to make it better.

http://www.corvettediy.com/powermate/GriffinPowerMatePluginV5.dll

8

1.  Is there a way to set the Mach error label like  MachErrorMsg("*********x") or SetMachError("*********x")? From the Shuttle Plugin:

   void SetMachError(Cstring Message){
      CString *err = &MainPlanner->LastError;
      if(err != NULL )
      *err = Message;"}

In Ed's -TrajectoryControl structure LastError is a LPCSTR pointer. In C++/CLI I came up with:

   void SetMachError(LPCSTR Message){   
      LPCSTR err =   (LPCSTR)&MainPlanner->LastError;
      if(err != nullptr )
      err = Message;// Compiles NO OUTPUT
}
   
Has anybody figured this out?


Kurt, I solved the same problem with the following piece of code:

void SetMachError(char* msg){
   void *temp = &MainPlanner->LastError;
   if( temp != NULL) *(CString*)temp = msg;  //need #include <atlstr.h>    
}

One more tip: put the include atlstr.h before setting default namespaces in order to prevent name ambiguities.

I hope it helps.




I just thought I'd let everyone know that this code also solved my problem with the Mach Status field.

void SetMachError(char* msg){
   void *temp = &MainPlanner->LastError;
   if( temp != NULL) *(CString*)temp = msg;  //need #include <atlstr.h>    
}

but in order to get it to work, there are two caveats, first, atlstr.h is not included in the express version of visual studio, so I had to compile it on my Visual Studio Pro.  I used Studio 2010 pro to get it working.  Second, since I used the plugin wizard to generate my beginning project, I am using mixed mode code, and this includes the .net framework, so in order to load the atlstr.h header, you will have to load it before your first "using namespace" statement.  For me this was in my stdafx.h  and if you don't load it before your first "using namespace" statement, the errors you will get during compile are that there are several ambiguous statements related to thing in the CLR since .net and atl define a bunch of stuff with the same names.

I hope this helps anyone who, like me, spent hours doing just this one simple little thing.

Pages: 1