12-14-2009 01:06 PM
Hi guys and gals,
I have a tangle of a mess here! Let me start from the beginning. I have a typelib on my computer called "xTInstrument component library version 1.0" I opened the .dll containing the typelib in OLE/VIEW and discovered that the classes I need to use are "non-createable" coclasses mixed in with interfaces. For example, the class I want to use is called "Electron Beam" and it has a property called "HV" which has a method called "SetTargetValue" So I dropped an "Automation Open" vi on the block diagram and wired it all up. When I go to run the program I get the following error "Class not registered in Test.vi" To find out what dlls Labview was calling, I used Process Monitor and watched what it was looking for. I found and registered all the dlls using "regsvr32.exe dll." Now this is where it gets wierd. After registering the dlls, the program still tripped the "Class not registered in Test.vi" error, so I decided to use Process Monitor to check what CLSID were being called. I then searched my registry for the CLSID my LabVIEW program was calling. I found all the CLSIDs except the ones from the non-creatable classes. Is there anyway in LabVIEW to call these "non-creatable" classes?
12-15-2009 03:41 PM
Hi shivels,
I did some research into non-creatable classes and this is what I found out. A non-creatable class (Microsoft terms them "PublicNotCreatable") is available externally but cannot be instantiated externally. Instead, the object is instantiated indirectly though fucntions, such as a Get function. The reasoning that I can see is that there may be dependencies on other objects so the order in which the objects are instantiated is important. By making a class PublicNotCreatable, the developer can force the user to programmatically construct the objects through calling a Get method.
I did uncover a Microsoft bug report regarding PublicNonCreatable classes: http://support.microsoft.com/kb/244544.
Also, here is Microsoft's definition:(http://msdn.microsoft.com/en-us/library/aa242107%28VS.60%29.aspx)
PublicNotCreatable means that other applications can use objects of this class only if your component creates the objects first. Other applications cannot use the CreateObject function or the New operator to create objects from the class.
What I suspect in your situation is that the Electron Beam may be a PublicNotCreatable class object, so a get function would be required.
I hope this helps. Let me know if you have any further questions!
Kristen H.
12-17-2009 10:00 AM
Hi Kristen,
I think I"m starting to understand the ActiveX Classes in LabVIEW. I have a question about calling a typelib. I have a typelib called "QuantaInstrumentBrickLib" When I select this ActiveX Class, it contains only one creatable class, "CoQuantaFEGInstrumentBrick". I'm alittle confused because it has no properties or methods, which leads me to believe this is the instantiation class, because I have another typelib called "Quanta Instrument component library." Would it be possible to use a sequence structure and make case "0" the ActiveX Automation Open for "CoQuantaFEGInstrumentBrick" then make case "1" the location where I call the classes for the "Quanta Instrument component library"? Or would I have to do some kind of typecast to call the classes?
Cheers,
Shivels
12-17-2009 11:12 AM
You should try the ActiveX container on the FP, some ActiveX components (i think they are called 'ActiveX controls') are not available through the Automation Open function but have to be directly placed on the window.
Felix
12-18-2009 07:36 AM
Hi Felix,
I tried doin the container thing, but when I do, it just puts a box on the front panel with a folder with an "x" icon inside the box and prints the name of the .ocx file below it. I'll admit, my knowledge of ActiveX controls is very, very limited. I think I have to typecast the "non-creatable" classes to objects that use the objects but I have know idea how to do this.
12-18-2009 01:50 PM
There is a right-click option like 'Select ActivX Class...' (I do not remember the correct name) which allows you to browse through the possible ActiveX controls.
Felix
12-18-2009 05:02 PM
Hi shivels,
Here are some more resources about ActiveX:
I hope this helps!
Kristen H.
04-18-2010 02:51 PM
hi,
have been doing a project on the 8051 muc kit. now we need to display the contents on the labview. how do i interface my kit using visa protocol??
04-19-2010 06:00 PM
Hi JJDVH,
I am not positive on the capabilities of the 8051 microcontroller and would like to know if the manufacturer has specified that it will communicate through the VISA protocol. If so, what version of NI VISA do you have and what version of LabVIEW do you have?
Thanks