top01.jpg (17169 bytes)
mleft.jpg (4986 bytes) m01a.jpg (6169 bytes)     m02a.jpg (6905 bytes)     m03a.jpg (7743 bytes)    m04a.jpg (7456 bytes)     m05a.jpg (7878 bytes)     m06a.jpg (6862 bytes)     m07a.jpg (6076 bytes) mright01.jpg (5078 bytes)

ADU  Series - USB Data Acquisition Interface SDK

Device List Example

The following code prompts the user for 2 serial numbers. One for a strain gauge (scale) and one for a proximity sensor (counter).

The returned serial numbers are stored for subsequent OpenAduDeviceBySerialNumber calls. The serial numbers should also be saved in persistent storage so the serial number selection process is used only on initial configuration.

    char szScaleSerialNumber[8];
    char szCounterSerialNumber[8];
    ADU_DEVICE_ID myAduDeviceId;

    ShowAduDeviceList(&myAduDeviceId, "Select the strain gauge");
    if (myAduDeviceId.iProductId)
    {
        strcpy(szScaleSerialNumber, myAduDeviceId.szSerialNumber);    	
    } // end if

    ShowAduDeviceList(&myAduDeviceId, "Select the proximity sensor");
    if (myAduDeviceId.iProductId)
    {
        strcpy(szCounterSerialNumber, myAduDeviceId.szSerialNumber);    	
    } // end if

The code displays the following screens.

Note the prompt for the strain gauge.

Note the prompt for the proximity sensor.

Warning - Multiple Handles

The AduHid.DLL allows you to open multiple handles to the same ADU device. Thus multiple processes and threads can access a single ADU device simultaneously. However the application program must ensure that no conflicting commands are issued to the ADU device and that all input is interpreted correctly.
Especially note the description of RS232 Command-Response Behavior.

Check to ensure that the user has not inadvertently selected the same device twice (unless two handles to the same device are actually required).

Visual Basic Source Code

Dim iRC As Long
Dim myAduDeviceId As ADU_DEVICE_ID
Dim sScaleSerialNumber As String * 7
Dim sCounterSerialNumber As String * 7

iRC = ShowAduDeviceList(myAduDeviceId, "Select the strain gauge")
If (myAduDeviceId.iProductId > 0) Then
    sScaleSerialNumber = myAduDeviceId.sSerialNumber
End If

iRC = ShowAduDeviceList(myAduDeviceId, "Select the proximity sensor")
If (myAduDeviceId.iProductId > 0) Then
    sCounterSerialNumber = myAduDeviceId.sSerialNumber
End If

 

NEWS         PRODUCTS         PROGRAMMING          APPLICATIONS          CUSTOM DESIGN          ORDERING          HOME


TestPoint is a trademark of Capital Equipment Corp.   
LabVIEW is a trademark of National Instruments.
Visual BASIC is a trademark of Microsoft Corporation


Copyright © 2002 ONTRAK CONTROL SYSTEMS 764 Notre Dame Ave, Unit #1 , Sudbury, Ontario, CANADA P3A 2T2  
"Quality serial Data Acquisition Interfaces"           PH. (705) 671-2652 FAX (705) 671-6127