Hello Guest it is March 29, 2024, 07:25:56 AM

Author Topic: Help with VB program  (Read 3411 times)

0 Members and 1 Guest are viewing this topic.

Help with VB program
« 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

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Help with VB program
« Reply #1 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.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Help with VB program
« Reply #2 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
Re: Help with VB program
« Reply #3 on: March 05, 2010, 03:35:56 PM »
MiniDave
Sorry, having read the previous reply I moved onto something else.
Nick