09-09-2005 09:08 AM
long session_handle;
unsigned char state_buffer[15360];
short result, cnt = 0;
/* session_handle set from a call to TMExtendedStartSession */
...
/* attempt to find the first device on 1-Wire network */
result = TMFirst(session_handle, state_buffer);
/* loop to count all of the devices on the 1-Wire network */
while (result > 0)
{
cnt++;
/* find next device */
result = TMNext(session_handle, state_buffer);
}
/* close the session with a call to TMEndSession */
...I'd be very grateful for advice on this - I think if I can get this cracked then CLNs will no longer be the scariest icon on the Labview functions palette. 09-16-2005 09:21 AM
Hi,
if I'm understanding this correctly, the state buffer is an array of U8's that gets filled in by this function.
You need to do an initialise array of the U8 type of the appropriate size, and then pass this into the dll at the appropriate parameter.
See the following example code item for a better explanation :
This should work for you, but failing that, you could always wrap it's functionality with a c-based environment, and pass the values to that from LabVIEW< using it as a means of performing the conversion.
Hope that helps
Sacha Emery
National Instruments (UK)