Hello Guest it is April 25, 2024, 03:26:38 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 - Georg_Kai

Pages: 1
1
Mach SDK plugin questions and answers. / Re: Step increase in feedrate.
« on: August 09, 2011, 09:06:46 PM »
Yes, I value changes by 1%. Function GetOEMDRO () returns a value from 0 to 250 "%". This code works for me.

2
Mach SDK plugin questions and answers. / Re: Step increase in feedrate.
« on: August 09, 2011, 03:29:47 AM »
Below I have piece of software that I have to control the Feedoverride:

extern CMyScriptObject co;
extern double GetOEMDRO(short);
extern void SetOEMDRO(short,double);
const int FeedRateOverRide = 821;
double FRO;

......
     if( code == 108 ) {
      FRO = co.GetOEMDRO(FeedRateOverRide);
      FRO += 1;
      co.SetOEMDRO(FeedRateOverRide, FRO);
      return;
     }
    
     if( code == 109 ) {
        FRO = co.GetOEMDRO(FeedRateOverRide);
        FRO -= 1;
        co.SetOEMDRO(FeedRateOverRide,FRO);
        return;
     }
.......

I had a bug in a row that I noted a sign "-------->", Mach3 program installation is not prescribed in the registry value "Mach4.Document". Therefore, the functions SetOEMDRO (), GetOEMDRO () did not work.

VOID Mach3ObjectModelStartup(VOID)

{
   static const IID IID_IMyScriptObject =    { 0xf1d3ee6c, 0xab32, 0x4996,
    { 0xb2, 0x70, 0xf4, 0x15, 0x61, 0x3f, 0x5b, 0xa3 } };
   CLSID clsid;

   HRESULT res;
   res = CoInitialize(NULL);

   LPUNKNOWN lpUnk = NULL;
   LPDISPATCH lpDispatch = NULL;
   

   try {
---------->   res = CLSIDFromProgID(OLESTR("Mach4.Document"),&clsid);
      if (res == NOERROR) {

          if (res = GetActiveObject(clsid,NULL,&lpUnk) == NOERROR) {

            HRESULT hr = lpUnk->QueryInterface(IID_IDispatch,
                     (LPVOID*)&lpDispatch);

            lpUnk->Release();

            if (hr == NOERROR) {

               mach4.AttachDispatch(lpDispatch, TRUE);

               lpDispatch = mach4.GetScriptDispatch();

               co.AttachDispatch(lpDispatch, TRUE);

               connected = TRUE;
         
            }
         }
      }
   }

   catch(_com_error &e) {

   //   com_error_msg(e);
   }
}

3
Mach SDK plugin questions and answers. / Step increase in feedrate.
« on: July 19, 2011, 05:31:15 AM »
I apologize for my English. I am writing my first plugin and ran into a problem: I have appointed for your joystick buttons to actions: increase or decrease the feed rate (DoOEMButton 109, 108). But when you press the increase (decrease) occurs in 10% of the feedrate. Ie if the feed rate is set when you press 800 is increased to 880. How to change the step increase (decrease) in let's say 5% or 2.5%. Where is this variable? in which structure? ???

Pages: 1