Hello Guest it is March 28, 2024, 04:53:27 AM

Author Topic: Mach3 Plugin Tutorial Document and Prototype File Set  (Read 139671 times)

0 Members and 1 Guest are viewing this topic.

Offline Tomas

*
  •  15 15
    • View Profile
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #100 on: December 11, 2014, 03:21:49 PM »
Hello,

  Has there been any progress on adding MFC to this?

Thanks,
Tomas
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #101 on: June 12, 2015, 06:01:28 AM »
With custom plug-in as a base and  VS2003  I begun to write my Jog_plugin

 I get this error
error C3861: 'SetLED': identifier not found
also,
1) can you give me instruction about how to declare GetParam and SetParam functions?
2) this piece of code

<code>
 case 56:{   // 8 Zinhibit
                  
               _itoa(scripter.GetParam("ZInhibitOn"),txt,strlen(txt));
                  DbgMsg((txt ));

                    if(scripter.GetParam("ZInhibitOn")==1){// is on
                        DoButton(Z_INHIBIT_OFF);
                     }else{
                        
                         DoButton(Z_INHIBIT_ON);
                     }
                     ftstatus=FTD2XX_H::FT_Purge(ftHandle,FT_PURGE_TX || FT_PURGE_RX);
                     break;
                   }
</code>
turns Z inhibit button On Yellow led blinks but it dosen't turn it off
at the debug window I get this
[9152] myUpdate Bytes received
[9152] myUpdate Bytes received
[9152] Warning: attempt to call Invoke with NULL m_lpDispatch!
[9152] 9h43ƒl
[9152] Zinhibit
[9152] Warning: attempt to call Invoke with NULL m_lpDispatch!

Please give me your advice either on c language syndax



Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #102 on: June 14, 2015, 12:15:13 PM »
All is about Registry entries. For some . . . reason instalation wizard dosn't setup Registry values


Check for those or insert them:

Code:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Mach4.Document]
@="Mach4.Document"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Mach4.Document\CLSID]
@="{CA7992B2-2653-4342-8061-D7D385C07809}"

it should work then.
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #103 on: March 17, 2016, 10:22:57 AM »
Hi!

I am having problems with a plugin I am writing too.  

In VS2003 I can successfully call:
 SetDRO( #, val);
double dbl = GetDRO(#);
bool bol = GetDRO(#);

However, if I try:
SetLED(#,1);
It errors out saying: c:\Mach3\PlugIns\Devel\MachDevImplementation.cpp(795): error C3861: 'SetLED': identifier not found, even with argument-dependent lookup

Which is weird since it is listed in MachDevice.cpp (along with the other ones):

//System Varibles
CXMLProfile        *DevProf;
OneShort           DoButton;     // void DoButton( code )
DoubleShort        GetDRO;       // Double GetDRO( code )
VoidShortDouble    SetDRO;       // void   SetDRO( short code, double value);
BoolShort          GetLED;       // bool   GetLED( short code );
VoidShortBool      SetLED;       //SetLED Fucntion
CSTRret            GetProName;   // CString GetProName()
VoidLPCSTR         Code;         // void    Code( "G0X10Y10" );
IntShort           GetMenuRange;



Any thoughts?


And I did try adding those 2 keys to my registry and restarting... no dice.

Thanks,
Andy


  

« Last Edit: March 17, 2016, 10:24:34 AM by aAndy »
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #104 on: March 18, 2016, 10:30:57 AM »
So to remind myself when I need to fix this issue in 2 or 3 years, or to help anyone else who stumbles upon it...

In MachDevImplementation.h, I had to add:

typedef void (_cdecl *VoidShortBool) ( short, bool );   
 // and
extern VoidShortBool      SetLED;       // bool   SetLED( short code, bool value );

After that, I was able to use this successfully: 
        SetLED(1011, true); 


USER LEDs have an allowable range 1000-2255 

Andy
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #105 on: January 10, 2020, 09:15:59 AM »
I know it has been awhile since this post has been active but I feel like I need to jump on here and give a big thanks to James Leonard for taking the time to post and start this . I have looked everywehere online for this starter help , I plan to follow the tutorial and I am sure I will learn alot from it !!!!!!!!!! Thanks again too bad there are not more people like this that are willing and that would enjoy sharing their skills and knowledge on a fourm like this one
Cadcam Man