LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

use active-x in labview

There is a sensor network called 1-wire, by dallas semiconductors (www.1-wire.com). I am trying to communicate with the sensors using their drivers written as COM objects. I started a VI design of the following example(Originaly written in JS:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
boolean doing_work=true;
// get the 1-Wire access provider
var access = WScript.CreateObject("owapi.OneWireAccessProvider");
// get the default adapter
var adapter = access.getDefaultAdapter();
// work loop
while (doing_work)
{
// get exclusive use of adapter (SESSION)
adapter.beginExclusive(true);
// clear any previous search restrictions (NETWORK)
adapter.setSearchAllDevices();
adapter.targetAllFamilies();
adapter.setSpeed(adapter.SPEED_REGULAR);
// enumerate through all the 1-Wire devices found (NETWORK)
for (Enumeration owd_enum = adapter.getAllDeviceContainers();
owd_enum.hasMoreElements(); )
{
// get a ‘container’ for each device
owd = owd_enum.nextElement();
// do SOMETHING with device found (TRANSPORT/FILE/DEVICE)
// . . .
}
// end exclusive use of adapter (SESSION)
adapter.endExclusive();
// do other application work
// . . .
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I got stuck with the declaration :

adapter.beginExclusive(true);

as it is tripple depth referenced which i dont know how to do in LV

I will happily send the drivers and SDK with the COM objects to anyone who can help me.

Thanks
Uri
0 Kudos
Message 1 of 3
(2,331 Views)
Hard to tell from a typeless language like JS, but I would assume that the following code

var access = WScript.CreateObject("owapi.OneWireAccessProvider");
var adapter = access.getDefaultAdapter();
adapter.beginExclusive(true);

has access as a COM object and adapter as a COM object. If they are declared as such in the type library, then you should get an automation reference for each. Then calling the beginExclusive() method should be straightforward. What are you getting as a wire type for getDefaultAdapter()? I am assuming you are doing Automation Open for the first method...

I went to the website but I don't read Chinese so that is all I know right now.
0 Kudos
Message 2 of 3
(2,320 Views)
Please e-mail me for complete data and my attempt
uri.harari@freescale.com
Thanks
uri
0 Kudos
Message 3 of 3
(2,310 Views)