ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a parameter (java) through invoke node

HI.

I have separatde the code example below into sections, please read my coments.
I have opend the code as activeX, and I can access all the methodes, but passing the selected adapter is a problem.

This part works, I can get the default adapter and read it out to my .vi front.

boolean doing_work=true;
// get the default adapter from the service provider
DSPortAdapter adapter = OneWireAccessProvider.getDefaultAdapter();

This part does not work, I get an error saying that a parameter is missing, my guess is that the missing parameter is the "adapter" (as in adapter.beginExclusive()

// 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
OneWireContainer owd = ( OneWireContainer ) owd_enum.nextElement();
// do SOMETHING with device found (TRANSPORT/FILE/DEVICE)
// . . .
}
// end exclusive use of adapter (SESSION)
adapter.endExclusive();
// do other application work
// . . .
}

It has to be said that the original code is Java. But since parts of the code works, and all I need apparantly is to find out how to pass a parameter.

The project is 1-wire (micro-lan/ibutton) and additional information can be found on www.ibutton.com. Also I'll provide all the information that I have. The 1-wire usb adapter can be ordered as a sample from the above site.

Please help!
0 Kudos
Message 1 of 2
(2,868 Views)
I have now been abel to get some parts of it working.
I can even read the uniq ID of the thermometer, but I have no success in reading the temperature.

If you have any experience with 1-wire, please contact me

J;-)
0 Kudos
Message 2 of 2
(2,842 Views)