LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mach3 ActiveX

Solved!
Go to solution

Hello Experts,

 

I am in trouble with an ActiveX Call.  Given an application called: Mach3 a CNC program. Link: http://www.machsupport.com/downloads.php     Mach3 R3.043.066

 

I would like to interface it with LabVIEW via ActiveX. I found a similar topic in NI forum but the questioner uses LabWindows/CVI. Link: http://forums.ni.com/t5/LabWindows-CVI/ActiveX-controller-methods-import-as-callbacks/td-p/1038846

 

After installing the Mach3 on WindowsXP 32Bit, I found the tlb file that can be used for ActiveX calls under the following path: C:\Mach3\Mach4.tlb.

 

When I check : "Show Creatable Object Only" I can not see the complete list of ActiveX calls and function returns an error: 

Class is not registered.

 

I've registered the Mach4.tlb file with regtlb.exe under Windows\.NET\Framework without any success.

 

Selecting IMyScriptObject to open, the ActiveX calls appeared but I always got an error message: Object specified is not creatable in ... 

 

Could you give me some help how to go on? Looking forward you kind reply!

 

 

 

 

 

 

 

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 1 of 7
(7,059 Views)
Solution
Accepted by topic author D60

Hi!

 

I've downloaded the current versin of Mach3. What worked for me was:

 

1. Restarting computer after installing Mach3.

1. Make sure Mach3 is running in the background, without that, class objects we not available.

2. Create an Automation Open, with a constant as the input.

4. Browse for object class, select:

Mach4.jpg

 

5. There's a handful of methods available for that particular class. This code checks the revision nr.:

Mach4.png

 

This is what I was capable of reaching via LV ActiveX.

 

Hope this helps.

Regards:

 

Andrew Valko

NI Hungary

Andrew Valko
National Instruments Hungary
Message 2 of 7
(7,027 Views)

Thank you so much for your help. I have tried something similar to your code, but Mach3 was not running. You are great!

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 3 of 7
(7,018 Views)

HI, I am also working on the same thing. 

But I need to use the functions which are in  the non-creatable classes IMyscriptobject. 

 

from the this earlier post  on Lbawindows CVI , http://forums.ni.com/t5/LabWindows-CVI/ActiveX-controller-methods-import-as-callbacks/td-p/1038846

I  understand that we need the following steps(correct me if am wrong)

 

// get Imach4(which we do when we invoke node after giving the refunm and autmation open)

   Mach4_ActiveIMach4 ("c:\\Mach3\\Mach3.exe", 1, LOCALE_NEUTRAL, 0, &MachHandle);

 

//get SprictObjectHandle  using GetScript Dispatch ( we have this function in Ithe node IMach4 we created earlier)
    Mach4_IMach4GetScriptDispatch (MachHandle, NULL, &ScriptObjectHandle);

 

// get the final function needed from scriptobjecthandle.
    Mach4_IMyScriptObjectCode (ScriptObjectHandle, NULL, "G20 x-1 z-1 y-1");

 

How can we do this is Labview (with just the GUIs)

For example, I want to use DoOemButton(135) . How would I do that. 

 

Thanks in advance.

 

 

 

0 Kudos
Message 4 of 7
(6,637 Views)

hello 

i also same problem have

 

Mach3 ActiveX use make Labview VI

 

i find your Answer  

 

then i try make Same make ,

 

if run exec Mach3.exe just run......

 

i just want use dll.. but can't?

 

Please help your answer

0 Kudos
Message 5 of 7
(5,269 Views)

I found additional information that might be helpful here.  On the NewFangled Solutions MachSupport forum I found this post that also explains how to get more useful features out of the ActiveX object in LabVIEW.  

 

It was posted by a user SamZ at https://www.machsupport.com/forum/index.php?topic=23525.msg165202#msg165202

 

I hope this helps someone else.

0 Kudos
Message 6 of 7
(5,042 Views)

한국분들은 아래 영상 참조하세요~

 

https://youtu.be/3J22mikGUxo

 

 

 

0 Kudos
Message 7 of 7
(4,137 Views)