Pico TC08 USB THERMOELEMENT DATA LOGGER PP222 Manual Do Utilizador

Códigos do produto
PP222
Página de 42
USB TC-08 Help
17
Copyright 2004 Pico Technology Limited. All rights reserved.
 
// could terminate the application here
 }
//
// Start using the open units
//
3.3.2.2
usb_tc08_open_unit_async
short usb_tc08_open_unit_async (void)
This routine begins enumerating USB TC-08 units in the background and provides a return
immediately, so the calling thread can continue executing other code.
Note: The driver is thread safe and will not allow access to a single unit from more than one application.
If, therefore,  usb_tc08_open_unit_async does not find a unit, check that other applications are
not using the same USB TC-08. This includes applications on other user accounts on the same
computer, where fast user switching is supported.
Arguments
None
Returns:
1
- The call was successful.
0
- No more units were found.
-1
- An error occurred, call 
 with a handle of 0 to obtain the error
code.
Example
The following code is a fragment of a C application which demonstrates how to open a single unit with
the asynchronous open unit functions:
//======================================================
// Opening a unit asynchronously
//======================================================
// Tell the driver to start enumerating the unit in the background
// (usb_tc08_open_unit_async returns immediately)
();
// handle any error conditions
if
 (result == -
1
)
 {
(
0
);
 printf(
"Unit failed to open\nThe error code is %d"
, error_code);
 
// could terminate the application here
 }
else
 
if
 (result == 
0
)
 {
 printf(
"No USB TC08 units found"
);