Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69088

Accesing COM child object

$
0
0

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)& vbNewLineNextMsgBox 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?


Viewing all articles
Browse latest Browse all 69088

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>