LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ThorLabs ActiveX question

I'm not very versed in ActiveX (or most others Microsoft alphabet soup techonologies de jour) and I'm a bit puzzled by the ActiveX interface that comes with a Thorlabs APT controller system.

 

If I place an ActiveX container in the front panel, then inside it an object of a system provided type, MG17System, I can go to the block diagram and call methods on the reference that is there, e.g. the simple AboutBox method.  Using the help system the wire from the reference into the method call shows up as "MG17System  MG17SystemLib.MG17System".

 

If instead I start with an AutomationOpen call, wire a constant to it, and select for it what I think is the equivalent ActiveX  Clas, wire it to the same AboutBox method, followed by an AutomationClose call, the code fails with an error of "Automation Open: Object specified is not creatable". The wire into the AboutBox method shows only "MG17SystemLib.MG17System, but that looks to me like the same thing.

 

Can someone please illuminate me on the difference?

 

0 Kudos
Message 1 of 12
(5,171 Views)
I tink that initialization of an ActiveX control by putting it into an ActiveX container has to do a lot more fancy things than using the "Automation Open" primitive. AFAIK "Automation Open" just creates a coclass instance but the ActiveX container has also to initialize the GUI part of the control and some more stuff regarding OLE.
0 Kudos
Message 2 of 12
(5,143 Views)

The APT ActiveX control works as a client/server relationship. The control is active from moment it is contained and long as the APT software is installed and operational. For each control type there are specific serial numbers that identify the type of control and its unique ID so communication can be established between the application and the control, client/server. When an ActiveX control is inserted the control is just a general GUI. Once the serial number is added the GUI will run into that specific ActiveX control, say a Piezo Driver instead of the Servo Motor Driver.  This is great since it is software independent as long as the software supports ActiveX (which are nearly all MS bundles). The caveat to that is that it is a MS COM object and will only work on an MS Windows OS, no Linux nor Mac, which does not support ActiveX. There is a known issue with VIs created or edited in LabVIEW 8.2 or 8.2.1 that was fixed in LabVIEW 8.5.  To fix this issue, you must recreate the code containing the Automation Open VI in LabVIEW 8.5 or later.  The code cannot be saved or edited in LabVIEW 8.2, or the error will persist.

0 Kudos
Message 3 of 12
(5,114 Views)

Well, ignoring  "This is great ... as long as the software supports ActiveX" part, which is quite debatable, this implementation also makes it a bit harder to create things on the fly/dynamically, which I could otherwise achieve by an automation open.  The fact that it provides a GUI is a bit irrelevant when one just wants to control this stuff automatically, and not use the provided GUI at all. 

 

But that is a bit orthogonal to this forum, I was just curious on the difference in behavior and whether it was under my control whether to place a container on the front panel or simply use automation open, and I guess it is not.

 

0 Kudos
Message 4 of 12
(5,103 Views)

No it is indeed not at your control. Active X knows basically two types of Servers. One is a so called ActiveX Control which is an object that supports a GUI and the other is an ActiveX Automation Object that has only methods and properties but no GUI support. There are many subvariants especially of the Automation Object type, being single threaded, apartement threaded, out of process servers and maybe even more flavors.

While it is possible to create an ActiveX control that also supports a simple Automation Server interface, this is not usually done. So you are indeed stuck with the interface that the developer of the ActiveX component has decided upon. And I agree that for instrument control the use of an ActiveX control feels a bit strange.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 12
(5,093 Views)

There is away around this. If you are good in low level programming you could go that route. After all it's just serial communication over a USB port. Not sure how easy this would be in LabView but certrainly doable in C/C++.

0 Kudos
Message 6 of 12
(5,085 Views)

This now really belongs in a ThorLabs support forum, not here, thus I'm emailing Ludwig.  I did pose my questions here, as I didn't get any API but the ActiveX interface.

 

 

0 Kudos
Message 7 of 12
(5,079 Views)

 


leichner@thorlabs.com wrote:

There is away around this. If you are good in low level programming you could go that route. After all it's just serial communication over a USB port. Not sure how easy this would be in LabView but certrainly doable in C/C++.


Be assured that if it is doable in C then it certainly is in LabVIEW too, and if you know LabVIEW a little bit, it's actually a lot easier than in C.

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 12
(5,030 Views)

Hi Everyone,

                  I am really very new to Labview and i am in great need for some help.I am assigned a task where i am supposed to create a labview program to control or moniter a BPC203 Piezo controller. I created a program with the help of the instructions provided in the APT-Labview guide provided by Thorlabs.But th program doesnt run . Whenever i try to run it i get the same error which says that "Control HW Communications disabled".I have attached a snapshot of the error message.So i tried to create a small program in labview which would read the volage output.Even there i got the same error message.I suppose there is some mistake on my part which i am not able to correct due to the lack of proper knowledge.Could anyone please help me to solve this problem.A slight elaboration would be highly appreciated.

Download All
0 Kudos
Message 9 of 12
(4,294 Views)

@SNB wrote:

Hi Everyone,

                  I am really very new to Labview and i am in great need for some help.I am assigned a task where i am supposed to create a labview program to control or moniter a BPC203 Piezo controller. I created a program with the help of the instructions provided in the APT-Labview guide provided by Thorlabs.But th program doesnt run . Whenever i try to run it i get the same error which says that "Control HW Communications disabled".I have attached a snapshot of the error message.So i tried to create a small program in labview which would read the volage output.Even there i got the same error message.I suppose there is some mistake on my part which i am not able to correct due to the lack of proper knowledge.Could anyone please help me to solve this problem.A slight elaboration would be highly appreciated.


Start your own thread.

 

0 Kudos
Message 10 of 12
(4,289 Views)