You are on page 1of 29

PCIUT3100(T)-SDKLV

Software Development Kit for LabVIEW for PCIUT3100 PCIUT3100T PCIUT3100M PCIUT380 UTM

Users Guide

US Ultratek, Inc. 4070 Nelson Ave. Suite B Concord, CA 94520 USA Tel: (925) 687-7688 Fax: (925) 687-7689 Web: usUltratek.com E-mail: tech@usUltratek.com

Revision 35

June 10, 2007

Table of Contents
1. About Software Development Kit ..........................................................................................................................1 2. Hardware Configurations .......................................................................................................................................2 2.1 J360 Quadrature Encoder Inputs and Digital I/O Pins...................................................................................2 Table 1. Connector J360 without Internal Differential Line Receivers .................................................................3 Table 2. Connector J360 with an Internal Differential Line Receiver ...................................................................4 Table 3. Connector J360 with 14-bit Analog to Digital Converters ......................................................................5 Table 4. DB9 Male Encoder Connector for PCIUT380.........................................................................................5 2.2 J205 Connector for Controlling DT16B Multi-channel Switching Board .....................................................5 2.3 J980 Connector for External Clock................................................................................................................5 3. Dynamic Link Library ............................................................................................................................................7 3.1 ISDATAREADY (mode = 1000), Get data status.........................................................................................7 3.2 SOFTWARETRIGGER (mode = 1001), Generate a software trigger...........................................................7 3.3 SETSAMPLINGRATE (mode = 1002), Set Sampling Rate .........................................................................7 3.4 SETDACENABLE (mode = 1003), Set DAC on/off ....................................................................................8 3.5 SETLOWPASSFILTER (mode = 1004), Set Low Pass Filter ......................................................................8 3.6 SETHIGHPASSFILTER (mode = 1005), Set High Pass Filter.....................................................................9 3.7 SETRECTIFIER (mode = 1006), Set Rectifier .............................................................................................9 3.8 SETDAMPING (mode = 1007), Set Damping Resistor ................................................................................9 3.9 SETTRANSDUCERMODE (mode = 1008), Set Transducer Method ..........................................................9 3.10 SETBUFFERLENGTH (mode = 1009), Set Buffer Length........................................................................10 3.11 SETTRIGGERDELAY (mode = 1010), Set Trigger Delay ........................................................................10 3.12 SETPULSEVOLTAGE (mode = 1011), Set Pulse Voltage ........................................................................10 3.13 SETPULSEWIDTH (mode = 1012), Set Pulse Width.................................................................................10 3.14 SETGAIN (mode = 1013), Set Gain...........................................................................................................11 3.15 SETDCOFFSET (mode = 1014), Set DC Offset ........................................................................................11 3.16 SETDACTABLE (mode = 1015), Set DAC table ......................................................................................11 3.17 SETADTRIGGERSOURCE (mode = 1016), Set A/D Trigger Source ......................................................12 3.18 GETENCODERCOUNTER (mode = 1017), Get Encoder Counter...........................................................12 3.19 SETENCODERCOUNTER (mode = 1018), Set Encoder Counter............................................................12 3.20 GETDATA (mode = 1019), Get Digitized Data from Memory .................................................................12 3.21 RESETCOUNTER (mode = 1020), Reset A/D Board ...............................................................................13 3.22 RESETMEMORY (mode = 1021), Reset Memory ....................................................................................13 3.23 SETOFFSETADJUSTMENT (mode = 1022), Reset DC Offset Adjustment ............................................13 3.24 GETMODELNUMBER (mode = 1023), Get Board Model Number.........................................................13 3.25 GETSERIALNUMBER (mode = 1024), Get Serial Number .....................................................................13 3.26 GETMEMORYSIZE (mode = 1025), Get Memory Size ...........................................................................13 3.27 GETMINPULSEWIDTH (mode = 1026), Get Minimum Pulse Width......................................................14 3.28 SETMCHANDAMPING (mode = 1027), Set a Series of Damping Resistors ...........................................14 3.29 SETMCHANTRANSDUCERMODE (mode = 1028), Set a Series of Transducer Modes ........................14 3.30 SETALLPARAMETERS (mode = 1029), Set All the Parameter on PCIUT3100 Board ..........................14 3.31 SETPULSERCHANNEL (mode = 1030), Set Pulse Out Channel.............................................................14 3.32 SETRECEIVERCHANNEL (mode = 1031), Set Receiver Channel..........................................................15 3.33 SETCHANDAMPING (mode = 1032), Set Damping Resistor of a Channel.............................................15 3.34 SETCHANTRANSDUCERMODE (mode = 1033), Set Transducer Mode of a Channel..........................15 3.35 GETOPTIONBYTE1 (mode = 1034), Get Option Byte 1..........................................................................15 3.36 GETOPTIONBYTE2 (mode = 1035), Get Option Byte 2..........................................................................16 3.37 GETREVNUMBER (mode = 1036), Get Revision Number of the Driver.................................................16 3.38 SETLOGAMP (mode = 1037), Set Logarithmic Amplifier .......................................................................16 3.39 SETPRF (mode = 1038), Set Pulse Repetitive Frequency..........................................................................16 3.40 SETIOPORT (mode = 1039), Set and Read I/O Port Status.......................................................................16

3.41 CONFIGUREIOPORT (mode = 1040), Configure I/O Port Type .............................................................16 3.42 GET14BITADC (mode = 1041), Get Data from 14-Bit A/D Converter ...................................................17 3.43 GET9BITDATA (mode = 1042), Get Data in 9-Bit Format ......................................................................17 3.44 GET14BITADCINPUTRANGE (mode = 1043), Get Input Range of 14-Bit ADC...................................17 3.45 GETVMIN (mode=1044), Get Minimum Voltage ......................................................................................17 3.46 GETVMAX (mode=1045), Get Maximum Voltage....................................................................................18 3.47 SETTONEBURSTFREQUENCY (MODE=1046), Set Tone Burst Frequency..........................................18 4. Data Acquisition Procedures ................................................................................................................................19 5. Working with LabVIEW ......................................................................................................................................20 5.1 Sample Program ................................................................................................................................................20 5.2 Use Dynamic Link Library................................................................................................................................20 Appendix A PCIUT.H Header File ..........................................................................................................................23

WARNING
PCIUT3100 AND DT16B (DT8B) BOARDS OPERATE ON HIGH VOLTAGES. TO AVOID INJURIES, DO NOT TOUCH OR HANDLE THE BOARDS UNTIL AT LEAST 20 MINUTES AFTER THE COMPUTER'S POWER HAS BEEN TURNED OFF.

Copyright 1999-2007 US Ultratek, Inc. All Rights Reserved

PCIUT3100-SDKLV Software Development Kit for LabVIEW

1. About Software Development Kit


This software development kit is designed for software engineers and programmers who would like to write their own program with LabVIEW to control PCIUT3100 series pulser/receiver and analog to digital converter board and PCIUT3100T tone burst pulser/receiver and analog to digital converter board. Before install this software development kit into your computer, you need to install the driver and the standard oscilloscope software that come with the board, and make sure that the board is working properly. Refer to PCIUT3100 board users guide for details. Follow the instructions on the SDK floppy disk to install the software into your hard disk drive. By default all the files will be installed in the following directory: C:\USUTsdk\PCIUTDLL\LabVIEW The files are listed below: PCIUTDLL.dll PCIUTDLL.lib pciut.H PCIUTLV.VI PCIUT3100sdkLV.PDF32-bit dynamic link library to control PCIUT3100 board Import library. Need to be in the same directory as PCIUTDLL.dll Header file which defines the function prototype and symbols. Example program for LabVIEW PDF version of this users guide.

The installation program also installs the following driver programs in the appropriate directories: pci9050.sys to c:\windows\system32\ directory plxapi.dll to c:\windows\system\ directory pcisdk.inf to c:\windows\Inf\other\ directory More than one PCIUT3100 boards can be installed in a computer. The user can write a program to talk to any board in the computer. The following sections describe how to control the board via a dynamic link library.

PCIUT3100-SDKLV Software Development Kit for LabVIEW

2. Hardware Configurations

The picture above shows the board layout and connector locations of a PCIUT3100 pulser/receiver and A/D combo board. There are four connectors at the left end of the board. They are PULSE OUT, RECEIVE IN, EXTERNAL TRIGGER IN, and SYNC OUT (optional). The first two connectors can be connected to a transmit transducer and a receive transducer. If the pulse/echo method is used the RECEIVE IN connector can be left open. When more than one PCIUT3100 boards are used, one of the boards will be the master board, and the rest of them are slave boards. All the EXTERNAL TRIGGER IN connectors on the slave boards are connected to the SYNC OUT connector of the master board. In this case when the master board takes data all the slave boards will take data at the same time. The following sections provide some technical information about the connectors on the board.

2.1

J360 Quadrature Encoder Inputs and Digital I/O Pins

J360 is a 26-pin header connector. It consists of encoder inputs, 8 digital inputs and 8 digital outputs. A ribbon cable with a 26-pin header connector and a DB25 female connector is provided with the encoder option. The following picture shows the pin location and the connections. Red wire is pin 1
1 3 5 7 2 4 6 8

DB25 Female

26

PCIUT3100-SDKLV Software Development Kit for LabVIEW The table below shows the definition of the pins on J360 when no internal differential line receiver is installed.

Table 1. Connector J360 without Internal Differential Line Receivers Pin # on Pin # on Pin Descriptions J360 DB25F name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 No connection A1 B1 A3 B3 5V GND A2 B2 A4 B4 OUT0 OUT1 OUT2 OUT3 OUT4 OUT5 OUT6 OUT7 IN0 IN1 IN2 IN3 IN4 IN5 IN6 IN7 TTL digital input with a 10K ohm pull-up resistor on each pin. They can be programmed to digital outputs. Channel A of the first encoder (X axis) Channel B of the first encoder (X axis) Channel A of the third encoder (Z axis) Channel B of the third encoder (Z axis) 5VDC Power supply to encoders Ground return from encoders Channel A of the second encoder (Y axis) Channel B of the second encoder (Y axis) Channel A of the forth encoder (W axis) Channel B of the forth encoder (W axis) TTL digital output. They can be programmed to digital inputs.

The table below shows the definition of the pins on J360 when an internal differential line receiver is installed.

PCIUT3100-SDKLV Software Development Kit for LabVIEW

Table 2. Connector J360 with an Internal Differential Line Receiver Pin # on Pin # on Pin Descriptions J360 DB25F name
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 No connection A1P B1P A1N B1N 5V GND A2P B2P A2N B2N OUT0 OUT1 OUT2 OUT3 OUT4 OUT5 OUT6 OUT7 IN0 IN1 IN2 IN3 IN4 IN5 IN6 IN7 TTL digital input with a 10K ohm pull-up resistor on each pin. They can be programmed to digital outputs. A+ of the first encoder (X axis) B+ of the first encoder (X axis) A- of the first encoder (X axis) B- of the first encoder (X axis) 5VDC Power supply to encoders Ground return from encoders A+ of the second encoder (Y axis) B+ of the second encoder (Y axis) A- of the second encoder (Y axis) B- of the second encoder (Y axis) TTL digital output. They can be programmed to digital inputs.

With the option of internal differential line receiver the maximum number of encoder counters is 2. Otherwise the maximum number of encoder counters is 4. The table below shows the definition of the pins on J360 when optional 14-bit analog to digital converters are installed.

PCIUT3100-SDKLV Software Development Kit for LabVIEW

Table 3. Connector J360 with 14-bit Analog to Digital Converters Pin # on Pin # on Pin Descriptions J360 DB25F name
1 2 to 4 5 6 7 8 to 26 1 2 to 4 5 6 7 8 to 25 5V GND AI2 AI1 Analog input of the first 14-bit analog to digital converter. Maximum absolute input range: +/-5 volts Input impedance: Not used 5VDC Power supply Ground Analog input of the second 14-bit analog to digital converter. Maximum absolute input range: +/-5 volts Input impedance: Not used

For PCIUT380 the encoder connector can be a DB9 male connector. The following table shows the pin definitions of the connector.

Pin # on DB9M
1 2 3 4 5 6 7 8 9

Table 4. DB9 Male Encoder Connector for PCIUT380 Pin Descriptions name
A1 A3 +5V A2 NC B1 B3 GND B2 Channel A of the first encoder (X axis) Channel A of the third encoder (Z axis) 5VDC to power the encoders. Maximum output current: 200 mA Channel A of the second encoder (Y axis) No connection Channel B of the first encoder (X axis) Channel B of the third encoder (Z axis) Ground return Channel B of the second encoder (Y axis)

2.2

J205 Connector for Controlling DT16B Multi-channel Switching Board

J205 is a 20-pin header connector that is used to control DT16B multi-channel switching board. Pin 1 is on the lower-left corner of the connector. A ribbon cable is provided with a DT16B board to connect PCIUT3100 board and DT16B board. See DT16B users guide for details. Since J05 is not directly programmable by the user, the pin layout is not listed in this users guide.

2.3

J980 Connector for External Clock

J980 is used for external clock connector. Pin 2 should be connected to GND and pin 1 is the clock pin. You can make your own connector by using the parts below:

PCIUT3100-SDKLV Software Development Kit for LabVIEW

Description Plug connector Connector terminals

Manufacturer Molex Molex

Manufacturer Part # 50-57-9402 16-02-0103

Vender Digikey 800-344-4539 Digikey 800-344-4539

Vender Part # WM2900-ND WM2512-ND

The input clock frequency should be lower than 100 MHz.

PCIUT3100-SDKLV Software Development Kit for LabVIEW

3. Dynamic Link Library


A dynamic link library PCIUTDLL.dll is provided with this software development kit to give a user an access to PCIUT3100 pulser/receiver and analog to digital converter board from a LabVIEW program. There is only one function call in the dynamic link library PCIUTParms() to send the parameters to the board and get acquired data as well as encoder information from the board. There are four parameters for the function call PCIUTParms(). int PCIUTParms(int mode, int board, DWORD wParam, int lParam); Parameter mode is a number starting from 1000 that defines the purpose of the function call. Different number specifies different control tasks. The values of this parameter are defined in the pciut.h file. See Appendix A PCIUT.H Header File for details. Parameter board is the board number. A 0 specifies the first PCIUT3100 board in the computer. If an invalid board number is specified, the parameter will be downloaded to the active board. A function call with a valid board number will set the active board. Parameters wParam and lParam are the additional information past to the function. They have different meanings depending on the parameter mode. Also see section Working with LabVIEW for more information. The function returns 4 if no board is detected in the computer.

3.1

ISDATAREADY (mode = 1000), Get data status

Get the status of the data acquisition process. wParam: not used lParam: not used. Return: 0 if no data in the memory yet. Otherwise there are data in the memory.

3.2

SOFTWARETRIGGER (mode = 1001), Generate a software trigger

Generate a software trigger. After this function call the board will generate a pulse from the PULSE OUT connector, and the analog to digital converter will start converting analog signal to digital data with the user-specified parameters. The digital data will be saved in the -board memory. To generate a software trigger, the trigger source needs to be set to software trigger. See the section mode=1016 below for details. wParam: not used lParam: not used. Return: 1 if successful.

3.3

SETSAMPLINGRATE (mode = 1002), Set Sampling Rate

Set sampling rate. wParam: index which is from 0 to 7. Default is 0. The following list shows the settings for

PCIUT3100-SDKLV Software Development Kit for LabVIEW PCIUT380 board. 0 - 80 MHz 1 - 40 MHz 2 - 20 MHz 3 - 10 MHz 4 - 5 MHz 5 2.5 MHz 6 - 1.25 MHz 7 - External clock The following list shows the settings for PCIUT3100 series boards: 0 - 100 MHz (not available for PCIUT3100T) 1 - 50 MHz 2 - 25 MHz 3 - 12.5 MHz 4 - 6.25 MHz 5 - 3.125 MHz 6 - 1.5725 MHz 7 - External clock lParam: Not used Return: 1 if successful.

3.4

SETDACENABLE (mode = 1003), Set DAC on/off

This function call will turn on or off the distance amplitude correction. If it is on, the DAC will be applied on the next data acquisition. See the section mode=1015 on how to set up DAC curve. wParam: index which is 0 or 1. Default is 0. 0 DAC off 1 DAC on lParam: Not used Return: 1 if successful.

3.5

SETLOWPASSFILTER (mode = 1004), Set Low Pass Filter

Set receiver low pass filter. wParam: index which is from 0 to 7. Default is 0 which means no filter. 0 - No filter 1 - 148 MHz 2 - 28 MHz 3 - 18 MHz 4 - 8.8 MHz 5 - 7.5 MHz 6 - 6.7 MHz 7 - 5.9 MHz lParam: Not used Return: 1

PCIUT3100-SDKLV Software Development Kit for LabVIEW

3.6

SETHIGHPASSFILTER (mode = 1005), Set High Pass Filter

Set receiver high pass filter. wParam: index which is from 0 to 3. Default is 3 which means 0.6 MHz. 0 - 4.8 MHz 1 - 1.8 MHz 2 - 0.8 MHz 3 - 0.6 MHz PCIUT3100T may have different high pass filters as below: 0 - 633 kHz 1 - 206 kHz 2 - 15 kHz 3 - 14 kHz lParam: Not used Return: 1

3.7

SETRECTIFIER (mode = 1006), Set Rectifier

Set receiver signal type. wParam: index which is from 0 to 3. Default is 3 which means RF signal (no rectification). 0 - Full wave rectify 1 - positive half rectify 2 - negative half rectify 3 - RF signal (no rectification) lParam: Not used Return: 1

3.8

SETDAMPING (mode = 1007), Set Damping Resistor

Set the pulser damping resistor value on a single channel PCIUT3100 card. Use SETMCHANDAMPING or SETCHANDAMPING to set the damping resistors on a multi-channel board DT16B (or DT8B.) wParam: index which is from 0 to 7. Default is 0 which is 620 ohms. 0 620 ohms 1 339 ohms 2 202 ohms 3 159 ohms 4 60 ohms 5 55 ohms 6 50 ohms 7 47 ohms lParam: Not used Return: 1

3.9

SETTRANSDUCERMODE (mode = 1008), Set Transducer Method

Set the transducer method, pulse/echo or through transmission on single channel PCIUT3100 card. Use SETCHANTRANSDUCERMODE or SETMCHANTRANSDUCERMODE to set the transducer mode on a multi-channel board DT16B (or DT8B.)

PCIUT3100-SDKLV Software Development Kit for LabVIEW wParam: index which is 0 or 1. Default is 0 which is pulse/echo. 0 pulse/echo. In this case the board connects PULSE OUT and RECEIVE IN together. 1 through transmission lParam: Not used Return: 1

10

3.10

SETBUFFERLENGTH (mode = 1009), Set Buffer Length

Set the buffer length that specifies how many data samples that the next acquisition will collect data. wParam: number of samples to take. It ranges from 16 to 16382 in step of 4 samples. Default value of the buffer length is 4000 samples. lParam: Not used Return: 1

3.11

SETTRIGGERDELAY (mode = 1010), Set Trigger Delay

Set the trigger delay that specifies how many samples that the next acquisition will skip before collecting data. wParam: number of samples to skip. It ranges from 2 to 32764 samples in step of 2 samples. Default value of the trigger delay is 2 samples. lParam: Not used Return: 1

3.12

SETPULSEVOLTAGE (mode = 1011), Set Pulse Voltage

Set pulse voltage. wParam: index which is from 0 (-300V or 350V with 350V option) to 255 (-40V). The default is 255 which is -40V. Section 3.35 describes how to get the information about the 350V pulse voltage. Pulse voltage can be set from -40 V to -300 V. The formula is pulse voltage (V) = -(4 + 4000 / (0.392157 x Index + 13.5)) Use the following formula to calculate the pulse voltage for 350V option pulse voltage (V) = -(4 + 4000 / (0.392157 x Index + 11.56)) lParam: Not used Return: 1

3.13

SETPULSEWIDTH (mode = 1012), Set Pulse Width

Set pulse width for the standard pulser or the number of half cycles for the tone burst pulser PCIUT3100T. wParam: For standard pulser the index from 0 to 255. Default is 0 which is the minimum pulse width. The minimum pulse width Wmin can be obtained by using function call mode=1025. Normally it is 50 ns or 15 ns with special order. Pulse width can be set from minimum pulse width to 480 ns. The formula is

PCIUT3100-SDKLV Software Development Kit for LabVIEW

11

Pulse width (nanoseconds) = Wmin + (760.8 x index) / (161.67 + Index) If the result is less than Wmin, Wmin should be used. For tone burst pulser the index is from 1 to 32 which is the number of half cycles. See the section SETTONEBURSTFREQUENCY to set the frequency. lParam: Not used Return: 1

3.14

SETGAIN (mode = 1013), Set Gain

Set the receiver gain. This function sets the gain of both fixed gain amplifier and the DAC amplifier. If DAC is on, this function sets the fixed amplifier only. The DAC gain can be set by using function call mode=1015. When the gain is a negative number, the amplifier acts like an attenuator. At this point the attenuation is not linear to the calculated value. So the attenuation value is not reflecting the true attenuation. The number is just for reference. wParam: index which is from 0 to 1023. It specifies the total gain from -20 dB to 80 dB for both amplifiers, or -10 dB to 40 dB for the fixed gain amplifier along. Default is 511 which is 30 dB of the global gain. Receiver gain can be set from -20 dB to 80 dB with about 0.1 dB resolution. The formula is Receiver gain (dB) = 0.0978 x (Index 204) lParam: Not used Return: 1

3.15

SETDCOFFSET (mode = 1014), Set DC Offset

Set the receiver DC offset. wParam: index which is from 0 to 1023. Default is 511 which is 0V. DC offset can be set from 2.5V to 2.5V with 5mV resolution. The formula is DC offset = 0.005 x Index lParam: Not used Return: 1

3.16

SETDACTABLE (mode = 1015), Set DAC table

Set the gain table of the distance amplitude correction (DAC). When the DAC is on, the gain value on the table will be used to set up the DAC amplifier while taking data. Starting from the first element on the table the board hardware will change the gain every 16 samples until the end of the data acquisition. When the DAC is on, the maximum gain of the fixed gain amplifier is 40 dB and the maximum gain of the DAC amplifier is also 40 dB. Each element of the table is an unsigned one-byte number that is from 0 to 255 for gain range from -10 dB to 40 dB. wParam: pointer of the table: (unsigned char *) The element value can be calculated with the following formula:

PCIUT3100-SDKLV Software Development Kit for LabVIEW

12

Element value = 5.1 x G + 51 where G is the gain from -10 to 40, and the element value should be from 0 to 255. lParam: number of elements in the table. The number of the table element should last long enough to cover the data acquisition time which is buffer length / 16. Return: -2 if wParam is NULL or 1 if successful.

3.17

SETADTRIGGERSOURCE (mode = 1016), Set A/D Trigger Source

Set the trigger source of the analog to digital converter. WParam: index of the settings. Default is 1. 0 +External trigger. The board will take data when a transit of 0 to 5V (rising edge) signal appears at the EXT TRIG connector 1 - Software trigger. Use mode=1001 to generate a trigger. 2 -External trigger. The board will take data when a transit of 5 to 0V (falling edge) signal appears at the EXT TRIG connector lParam: Not used Return: 1

3.18

GETENCODERCOUNTER (mode = 1017), Get Encoder Counter

Get the encoder counter from one of the counters. wParam: index of the counter. 0 first encoder (X axis) 1 second encoder (Y axis) 2 third encoder (Z axis) 3 forth encoder (W axis) lParam: Not used Return: counter value from -8388608 to 8388607.

3.19

SETENCODERCOUNTER (mode = 1018), Set Encoder Counter

Set the value of an encoder counter. wParam: index of the counter. 0 first encoder (X axis) 1 second encoder (Y axis) 2 third encoder (Z axis) 3 forth encoder (W axis) lParam: counter value from -8388608 to 8388607. Return: 1

3.20

GETDATA (mode = 1019), Get Digitized Data from Memory

Get the digitized data from the memory on the board after the data acquisition. For 9-bit digitized data see section 3.43. wParam: pointer of the receiving buffer: (unsigned char *) lParam: number of bytes to move from the board memory to the buffer. It should be multiple of 4.

PCIUT3100-SDKLV Software Development Kit for LabVIEW Return: -2 if wParam is NULL or 1 if successful.

13

3.21

RESETCOUNTER (mode = 1020), Reset A/D Board

Use this function call to reset the analog to digital converter before acquiring data. wParam: not used lParam: not used Return: 1

3.22

RESETMEMORY (mode = 1021), Reset Memory

Use this function call to clean up any data in the memory. It should be called before acquiring data. wParam: not used lParam: not used Return: 1

3.23

SETOFFSETADJUSTMENT (mode = 1022), Reset DC Offset Adjustment

Use this function call to set DC offset adjustment which can make the signal smoother. wParam: 0 - change the adjustment value and download it to the board 1 do the task above and save the adjustment value in the Non-Volatile memory on the board. So it can be retrieved when the program starts running again. lParam: adjustment value fro 127 to 127. Return: 1

3.24

GETMODELNUMBER (mode = 1023), Get Board Model Number

Get the model number of the board. Normally it is PCIUT3100. wParam: pointer of the receiving buffer: (char *). It should have enough room for at least 20 characters. lParam: not used Return: -2 if wParam is NULL or 1 if successful.

3.25

GETSERIALNUMBER (mode = 1024), Get Serial Number

Get the serial number of the board. The serial number can be used to verify which board you are talking to. wParam: pointer of the receiving buffer: (char *). It should have enough room for at least 20 characters. lParam: not used Return: -2 if wParam is NULL or 1 if successful.

3.26

GETMEMORYSIZE (mode = 1025), Get Memory Size

Get the size of the memory. The returned value could be 16384 or 262144. wParam: not used lParam: not used Return: size of the memory.

PCIUT3100-SDKLV Software Development Kit for LabVIEW

14

3.27

GETMINPULSEWIDTH (mode = 1026), Get Minimum Pulse Width

Get the minimum pulse width in nanosecond. It is used to calculate the index of the pulse width by function call mode=1012. The return value could be 28 or 50 ns. wParam: not used lParam: not used Return: minimum pulse width

3.28

SETMCHANDAMPING (mode = 1027), Set a Series of Damping Resistors

Set the damping resistor value on DT16B or DT8B multi-channel boards. This function call is faster than the one with mode=SETCHANDAMPING. wParam: pointer of the damping buffer: (char *). Each byte stores the index of damping resistor values for a certain channel. The first byte is for channel 1 and the second byte is for channel 2, and so on. The value should be 0 or 1. 0 = 500 ohms 1 = 50 ohms lParam: number of channels to download. It should be from 1 to 256. Return: -2 if wParam is NULL, -3 if lParam is out of range, or 1 if successful.

3.29

SETMCHANTRANSDUCERMODE (mode = 1028), Set a Series of Transducer Modes

Set the transducer mode on DT16B or DT8B multi-channel boards. This function call is faster than the one with mode=SETCHANTRANSDUCERMODE. wParam: pointer of the transducer mode buffer: (char *). Each byte stores the index of transducer mode for a certain channel. The first byte is for channel 1 and the second byte is for channel 2, and so on. The value should be 0 or 1. 0 = single transducer for pulse/echo method 1 = dual transducers for through transmission method lParam: number of channels to download. It should be from 1 to 256. Return: -2 if wParam is NULL, -3 if lParam is out of range, or 1 if successful.

3.30

SETALLPARAMETERS (mode = 1029), Set All the Parameter on PCIUT3100 Board

The function call with this mode (1029) sets all the parameters on the PCIUT3100 board. It saves time than setting parameters individually. wParam: pointer of the structure buffer: (struct PCIUT3100 *). lParam: not used Return: -2 if wParam is NULL or 1 if successful.

3.31

SETPULSERCHANNEL (mode = 1030), Set Pulse Out Channel

Set the pulse out channel on DT16B multi-channel switching boards. Each DT16B board can be specified to respond a range of channels with the on-board jumpers. Refer to the users guide to PCIUT3100-M for

PCIUT3100-SDKLV Software Development Kit for LabVIEW details. wParam: index of channel; 0=Channel 1, 1=Channel 2, 2=Channel 3 lParam: not used Return: -3 if wParam is out of range, or 1 if successful

15

3.32

SETRECEIVERCHANNEL (mode = 1031), Set Receiver Channel

Set the receiver channel on DT16B multi-channel switching boards. Each DT16B board can be specified to respond a range of channels with the on-board jumpers. Refer to the users guide to PCIUT3100-M for details. wParam: index of channel; 0=Channel 1, 1=Channel 2, 2=Channel 3 lParam: not used Return: -3 if wParam is out of range, or 1 if successful

3.33

SETCHANDAMPING (mode = 1032), Set Damping Resistor of a Channel

Set the damping resistor value of the specified channel on DT16B or DT8B multi-channel boards. This function call will switch the pulse out channel to lParam. wParam: channel number, 0=channel 1, 1=channel 2... lParam: index of damping resistor. 0 = 500 ohms 1 = 50 ohms Return: -3 if wParam is out of range, or 1 if successful.

3.34

SETCHANTRANSDUCERMODE (mode = 1033), Set Transducer Mode of a Channel

Set the transducer mode of the specified channel on DT16B or DT8B multi-channel boards. This function call will switch the pulse out channel to lParam. wParam: channel number, 0=channel 1, 1=channel 2... lParam: index of transducer mode. 0 = single transducer for pulse/echo method 1 = dual transducers for through transmission method Return: -3 if wParam is out of range, or 1 if successful.

3.35

GETOPTIONBYTE1 (mode = 1034), Get Option Byte 1

Get the option byte 1 which tells the user what kind of options are installed on the board. wParam: not used. lParam: not used. Return: option byte 1 whose bit fields specify the options as described below. 1=Option was installed, or 0=options was not installed. Bit Fields Options

Bit 7 DAC

Bit 6 X encoder

Bit 5 Y encoder

Bit 4 External clock connector

Bit 3 Sync out connector

Bit 2 -350V pulse voltage

Bit 1 Wide pulse

Bit 0 Encoder line receiver

PCIUT3100-SDKLV Software Development Kit for LabVIEW

16

3.36

GETOPTIONBYTE2 (mode = 1035), Get Option Byte 2

Get the option byte 2 which tells the user what kind of options are installed on the board. wParam: not used. lParam: not used. Return: option byte 2 whose bit fields specify the options as described below. 1=Option was installed, or 0=options was not installed. Bit Fields Options Bit 7 1 14-bit A/D converter
st

Bit 6 2 14-bit A/D converter


nd

Bit 5 Log Amplifier

Bit 4 Z encoder counter

Bit 3 W encoder counter

Bit 2 reserved

Bit 1 Reserved

Bit 0 Tone burst pulser

3.37

GETREVNUMBER (mode = 1036), Get Revision Number of the Driver

Get the revision number of the driver software. wParam: not used. lParam: not used. Return: driver software revision number.

3.38

SETLOGAMP (mode = 1037), Set Logarithmic Amplifier

Turn logarithmic amplifier on or off. wParam: 1=on, or 0=off. lParam: not used. Return: 1.

3.39

SETPRF (mode = 1038), Set Pulse Repetitive Frequency

This function call is used for PCIPR300 cards only. It is not recommended for PCIUT3100 cards with the current software.

3.40

SETIOPORT (mode = 1039), Set and Read I/O Port Status

This function call sets the outputs of an I/O port if it is configured as an output port, and read the status of the port. By default port 0 is configured as an output port, and port 1 is configured as an input port. The port type (input or output) can be changed by using function call mode=1040. wParam: Value for output port. It will be ignored if the port is configured as an input port. lParam: Port number 0 or 1. Return: the actual status of the port.

3.41

CONFIGUREIOPORT (mode = 1040), Configure I/O Port Type

This function call is used to configure the type of the I/O ports. wParam: 0 to set port 0 to input port, and 1 to set port 0 to output port. The default is 1.

PCIUT3100-SDKLV Software Development Kit for LabVIEW lParam: 0 to set port 1 to input port, and 1 to set port 1 to output port. The default is 0. Return: 1.

17

3.42

GET14BITADC (mode = 1041), Get Data from 14-Bit A/D Converter

The function call with this mode retrieves the data from the specified 14-bit analog to digital converters. The returned value is from 0 to 16383 which can be used to calculate the input voltage at pins AI1 and AI2 on connector J360 with the following formula. Vin = A x (Vmax Vmin) / 16383 + Vmin Where Vin is the calculated input voltage, A is the A/D data, Vmin is the minimum conversion range, and Vmax is the maximum conversion range (see section 3.44 for details). wParam: 1 for the 1st 14-bit A/D converter, 2 for the 2nd 14-bit A/D converter, and 3 for both lParam: not used Return: -1 if wParam is out of range. -2 if the specified 14-bit ADC is not installed. Return value is 14-bit ADC data from 1st A/D converter when wParam==1, or return value is 14-bit ADC data from 2nd A/D converter when wParam==2. When wParam==3, the two MSB bytes are 14-bit data from 2nd A/D converter, and the two LSB bytes are 14-bit A/DC value from 1st A/D converter.

3.43

GET9BITDATA (mode = 1042), Get Data in 9-Bit Format

The function call with mode 1042 gets the digitized data in 9-bit format. The high speed A/D converter digitizes the data with 9-bit resolution. However, it needs the hardware installed in order to retrieve the data. So this mode is used to replace mode 1019 and get data in 9-bit format. wParam: pointer of the receiving buffer: (short int *) lParam: number of bytes to move from the board memory to the buffer. It should be multiple of 4. Return: 1 if successful, -1 if 9-bit resolution is not installed on the board. -2 if wParam is NULL, or

3.44

GET14BITADCINPUTRANGE (mode = 1043), Get Input Range of 14-Bit ADC

This mode is used to get the analog input ranges of the 14-bit analog to digital converters. Each call gets one of the four values that are the minimum or maximum voltages of the two converters in milli-volts. wParam: 1 for the 1st converter, or 2 for the 2nd converter lParam: 1 for the minimum value, or 2 for the maximum value Return: the minimum value if lParam==1, the maximum value if lParam==2, or -1 if wParam or lParam is out of range -2 if the specified 14-bit ADC is not installed.

3.45

GETVMIN (mode=1044), Get Minimum Voltage

This mode is used to get the minimum voltage of the pulser. wParam: Not used.

PCIUT3100-SDKLV Software Development Kit for LabVIEW lParam: Not used. Return: The minimum voltage.

18

3.46

GETVMAX (mode=1045), Get Maximum Voltage

This mode is used to get the maximum voltage of the pulser. wParam: Not used. lParam: Not used. Return: The maximum voltage.

3.47

SETTONEBURSTFREQUENCY (MODE=1046), Set Tone Burst Frequency

This mode is used to set the frequency of the tone burst pulse. The tone burst pulser generates a periodical square wave instead of a single pulse from a standard pulser. It applies more energy to a transducer especially a low frequency transducer. The frequency of the burst pulses should be the same as the frequency of the transducer in order to get the maximum energy. The pulse voltage defined in section 3.11 will be the peak to peak voltage. So 300V means +/-150V. The starting polarity and pulse cycles (see section 3.12) are also programmable. The following picture shows some examples of the tone burst pulse. Example 1:
Polarity: positive Half cycles: 5 Voltage: 300V Frequency: 40 kHz

300V

Example 2:
Polarity: negative Half cycles: 4 Voltage: 150V Frequency: 80 kHz

150V

Here are the parameters for this mode: wParam: Frequency in kHz from 20 to 10,000. lParam: Polarity: 0 = Positive, 1 = Negative

PCIUT3100-SDKLV Software Development Kit for LabVIEW

19

4. Data Acquisition Procedures


In order to get the expected result it is very important to follow the proper procedures when you write a data acquisition program. The following flow chart shows the basic procedures to acquire data.

START Download parameters Reset A/D converter & memory (mode=1020 & 1021) Software trigger (mode=1001)

Is data ready? (Mode=1000)

No (return=0)

Yes (return=1) Copy data into buffer (mode=1019) Analysis and display data Yes

Take data again? No End of program

PCIUT3100-SDKLV Software Development Kit for LabVIEW

20

5. Working with LabVIEW


5.1 Sample Program
Follow the instructions on the SDK floppy disk to install the software into your hard disk drive. By default all the files will be installed in the following directory: C:\USUTsdk\PCIUTDLL\LabVIEW An example program called PCIUTLV.VI is included with the development kit and will be in the above directory. You can open this example by using LabVIEW 5.0 or higher. If you need the example for LabVIEW 4.0 please send an email to tech@usultratek.com. To run the example program, click Operate from the main menu bar and select the Run menu item. Or hold the Ctrl key and press the R key. You can change the values and run the program to see any change of the signal.

5.2 Use Dynamic Link Library


To control the PCIUT3100 board you need to go through the dynamic link library PCIUTDLL.dll. There is only one function call to control the board and get data from the board. int PCIUTParms(int mode, int board, DWORD wParam, int lParam); Follow the steps below to link the library: a) Click Windows from the main menu bar of the LabView program and select the Show Diagram menu item. b) Click Windows from the main menu bar and select the Show Function Palette menu item. c) Click Advanced on the function palette, and select Call Library Function. d) Move the cursor in the diagram window and click the left mouse button to place a function call. e) Press the right mouse button on the function call icon and select the Configure menu item to open the property window. f) For the functions calls with all number values configure the function as followings: - Click the Browse button find PCIUTDLL,dll in C:\USUTsdk\PCIUTDLL\LabView directory. - Fill out the parameters in the Call Library Function window as following: Function Name: PCIUTParms Calling Conventions: C Parameter: return type Type: Numeric Data Type: Signed 32-bit Integer Parameter: mode

PCIUT3100-SDKLV Software Development Kit for LabVIEW Type: Numeric Data Type: Signed 32-bit Integer Pass: Value Parameter: board Type: Numeric Data Type: Signed 32-bit Integer Pass: Value Parameter: wParam Type: Numeric Data Type: Unsigned 32-bit Integer Pass: Value Parameter: lParam Type: Numeric Data Type: Signed 32-bit Ineger Pass: Value - Then the window under the Function Prototype should show: int32 PCIUTParms(int32 mode, int32 board, uInt32 wParam, int32 lParam); g) For the functions calls with data pointers passed to wParam such as mode equals to 1015 and 1019 configure the function call as followings: - Click the Browse button find PCIUTDLL.DLL in C:\USUTsdk\PCIUTDLL\LabView directory. - Fill out the parameters in the Call Library Function window as following: Function Name: PCIUTParms Calling Conventions: C Parameter: return type Type: Numeric Data Type: Signed 32-bit Integer Parameter: mode Type: Numeric Data Type: Signed 32-bit Integer Pass: Value Parameter: board Type: Numeric Data Type: Signed 32-bit Integer Pass: Value Parameter: wParam Type: Array Data Type: Unsigned 8-bit Ineger Dimensions: 1 Array Format: Array Data Pointer Parameter: lParam Type: Numeric Data Type: Signed 32-bit Ineger Pass: Value - Then the window under the Function Prototype should show: int32 PCIUTParms(int32 mode, int32 board, uInt8 *wParam, int32 lParam); h) For the functions calls with string pointers passed to wParam such as mode equals to 1015 and 1019 configure the function call as followings: - Click the Browse button find PCIUTDLL.DLL in C:\USUTsdk\PCIUTDLL\LabView directory. - Fill out the parameters in the Call Library Function window as following: Function Name: PCIUTParms

21

PCIUT3100-SDKLV Software Development Kit for LabVIEW Calling Conventions: C Parameter: return type Type: Numeric Data Type: Signed 32-bit Integer Parameter: mode Type: Numeric Data Type: Signed 32-bit Integer Pass: Value Parameter: board Type: Numeric Data Type: Signed 32-bit Integer Pass: Value Parameter: wParam Type: String String Format: C String Pointer Parameter: lParam Type: Numeric Data Type: Signed 32-bit Ineger Pass: Value - Then the window under the Function Prototype should show: int32 PCIUTParms(int32 mode, int32 board, CStr wParam, int32 lParam); You can also copy the function call from the example PCIUTLV.vi and paste to your application.

22

PCIUT3100-SDKLV Software Development Kit for LabVIEW

23

Appendix A PCIUT.H Header File


#ifndef PCIUTH #define PCIUTH struct PCIUT3100 { int sampleRate, triggerSrc, lpf, //0=100MHz, 1=50MHz... //0=+Ext, 1=Software trigger, 2=-Ext //0=No Filter, 1=48 MHz, 2=28 MHz, //3=18 Mhz, 4=8.8 MHz, 5=7.5 MHz, //6=6.7 MHz, 7=5.9 MHz hpf, //0=4.8 MHz, 1=1.8 MHz, 2=0.8 MHz, 3=0.6 MHz signal, //0=Full 1=+half; 2=-half; 3=RF damping, //for single channel board only: //0=620 ohms,1=339,2=202,3=159,4=60,5=55,6=50,7=47 pe, //for single channel board only: //0=single transducer, 1=dual transducers plChannel, //0 to 255 rxChannel, //0 to 255 outv, //0 to 255 width, //0 to 255 gain, //0 - 1023 triggerFreq, //0 to 5000 Hz set internal trigger mode if > 0 dcoffset, //0 - 1023 len, // buffer length 16 to 16382 in step of 4 post, // trigger delay 2 to 32764 in step of 2 logamp, // logarithmic amplifier: 1=On, or 0=Off reserved[7];

}; // list of mode #define ISDATAREADY 1000 // wParam= #define SOFTWARETRIGGER 1001 // wParam= #define SETSAMPLINGRATE 1002 // wParam: index of sampling rate // 0=100MHz, 1=50MHz, 2=25MHz, 3=12.5MHz, 4=6.25MHz, 7=External clock #define SETDACENABLE 1003 // wParam: 0=DAC off, 1=DAC on #define SETLOWPASSFILTER 1004 // wParam: //0=No Filter, 1=48 MHz, 2=28 MHz, 3=18 Mhz, 4=8.8 MHz, 5=7.5 MHz, //6=6.7 MHz, 7=5.9 MHz #define SETHIGHPASSFILTER 1005 // wParam: //0=4.8 MHz, 1=1.8 MHz, 2=0.8 MHz, 3=0.6 MHz #define SETRECTIFIER 1006 // wParam: //0=Full, 1=+half, 2=-half, 3=RF #define SETDAMPING 1007 // wParam: //0=620 ohms, 1=339, 2=202, 3=159, 4=60, 5=55, 6=50, 7=47 #define SETTRANSDUCERMODE 1008 // wParam: //0=pulse/echo, 1=through transmission #define SETBUFFERLENGTH 1009 // wParam: buffer length 16 to 16382 in step of 4 #define SETTRIGGERDELAY 1010 // wParam: trigger delay 2 to 32764 in step of 2 #define SETPULSEVOLTAGE 1011 // wParam: 0 - 255 #define SETPULSEWIDTH 1012 // wParam: 0 - 255 #define SETGAIN 1013 // wParam: 0 - 1023 #define SETDCOFFSET 1014 // wParam: 0 - 1023 #define SETDACTABLE 1015 // wParam: (unsigned char *); lParam: number of data #define SETADTRIGGERSOURCE 1016 // wParam: 0=+EXT TRIG (rising edge), 1=software trigger // 2=-EXT TRIG (falling edge)

PCIUT3100-SDKLV Software Development Kit for LabVIEW


#define GETENCODERCOUNTER 1017 // wParam: 0=X axis, 1=Y axis, 2=Z axis, 3=W axis #define SETENCODERCOUNTER 1018 // wParam: 0=X axis, 1=Y axis, 2=Z axis, 3=W axis // lParam: counter value: -8388608 to 8388607 #define GETDATA 1019 // wParam: (unsigned char *); lParam: number of data #define RESETCOUNTER 1020 // wParam: #define RESETMEMORY 1021 // wParam: #define SETOFFSETADJUSTMENT 1022 // wParam: 0=change value and download to the card // 1=save value as default for current signal and sampling rate // lParam: adjust value -127 to 127 #define GETMODELNUMBER 1023 // wParam: (char *); #define GETSERIALNUMBER 1024 // wParam: (char *); #define GETMEMORYSIZE 1025 // wParam: #define GETMINPULSEWIDTH 1026 // wParam: #define SETMCHANDAMPING 1027 // wParam: (char *); Value of each element: 0=500 ohms, 1=50 ohms // lParam: number of channels starting from channel 1 #define SETMCHANTRANSDUCERMODE 1028 // wParam: (char *); Value of each element: 0=single, 1=dual transducers // lParam: number of channels starting from channel 1 #define SETALLPARAMETERS 1029 // wParam: (struct PCIUT3100 *) // lParam: number of channels starting from channel 1 #define SETPULSERCHANNEL 1030 // wParam: index of channel; 0=Channel 1, 1=Channel 2... #define SETRECEIVERCHANNEL 1031 // wParam: index of channel; 0=Channel 1, 1=Channel 2... #define SETCHANDAMPING 1032 // wParam: channel number: 0=channel 1 // lParam: 0=500 ohms, 1=50 ohms #define SETCHANTRANSDUCERMODE 1033 // wParam: channel number: 0=channel 1 // lParam: 0=single, 1=dual transducers #define GETOPTIONBYTE1 1034 // wParam: not used // lParam: not used #define GETOPTIONBYTE2 1035 // wParam: not used // lParam: not used #define GETREVNUMBER 1036 // wParam: not used // lParam: not used #define SETLOGAMP 1037 // wParam: 1=On, or 0=Off // lParam: not used #define SETPRF 1038 // wParam: 0=internal trigger Off, 10, 20, 30,...5000 Hz // lParam: not used // Note: This command is for PCIPR300 card only, not for PCIUT3100. #define SETIOPORT 1039 // wParam: output value // lParam: 0=port 0; 1=port 1 // return: current status #define CONFIGUREIOPORT 1040 // wParam: 0=set port 0 to input port, 1=set port 0 to output port, default: 1 // lParam: 0=set port 1 to input port, 1=set port 1 to output port, default: 0 #define GET14BITADC 1041 // wParam: 1=for the 1st 14-bit ADC, 2=for the 2nd 14-bit ADC, 3=for both

24

PCIUT3100-SDKLV Software Development Kit for LabVIEW


// lParam: not used // return: -1 if wParam is out of range. // -2 if specifed 14-bit ADC is not installed. // when wParam==1, return value is 14-bit ADC value from 1st ADC // when wParam==2, return value is 14-bit ADC value from 2nd ADC // when wParam==3, the two MSB bytes are 14-bit ADC value from 2nd ADC // and the two LSB bytes are 14-bit ADC value from 1st ADC #define GET9BITDATA 1042 // wParam: (short int *); lParam: number of data // return: -2 if wParam is NULL; -3 if 9-bit resolution is not installed on the // board #define GET14BITADCINPUTRANGE 1043 // wParam: 1 for minimum value, 2 for maximum value // lParam: 1 for the 1st converter, and 2 for the 2nd converter // return: minimum value if wParam==1, maximum value if wParam==2, or // -1 if wParam or lParam are out of range // -2 if specifed 14-bit ADC is not installed. #define GETVMIN 1044 #define GETVMAX 1045 #define SETTONEBURSTFREQUENCY 1046 // wParam: Frequency in kHz from 20 to 10,000 // lParam: Polarity - 0 = Positive, 1 = Negative

25

#define MAXPCIUTBOARD #if defined(__cplusplus) extern "C" { #endif // __cplusplus

16

// card: 0 to ? __declspec(dllexport) int PCIUTParms(int mode, int card, unsigned int wParam, int lParam); #if defined(__cplusplus) } #endif // __cplusplus #endif

You might also like