Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: nickashton on January 11, 2010, 05:44:14 AM

Title: Help with VB program
Post by: nickashton on January 11, 2010, 05:44:14 AM
Hi

I have bought a USB Interface board and hope to make a VB program that will interact with Mach3 (nothing complicated). I am using VB6 and have managed to get the program to control the USB board using the provide DLL, but can not get it to accept any commands to Mach3, any help would be appreciated.

I am making a stand alone exe program, I have gone to Project/References and included Mach4 (why 4 and not 3?) which shows the path as c:\mach3\Mach3.exe, when I go to the Object browser I can see the Mach4 library with the class CMach4Doc, but if I try to call any command (e.g. CloseFile()) I just get errors (Expected Function or Variable (x=CloseFile()), or Expected = (CloseFile()).

I have tried declaring the Sub CloseFile()  as Private Declare Sub CloseFile Lib "Mach4" () OR Private Declare Sub CloseFile Lib "C:\Mach3\Mach3.exe" () OR Private Declare Sub CloseFile Lib "Mach4.CMach4Doc" () but that does not help either.

I did notice all commands, bar a few, are showing as events, as against Function or subs, so how would I call a command like GetLED() ?

Nick
Title: Re: Help with VB program
Post by: ger21 on January 11, 2010, 08:34:50 AM
I believe you'll need to write a C++ plugin. I could be wrong, but I don't think VB will work.
Title: Re: Help with VB program
Post by: MiniDave on March 05, 2010, 01:57:32 PM
Nick,
Did you get any further with the project? Did you find is it possible to write a VB plugin? or must we use C++

Many Thanks
Title: Re: Help with VB program
Post by: nickashton on March 05, 2010, 03:35:56 PM
MiniDave
Sorry, having read the previous reply I moved onto something else.
Nick