Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
USB-2000 Series Multi-functional
Data Acquisition Device
User Manual
Rev: C
Smacq technologies Co., Ltd.
www.smacq.com www.smacq.cn
2
Content
1. PRODUCT OVERVIEW ......................................................................................................... 4
1.1. GENERAL INTRODUCTION ........................................................................................................... 4
1.2. BLOCK DIAGRAM ........................................................................................................................ 5
1.3. PRODUCT FEATURES ................................................................................................................... 5
1.4. PRODUCT SPECIFICATIONS ......................................................................................................... 5
Analog input .................................................................................................................. 6
Analog output ................................................................................................................ 7
Digital IO ........................................................................................................................ 7
Counter ........................................................................................................................... 7
Bus interface .................................................................................................................. 8
Power requirements ..................................................................................................... 8
Other specifications ...................................................................................................... 8
2. APPEARANCE AND CONNECTION .................................................................................. 10
2.1. PRODUCT APPEARANCE ............................................................................................................. 10
2.2. SIGNAL CONNECTION ............................................................................................................... 10
Front panel connection .............................................................................................. 10
Back panel connection ............................................................................................... 12
3. INSTALLATION AND TESTING ........................................................................................ 13
3.1. DRIVER INSTALLATION.............................................................................................................. 13
3.2. HARDWARE INSTALLATION ........................................................................................................ 14
4. ANALOG INPUT ................................................................................................................... 15
4.1. OVERVIEW ............................................................................................................................... 15
4.2. NOTES ON INPUT RANGE .......................................................................................................... 15
4.3. TRIGGERING SOURCE ............................................................................................................... 16
4.4. ANALOG INPUT MODE ............................................................................................................... 16
5. ANALOG OUTPUT ................................................................................................................ 16
5.1. OVERVIEW ............................................................................................................................... 16
5.2. TRIGGERING SOURCE ............................................................................................................... 17
6. DIGITAL IO .......................................................................................................................... 17
6.1. OVERVIEW ............................................................................................................................... 17
7. COUNTERS ........................................................................................................................... 18
7.1. OVERVIEW ............................................................................................................................... 18
7.2. EVENT COUNTER ...................................................................................................................... 18
7.3. CYCLE/POSITIVE PULSE WIDTH/NEGATIVE PULSE WIDTH MEASUREMENT .................................... 19
8. DEVELOPER PROGRAMMING GUIDE ............................................................................ 19
8.1. OVERVIEW ............................................................................................................................... 19
3
8.2. BASIC FUNCTIONS .................................................................................................................... 20
FindUSBDAQ() ............................................................................................................. 20
OpenDevice() ............................................................................................................... 20
CloseDevice() ............................................................................................................... 20
8.3. FUNCTIONS RELATED TO ANALOG INPUT .................................................................................... 20
SetUSB2AiRange() ...................................................................................................... 20
SetSampleRate() ......................................................................................................... 21
SetChanSel() ................................................................................................................ 22
SetTrigSource() ........................................................................................................... 22
SetTrigEdge() ............................................................................................................... 23
SetSoftTrig() ................................................................................................................ 23
ClearTrigger() .............................................................................................................. 24
8.4. FUNCTIONS RELATED TO ANALOG OUTPUT ................................................................................. 24
InitDA() ........................................................................................................................ 24
SetDA() ......................................................................................................................... 24
SetWavePt() ................................................................................................................. 25
ClrWavePt() .................................................................................................................. 25
SetWaveSampleRate()................................................................................................ 26
WaveOutput() .............................................................................................................. 26
8.5. FUNCTIONS RELATED TO DIGITAL IO ........................................................................................ 27
SetDioOut() .................................................................................................................. 27
8.6. FUNCTIONS RELATED TO COUNTERS .......................................................................................... 27
SetCounter() ................................................................................................................ 27
ClearCounter() ............................................................................................................. 28
8.7. FUNCTIONS RELATED TO DATA READ CONTROL ........................................................................... 29
StartRead() .................................................................................................................. 29
StopRead() ................................................................................................................... 29
GetAiChans() ............................................................................................................... 29
GetDioIn() .................................................................................................................... 30
GetCounter() ................................................................................................................ 30
GetCtrTime() ................................................................................................................ 31
ClearBufs() ................................................................................................................... 31
TransDioIn() ................................................................................................................. 31
8.8. ERROR CODES .......................................................................................................................... 32
8.9. LABVIEW DEVELOPER NOTES ................................................................................................... 32
8.10. MATLAB DEVELOPER NOTES .................................................................................................... 33
9. ORDERING INFORMATION.............................................................................................. 33
10. SERVICE AND WARRANTY ............................................................................................... 35
11. REVISION NOTES ............................................................................................................... 36
4
1. Product Overview
1.1. General introduction
A typical data acquisition system usually consists of sensors, signal conditioning devices, data
acquisition devices, computers and data processing software. Figure 2.1 shows a basic data
acquisition system formed by the Smacq USB Series device.
Data acquisition devices utilizing USB interface have a great advantage in its portability,
compared with those using interfaces like PCI and PXI, making them flexible enough to be used
anywhere when coupled with a laptop.
Smacq USB-2000 series is an a data acquisition device, in which all analog input channels share
one AD convert unit. When acquiring signals, the device uses a multiplexer to shift signals in
between channels. The very low background noise and high precision makes it optimal for most
data acquisition application.
Figure 2.1 Basic data acquisition system utilizing
Smacq USB series DAQ device
Sensor, signal
regulating test cords
USB data
acquisition device
Data processing
computer
5
1.2. Block diagram
1.3. Product features
Up to 16 channels analog input
Analog input range ±10V/±5V/±2.5V/±1.25V/±0.5V, software configurable
4 channels synchronous input output, up to 100KS/s sampling rate, output 0~10V
16 channels isolated digital input and 16 channels isolated digital output
4 channel 32-bit counter
LabVIEW, Visual Studio and MATLAB development support
1.4. Product specifications
The following specification parameters, if not specified otherwise, were tested after running
the device for 30 minutes under the temperature of 25 degree and humidity of 40%.
Figure 2.2 Smacq USB-2000 series DAQ device block diagram
Signal C
on
necto
r
Analog Input
Analog Output
Isolated
Digital Input
Isolated
Digital Output
Counter
Logical
Control
&
Memory
USB
Interface
6
Analog input
Model
USB-2
600
USB-2
601
USB-2
602
USB-2
650
USB-2
651
USB-2
652
USB-2
620
USB-2
621
USB-2
622
USB-2
610
USB-2
611
USB-2
612
Channels1 8SE/
4DIFF
16SE/
8DIFF
8SE/
4DIFF
16SE/
8DIFF
8SE/
4DIFF
16SE/
8DIFF
8SE/
4DIFF
16SE/
8DIFF
Synchronous sampling No
ADC resolution 16-bit
Converter type Successive approximation
Sampling rate 1MSa/s 500kSa/s 250kSa/s 125kSa/s
Timing resolution 20ns
FIFO cache 16k sampling points
Range ±10V/±5V/±2.5V/±1.25V/±0.5V
Safe voltage ± 15V,an input above safe voltage can damage the DAQ device
Input resistance 500MΩ
Input coupling mode DC
Triggering mode Software triggering、Digital input edge triggering
System noise
±10V:190uVrms
±5V:100uVrms
±2.5V:58uVrms
±1.25V:37uVrms
±0.5V:24uVrms
DC offset
±10V:900uV
±5V:900uV
±2.5V:600uV
±1.25V:300uV
±0.5V:100uV
1、SE means single-ended input;DIFF means differential input.
7
Analog output
Model USB-2601 USB-2651 USB-2621 USB-2611
Channels 4
Synchronous sampling Yes
DAC resolution 16-bit
Max updating rate 100kSa/s
Timing resolution 20ns
Triggering mode Software triggering
Output range 0~10V
Slew rate >1.8V/us
Output coupling mode DC
Output resistance 50Ω
Power on initial value 0V
Max arbitrary wave number 2000pts/ch
DC offset <26mV
Digital IO
Channels 8-DI(Digital input),8-DO(Digital output)
Optoelectronic isolation Yes
Input voltage range High level:1.2V to 24V / Low level:0V
Output voltage High level:2.9V to 3.5V
Output rise time 10us
Output fall time 18us
Digital output initial value 0V
Counter
Channels 4
8
Counter number of bits 32-bit
Counter measurement Edge count
Counting direction Upwards count
Max input frequency 50MHz
Min high pulse width 20ns
Min low pulse width 20ns
Input high level voltage 3.3V~5V
Input low level voltage 0V
Bus interface
USB interface standard USB 2.0 High Speed(480Mb/s)
USB interface connector USB series Type B connector
Power requirements
USB bus power
supply
4.75~5.25VDC(Can also use 5V power adapter as secondary power
supply)
Current
consumption
About 350mA
Other specifications
Size(mm) 210*150*38
Weight(g) About 680g
Analog input signal connector 3-PIN bolt terminal connector
Analog output signal connector 3-PIN bolt terminal connector
Counter input signal connector 3-PIN bolt terminal connector
Digital IO connector 10-PIN bolt terminal connector
Operating environment 0°C ~55°C
9
5%RH~90%RH,No condensation
Storage environment -40°C ~85°C
5%RH~90%RH,No condensation
10
2. Appearance and Connection
2.1. Product appearance
USB-2000 series DAQ devices utilized metal shield case. Figure 2.1 shows its front and
back panels. The front panel includes analog input channels, analog output channels, and
counter channels. The back panel includes digital IO connector, USB interface and power
socket.
2.2. Signal connection
Front panel connection
USB-2xx0 and USB-2xx2 model
Figure 2.1 USB-2000 Series DAQ device front and back panel
Analog input channel
Analog output channel
Power connector
5VDC
USB interface
Optoelectronic isolation digital
IO connector
11
Analog input channels are referred to as AI n, where n represents the channel number, e.g.
AI 0 is channel 0 while AI 1 is channel 1 and so on.
Figure 2.2 shows the analog input wiring, where AI n is analog signal input while GND is
ground signal input.
Diagram 2.1、Screw terminal pin signal detail.
Name Notes
GND Analog ground
AI 0 ~ AI 15
Analog input channel, AI 0 ~ AI 15 (for 8 channel models, only AI 0~AI 7 are
available)
For differential input, AI 0 is the signal + of channel 0 while AI 1 is the signal
– of channel 0. AI 2 is the signal + of channel 1 while AI 3 is the signal – of
channel 1.
USB-2xx1 model
AI n represents analog input channel where n represents the channel number. AI 0 is channel 0
while AI 1 is channel 1 and so on.
CT n represents counter input channel where n represents the channel number. CT 0 is channel 0
while CT 1 is channel 1 and so on.
AO n represents analog output channel where n represents the channel number. AO 0 is channel
0 while AO 1 is channel 1 and so on.
Figure 2.3 shows front panel wiring
Figure 2.2 Analog input wiring
12
Diagram 2.2、Screw terminal pin signal detail
Name Notes
GND Analog ground
AI 0 ~ AI 7
Analog input channel,AI 0 ~ AI 7
When using differential input,
AI 0 is signal + for channel 0,AI 1 is signal – for channel 0
AI 2is signal + for channel 1, AI 3 is signal – for channel 1
and so on
AO 0 ~ AO 3 Analog output channel,AO 0 ~ AO 3
CT 0 ~ CT 3 Counter input channel,CT 0 ~ CT 3
Back panel connection
DI n represents digital input channel where n represents the channel number. DI 0 is channel 0
while DI 1 is channel 1 and so on.
DO n represents digital output channel where n represents the channel number. DO 0 is channel
0 while DO 1 is channel 1 and so on.
Figure 2.4 shows the digital IO channel wiring. Due to optoelectronic isolation, the GND
here, the GND in analog channel and the GND for the DAQ device itself are all isolated.
Figure 2.3 Analog output wiring
13
Diagram 2.3、Screw terminal pin signal detail
Name Notes
DI 0~DI 7 Digital input channel,DI 0~DI 7
DO 0~DO 7 Digital output channel,DO 0~DO 7
GND Isolated digital ground
3. Installation and Testing
3.1. Driver installation
When connecting USB-2000 series DAQ device to computers running Windows OS via
USB interface, it requires installing the driver to recognize the device.
Below are the driver installation steps on a PC running Microsoft Windows 7 (There is
a need to turn off the driver signature certification before the driver installation on
Microsoft Windows 8, 8.1 and 10. There is no such need for the installation on Microsoft
Windows XP).
1) Launch Device Manager in Microsoft Windows.
2) You should see a device with an exclamation if everything is correctly connected.
Right click on it, and choose "Update Driver Software...".
3) Select "Browse my computer for driver software".
4) Select "Let me pick from a list of device drivers on my computer".
5) Select "Have Disk..."
Figure 2.4 Digital IO wiring
14
6) Click on "Browse" and click into the fold named "USB4000_USB2000 Series
DAQ\Driver" on the bundled driver disc. Click into the folder "Win7". If you are using 32-bit
OS, go into the folder "x86"; if you are using 64-bit OS, go into the folder "x64". Select
"gusb.inf", then click "Open" (the same file can also be used on Microsoft Windows 8, 8.1
and 10).
7) Click on "OK" within the window of "Install From Disk".
8) Click on "Next". If a security alert pops up, select "Install this driver software
anyway".
9) The OS will now begin the driver installation, which usually take about 30 seconds.
After the installation, the exclamation within the Device Manager will disappear, as shown
in Figure 3.1
3.2. Hardware Installation
For details on testing signals connection, refer to chapters on Analog Input, Digital IO
and Counter.
Figure 3.1, the Device Manager with Smacq device driver correctly installed.
15
After correctly installing the driver and connecting to correct signals, you can launch
any of the sample programs for USB-2000 Series DAQ devices on the resource disc.
These sample programs will display the acquired signals.
4. Analog Input
4.1. Overview
USB-2000 Series DAQ devices has two kinds of analog input channels, 8-channel and
16-channel. Its max sampling rate ranges from 1MS/s to 125kS/s. The resolution is 16-bit
and the input voltage range is ± 10V/± 5V/± 2.5V/± 1.25V/± 0.5V.
Figure 4.1 shows the block diagram for USB-2000 Series DAQ devices’ analog channel.
The main components in above diagram are:
ADC:Analog-to-digital converter, converting analog signals into digital signals
FIFO:Data cache FIFO
4.2. Notes on input range
Analog input range is programmable by software as±10V、±5V、±2.5V、±1.25V or
Figure 4.1 USB-2000 analog channel block diagram
16
±0.5V.
4.3. Triggering source
When USB-2000 devices acquire signals via analog input, the trigger source can be set
as a software trigger or a rising edge or falling edge of the digital IO input channel DIN
port.
4.4. Analog input mode
The USB-2000 series support ground reference single-ended input mode or
differential mode.
5. Analog Output
5.1. Overview
In USB-2000 series, USB-2xx1 includes 4 analog output channels. It can output the
voltage of 0~10V. Its resolution is 16-bit and its max sampling rate is 100kS/s.
The 4 analog output channels in USB-2xx1 are made up by 4 DA converters, and its
output resistance is 50Ω. Figure 5.1 shows its block diagram.
17
5.2. Triggering Source
When used as a waveform generator, USB-2xx1 supports starting output by software
triggers.
6. Digital IO
6.1. Overview
USB-2000 series DAQ devices are all equipped with 16 digital IO channels with
optoelectronic isolation, 8 DI channels and 8 DO channels.
Figure 6.1 shows the block diagram of USB series digital IO channel. DI and DO represents
the wiring ports for digital input and digital output.
AO 0 DAC DATA 0
AO 2 DAC DATA 2
AO 1 DAC DATA 1
AO 3 DAC DATA 3
Figure 5.1 USB Series analog output block diagram
18
7. Counters
7.1. Overview
In USB-2000 series, USB-2xx1 includes 4 counter channels. Its max input signal
voltage is 5V. GND is the ground reference signal for counter channels. The counter can be
software programmable to serve four functions
Event counter
Cycle measurement
Positive pulse width measurement
Negative pulse width measurement
7.2. Event counter
When the counter channel of the DAQ device is used as the event counters, it can be
DI
Din
Vcc
Figure 6.1 Digital IO channel block diagram
Dout DO
Vcc Viso
19
All functions here are C/C++ function model. If you use other languages
to develop applications, pay attention to the differences between data types.
used to record the number of rising edges of the CT port, or it can be set by software to
record the number of falling edges.
The event counter can only count up. That means, based on the number of received
pulses, the event counter value will be an incremental count like 1,2,3,4,5.
7.3. Cycle/Positive pulse width/Negative pulse
width measurement
The counter channel on DAQ device can be configured by software as cycle/positive
pulse width/negative pulse width measurement mode.
When set as cycle measurement mode, the DAQ device measures the time between
the two rising edges of the comparator output and stores the result in the corresponding
counter channel result, with a time accuracy of 20ns.
When set as positive pulse measurement mode, the DAQ device measures the time
between the one rising edge and the next falling edge of the comparator output and stores
the data in the corresponding counter channel result, with a time accuracy of 20ns.
When set as negative pulse measurement mode, the DAQ device measures the time
between the one falling edge and the next rising edge of the comparator output and stores
the data in the corresponding counter channel result, with a time accuracy of 20ns.
8. Developer Programming Guide
8.1. Overview
Developers can use the standard dynamic link library "gusb.dll" to interact with the
USB-2000 series DAQ devices to control all its features.
This chapter will detail all the functions provided by the gusb.dll library. The calling
format for all functions can also be found in the gusb.h file. For detailed control and call
procedures, refer to the example code.
20
8.2. Basic functions
FindUSBDAQ()
int _stdcall FindUSBDAQ()
Find the number of USB-2000 DAQ devices connected to the computer.
Return value:The number of USB-2000 DAQ devices connected to the computer.
OpenDevice()
int _stdcall OpenDevice(int DevIndex)
Open the specified device.
Parameter:
DevIndex,the index number of DAQ device,counting from 0
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
CloseDevice()
void _stdcall CloseDevice(int DevIndex)
Shut down specified device
Parameter:
DevIndex,the index number of DAQ device,counting from 0
8.3. Functions related to analog input
SetUSB2AiRange()
int _stdcall SetUSB4AiRange(int DevIndex, float Range)
21
Set the range for the DAQ device’s analog input channel
Parameter:
DevIndex,the index number of DAQ device, counting from 0
Range, the DAQ device's analog input channel range. The following are the
corresponding ranges for the set parameters:
Range parameter Actual max range
24
(Only for differential signal pair) Differential:±24.576V
20
(Only for differential signal pair) Differential:±20.48V
10 Differential:±10.24V
Single-ended:±10.24V
5 Differential:±5.12V
Single-ended:±5.12V
2 Differential:±2.56V
Single-ended:2.56V
1 Differential:±1.28V
Single-ended:±1.28V
0.5 Differential:±0.64V
Single-ended:±0.64V
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
SetSampleRate()
int _stdcall SetSampleRate(int DevIndex, unsigned int SampleRate)
Set the sampling rate of analog input channel. For USB-2000 series, the analog input
acquisition channel is scan-type acquisition. The sampling rate is set to represent the sum
of all the selected channel sampling rates. For example, if two channels are selected, a
setting of 1000 means a sampling rate of 500S/s per channel.
22
The minimum time resolution of the sampling period is 20ns, so the best sampling
period accuracy can be achieved when the sampling period is set to an integer multiple of
20ns.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
SampleRate,sampling rate,measured by S/s. For example, to set the sampling
rate as 1kS/s, set the SampleRate as 1000.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
SetChanSel()
int _stdcall SetChanSel(int DevIndex, unsigned short ChSel)
Set the channel to select.
Parameter:
DevIndex, the index number of DAQ device, counting from 0.
ChSel,the channel to select. This binary bit for this parameter corresponds to the
analog input channel ai0~ai15 from low to high. 1 means selecting the channel, while
0 means not selecting the channel. For example, to select ai0 and ai1, set ChSel as
0x0003; to select ai0 and ai2, set ChSel as 0x0005.
If the analog input is configured as a differential input, only the even bits can be
selected when selecting a channel. For example, to select differential channel ch0 and
ch1, set ChSel as 0x0005; to select differential channel ch0, ch1 and ch3, set ChSel as
0x0015, and so on.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
SetTrigSource()
int _stdcall SetTrigSource(int DevIndex, unsigned char TrigSource)
Set trigger source for analog sampling
23
Parameter:
DevIndex, the index number of DAQ device, counting from 0.
TrigSource, the triggering source to select. 0 represents software triggering. 1~8
represents digital input channel 0~7 as triggering source. When digital input channels are
triggering sources, SetTrigEdge() function can be used to set rising edge trigger or falling
edge trigger。
Return valu:
0 represents no error. Refer to Chapter 8.8 for other error codes.
SetTrigEdge()
int _stdcall SetTrigEdge(int DevIndex, unsigned char TrigEdge)
Select rising edge trigger or falling edge trigger when set as digital triggering,
Parameter:
DevIndex, the index number of DAQ device, counting from 0.
TrigEdge,1 represents rising edge trigger, while 0 represents falling edge trigger.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
SetSoftTrig()
int _stdcall SetSoftTrig(int DevIndex, unsigned char Trig)
Set software trigger.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
Trig,software trigger switch, 0 represents turn off trigger, while 1 represents turn
on trigger.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
24
ClearTrigger()
int _stdcall ClearTrigger(int DevIndex)
Clear trigger flag.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
8.4. Functions related to analog output
InitDA()
int _stdcall InitDA(int DevIndex)
Initialize analog output. This function is required when using analog output. The
function needs only to be called once when powering on the computer every time.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
SetDA()
int _stdcall SetDA(int DevIndex, unsigned char DANum, float DAVolt)
When in need of outputting DC voltage from analog output channel, use this function
to configure.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
DANum, the channel number to configure. It can be set as 0, 1, 2, 3,
corresponding to 4 analog output channels respectively. If there is the need to configure 4
channels at the same time, set this parameter as 255.
25
DAVolt,the voltage to set. It can be any value in the range of 0~10.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
SetWavePt()
int _stdcall SetWavePt(int DevIndex, unsigned char DANum, float DAVolt)
When outputting analog arbitrary wave, this function can be used to set the waveform
sampling point. Each time this function is run, the waveform point index number will be
incremented by one, until the ClrWavePt () function is executed, when the waveform point
index number will be cleared.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
DANum,the channel number to configure. It can be set as 0, 1, 2, 3, corresponding to
4 analog output channels respectively. If there is the need to configure 4 channels at
the same time, set this parameter as 255.
DAVolt,Set the voltage for arbitrary wave sampling point. It can be any value in
the range of 0~10.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
ClrWavePt()
int _stdcall ClrWavePt(int DevIndex, unsigned char DANum)
Clear arbitrary wave data table.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
DANum,the channel number to configure. It can be set as 0, 1, 2, 3, corresponding to
4 analog output channels respectively. If there is the need to configure 4 channels at
the same time, set this parameter as 255.
26
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
SetWaveSampleRate()
int _stdcall SetWaveSampleRate(int DevIndex, unsigned int WaveSampleRate)
Set the sampling rate when outputting analog arbitrary wave. The 4 channels can only
be set to uniform sampling rate.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
WaveSampleRate,the sampling rate for outputting analog arbitrary wave, up to
10000。
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
WaveOutput()
int _stdcall WaveOutput(int DevIndex, unsigned char DANum)
The switch for outputting analog arbitrary wave.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
DANum,the lower 4 bits (binary) of this parameter correspond to the four
channels of the analog output. Set 1 to enable the arbitrary wave output of the
channel. Set 0 to stop the arbitrary wave output of the channel.
For example,
to output channel 0 only, set the parameter as 1;
to output channel 1 only, set the parameter as 2;
to output channel 2 only, set the parameter as 4;
to output channel 3 only, set the parameter as 8;
to output channel 0 and 1 simultaneously, set the parameter as 3;
To output channel 0 and 2 simultaneously, set the parameter as 5;
27
and so on.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
8.5. Functions related to Digital IO
SetDioOut()
int _stdcall SetDioOut(int DevIndex, unsigned int DioOut)
Set the value of digital IO output channel DO
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
DioOut,DOUT value for digital IO output channel. The lower 8 digits of DioOut
corresponds to 8 channels of digital IO output channel DO.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
8.6. Functions related to counters
SetCounter()
int _stdcall SetCounter(int DevIndex, unsigned char CtrNum, unsigned char
CtrMode, unsigned char CtrEdge)
Set counter functions.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
CtrNum,the index number of counter channel. 0~3 corresponds to Ct0~Ct3.
Setting it to 0x0f will allow 4 channel counters to work simultaneously.
CtrMode,the counter work mode. 0 represents event counter mode. 1 represents
28
measurement period. 2 represents measuring positive pulse width. 3 represents
measuring negative pulse width.
CtrEdge,when working in event counter mode, setting it as 1 represents counting
rising edges, while 2 represents counting falling edges.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
StartCounter()
int _stdcall StartCounter(int DevIndex, unsigned char CtrNum, unsigned char
OnOff)
Counter switch. Turn on or turn off the counter.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
CtrNum,counter channel index number. 0~3 corresponds to Ct0~Ct3. Setting it
to 0x0f will allow 4 channel counters to work simultaneously.
OnOff,1 represents turning on the counter, while 0 represents turning off the
counter.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
ClearCounter()
int _stdcall ClearCounter(int DevIndex, unsigned char CtrNum)
Clear the counter.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
CtrNum,counter channel index number. 0~3 corresponds to Ct0~Ct3. Setting it
to 0x0f will allow 4 channel counters to work simultaneously.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
29
8.7. Functions related to data read control
StartRead()
int _stdcall StartRead(int DevIndex)
Start reading data. This function will start a thread to automatically read data from the
DAQ device’s FIFO and save it into the software FIFO on the computer.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
StopRead()
int _stdcall StopRead(int DevIndex)
Stop reading data. This function will terminate the read thread started by StartRead()
function.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
GetAiChans()
int _stdcall GetAiChans(int DevIndex, unsigned long Num, unsigned short
ChSel, float *Ai, long TimeOut)
Get the analog input channel sampling data stored in software FIFO. For continuous
sampling, repeat calling this function to get the continuous sampling wave.
Parameter:
30
DevIndex,the index number of DAQ device, counting from 0.
Num,The obtained number of analog sampling points, which represents the
points to get for each channel.
ChSel,The channel to select. This parameter's binary digits, from low to high,
correspond to analog input channels ai0~ai15. 1 represents selecting this channel,
while 0 representing not using this channel. For example, if you need to select ai0and
ai1, ChSel should be set as 0x0003; if you need to select ai0and ai2, ChSel should be
set as 0x0005;
*Ai,
TimOut,set the timeout。If software FIFO hasn't acquired enough Num during the
set time, the function will terminate and return a timeout error code.
Return value:
When the return value is not negative, it represents the left space of software FIFO,
which should be an integer within 0~2000000. When the return value is negative, that
represents something wrong. Please refer to chapter 8.8 for more error codes.
GetDioIn()
unsigned int _stdcall GetDioIn(int DevIndex)
Get the value of digital IO channel DIN
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
Return value:
The value of digital IO channel DIN, with low 6 digits correspond to the value of DI
0~DI 7.
GetCounter()
unsigned int _stdcall GetCounter(int DevIndex, unsigned char CtrNum)
Get the value of event counter.
Parameter:
31
DevIndex,the index number of DAQ device, counting from 0.
CtrNum,the index number of counter. 0~3 corresponds to CT 0~CT 3。
Return value:
The value of event counter.
GetCtrTime()
double _stdcall GetCtrTime(int DevIndex, unsigned char CtrNum)
Get the value of cycle/positive pulse width/negative pulse width, measured in us.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
CtrNum,the index number of counter. 0~3 corresponds to CT 0~CT 3。
Return value:
The value of cycle/positive pulse width/negative pulse width, measured in us.
ClearBufs()
int _stdcall ClearBufs(int DevIndex)
Clear analog input cache, including software FIFO and hardware FIFO.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
TransDioIn()
int _stdcall TransDioIn(int DevIndex, unsigned char TransDioSwitch)
Start separate transfer of digital port data, including DIN data and counter data.
When you only need to transfer digital input DIN channel data or counter data, you
need to call this function first. If you have started analog acquisition, there will be no
32
need to call this function to get the correct DIN data and counter data. Please refer to
example codes for digital IO and counter for detailed usage.
Parameter:
DevIndex,the index number of DAQ device, counting from 0.
TransDioSwitch,switch of data transfer. 1 represents start, while 0 represents
stop.
Return value:
0 represents no error. Refer to Chapter 8.8 for other error codes.
8.8. Error codes
If there is negative return value when calling functions, that indicates errors in the
operation. The detailed error codes are listed in Diagram 4.
Diagram 4, error codes
Error code Notes
-1 No USB series DAQ device is found connected to the computer.
-2 Index overflow on the DAQ device.
-3 Firmware error on the DAQ device.
-4 The DAQ device is shut down.
-5 Data transfer error.
-6 The computer does not have enough memory.
-7 Timeout
-8 Read thread is not started.
8.9. LabVIEW developer notes
LabVIEW developers can also control the DAQ device by calling the dynamic link
library. At the same time, we provide a series of vi files and example codes that correspond
to all of the functions aforementioned. These files can be found on the resource CD.
33
8.10. MATLAB developer notes
MATLAB developers can also control the DAQ device by calling the dynamic link library. At
the same time, we provide an m file to detail all of the functions aforementioned. The file
can be found on the resource CD.
9. Ordering Information
Device
Model Notes
USB-2602 16 channels analog input, 16-bit resolution, with max sampling rate of
1MSa/s
USB-2601
8 channels analog input, 16-bit resolution, with max sampling rate of
1MSa/s
4 channels synchronous analog output, 16-bit resolution, with max
sampling rate of 100kSa/s/ch
USB-2600 8 channels analog input, 16-bit resolution, with max sampling rate of
1MSa/s
USB-2652 16 channels analog input, 16-bit resolution, with max sampling rate of
500kSa/s
USB-2651
8 channels analog input, 16-bit resolution, with max sampling rate of
500kSa/s
4 channels synchronous analog output, 16-bit resolution, with max
sampling rate of 100kSa/s/ch
USB-2650 8 channels analog input, 16-bit resolution, with max sampling rate of
500kSa/s
USB-2622 16 channels analog input, 16-bit resolution, with max sampling rate of
250kSa/s
USB-2621 8 channels analog input, 16-bit resolution, with max sampling rate of
34
250kSa/s
4 channels synchronous analog output, 16-bit resolution, with max
sampling rate of 100kSa/s/ch
USB-2620 8 channels analog input, 16-bit resolution, with max sampling rate of
250kSa/s
USB-2612 16 channels analog input, 16-bit resolution, with max sampling rate of
125kSa/s
USB-2611
8 channels analog input, 16-bit resolution, with max sampling rate of
125kSa/s
4 channels synchronous analog output, 16-bit resolution, with max
sampling rate of 100kSa/s/ch
USB-2610 8 channels analog input, 16-bit resolution, with max sampling rate of
125kSa/s
Bundled accessory
Mode Notes
USB-A-B USB connector,1.5 meter,USB-A type to USB-B type
TB3-3.81 Bolt terminal connector,3 digit,with spacing of 3.81mm
TB10-3.81 Bolt terminal connector,10 digit,with spacing of 3.81mm
Optional accessory
Model Notes
CHF-100B Current sensor,100A,DC~20kHz,output ±4V
CHV-600VD Voltage sensor,600V,DC~20kHz,isolated differential input,output
±5V
35
10. Service and Warranty
All Smacq products can be serviced free of charge under normal use within their
warranty. Refer to the warranty notes inside their package for details.
Unless otherwise provided in this manual or warranty statement, Smacq does not
provide any other warranties, either express or implied.
If you need technical support or more service details, or if you have any questions
using this product or reading this document, feel free to contact us.
Tel:010-52482802
Email:[email protected]
Website:www.smacq.com / www.smacq.cn
36
11. Revision notes
Date Version Notes
2014.12.12 Rev: A Initial release
2015.03.20 Rev: B Correct typo and revise wording.
2016.11.15 Rev: C Re-layout and complement the function description for
outputting analog arbitrary waveform.