LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GrayWolf TG501 active X control only works for the first run

I am required to interface the TG501 with Labview. I received an activeX control from Graywolf for this device. I also recevied an example in VB script to demostrate how to use the control.

I was able to load the activeX control in Labview from my program, but it only works for the first run. I need to close my program and reopen it in order to get it works, but again, only the first run is working.

The VB script work fine, therefore, the people from Graywolf and I thought the problem may due to labview itself.

I attached my program "TG-501.vi", the control "ProbeX.ocx" and the VB example "ProbeX Example.xls" here.

Many thanks.
Download All
0 Kudos
Message 1 of 3
(2,796 Views)
Hi,

In your LabVIEW program, you open a reference to your ActiveX object. You then Open something inside your object. At the end you Close something (the same thing you opened) inside your object, but you don't close the reference to your ActiveX object. You need to add a Close Reference function at the end of your VI to close this reference. I recommend that you add a Simple Error Handler at the end also. Refer to the attached picture for a visual.

Note: The reason why it works when you close the VI and then reopen it is because LabVIEW does some automatic "clean-up," which includes closing references.

Hope this helps!

Travis H.
National Instruments
Travis H.
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 3
(2,796 Views)
Hello Travis,

I tried to add a Close Reference and the error handler as shown in your diagram. However, this does not solve the problem, and again, closing and reopen it will make it works.

I am wondering what other "clean-up" do I need to put into my program.

Many many thanks.

TG501 User
0 Kudos
Message 3 of 3
(2,796 Views)