LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accesing COM child object

Hello,

 

I'm trying to use a library to interface some LVDT gauges from Marposs. It's implemented through COM objects and I have it working in Excel with VBA with this code:

 

PrivateSubCommandButton1_Click()

Dim oSmaoMain As SMAO.SMaoMain
Dim clsInfo As SMAO.Info
Dim sInfo AsString

'Initialize the SMAOMain Object Set oSmaoMain = New SMAO.SMaoMain oSmaoMain.Initialize
'
List all the InstalledDriversFor i =1To oSmaoMain.DriversCount sInfo = sInfo &"Driver Name : "& oSmaoMain.Driver(i)&" "& oSmaoMain.DriverDesc(i)& vbNewLine NextMsgBox sInfo, vbOKOnly,"Installed Drivers"'List all the Enabled Drivers
Set clsInfo = oSmaoMain.Info sInfo = "" For i = 1 To clsInfo.DriversCount sInfo = sInfo & "Driver Name : " & clsInfo.Driver(i) & " " & clsInfo.DriverDesc(i) & vbNewLine Next MsgBox sInfo, vbOKOnly, "Enabled Drivers"
Set clsInfo = Nothing Set oSmaoMain = Nothing
End Sub

When I port this code to LabVIEW I get answer from the SMAO.SMaoMain, correct initilization and even I can read the main objects properties. The problem comes when I try to access it's child object SMAO.SMaonMain.Info. When I get the reference and I make calls to the methods/properties, I get different results, always 0 drivers enabled.

 

I've attached the LabVIEW code I'm using and some captures of the creatable objects I can see from LabVIEW.

 

TestMarposs.png

 

 

Creatable_objects.PNGCreatable_objects_smaomain.PNGCreatable_objects_smaoinfo.PNG

 

Any idea of what could be happening?

0 Kudos
Message 1 of 5
(2,798 Views)

Idea: do not connect anything to ConfigurationName in SMaoMain.Initialize.

0 Kudos
Message 2 of 5
(2,784 Views)

Hi, I've already tried with this and nothing changes the end result. If I browse the TypeLibs of my system with OLEViewer I get this info for coClass SMaoMain._SMaoMain:

 

[
uuid(A93A6FAF-0144-4F4F-B887-174E537C5D83),
version(1.1),
hidden,
dual,
nonextensible
]
dispinterface _SMaoMain {
properties:
methods:
[id(0x68030007), propget]
VARIANT_BOOL InError();
[id(0x68030006), propget]
_Info* Info();
[id(0x68030005), propget]
BSTR Driver([in] short DriverIndex);
[id(0x68030004), propget]
BSTR DriverDllProg([in] short DriverIndex);
[id(0x68030003), propget]
BSTR DriverDesc([in] short DriverIndex);
[id(0x68030002), propget]
BSTR DriverVersion([in] short DriverIndex);
[id(0x68030001), propget]
VARIANT Drivers();
[id(0x68030000), propget]
short DriversCount();
[id(0x60030009)]
_SingleChannel* NewSingleChannel();
[id(0x6003000a)]
_MultiChannels* NewMultiChannels();
[id(0x6003000b)]
short Initialize([in, optional, defaultvalue("")] BSTR ConfiGurationName);
[id(0x60030013)]
_DynamicChannels* NewDynamicChannels();
};

0 Kudos
Message 3 of 5
(2,782 Views)

Still trying to solve it... I've tried casting the reference, creating other objects, storing the references... nothing changes.

0 Kudos
Message 4 of 5
(2,747 Views)

Hi,

I have a problem with EasyBox hardware communication into a new project.

The hardware connect via USB and Marposs only send us a cd with drivers library, but no sample program to connect.

 

Can anybody help me????

Thanks!!!

0 Kudos
Message 5 of 5
(2,243 Views)