Agilent Technologies U2300A Series Operating instructions

Agilent Technologies
Agilent U2300A Series
Multifunction USB Data
Acquisition
Programming Guide

II U2300A Series USB DAQ Programming Guide
Notices
© Agilent Technologies, Inc., 2006, 2008
No part of this manual may be reproduced in
any form or by any means (including elec-
tronic storage and retrieval or translation
into a foreign language) without prior agree-
ment and written consent from Agilent
Technologies, Inc. as governed by United
States and international copyright laws.
Manual Part Number
U2351-90202
Edition
Third Edition, March 15, 2008
Printed in Malaysia
Agilent Technologies, Inc.
Bayan Lepas Free Industrial Zone,
11900 Penang, Malaysia
Warranty
The material contained in this docu-
ment is provided “as is,” and is sub-
ject to being changed, without notice,
in future editions. Further, to the max-
imum extent permitted by applicable
law, Agilent disclaims all warranties,
either express or implied, with regard
to this manual and any information
contained herein, including but not
limited to the implied warranties of
merchantability and fitness for a par-
ticular purpose. Agilent shall not be
liable for errors or for incidental or
consequential damages in connec-
tion with the furnishing, use, or per-
formance of this document or of any
information contained herein. Should
Agilent and the user have a separate
written agreement with warranty
terms covering the material in this
document that conflict with these
terms, the warranty terms in the sep-
arate agreement shall control.
Technology Licenses
The hardware and/or software described in
this document are furnished under a license
and may be used or copied only in accor-
dance with the terms of such license.
Restricted Rights Legend
U.S. Government Restricted Rights. Soft-
ware and technical data rights granted to
the federal government include only those
rights customarily provided to end user cus-
tomers. Agilent provides this customary
commercial license in Software and techni-
cal data pursuant to FAR 12.211 (Technical
Data) and 12.212 (Computer Software) and,
for the Department of Defense, DFARS
252.227-7015 (Technical Data - Commercial
Items) and DFARS 227.7202-3 (Rights in
Commercial Computer Software or Com-
puter Software Documentation).
Safety Notices
CAUTION
A CAUTION notice denotes a haz-
ard. It calls attention to an operat-
ing procedure, practice, or the like
that, if not correctly performed or
adhered to, could result in damage
to the product or loss of important
data. Do not proceed beyond a
CAUTION notice until the indicated
conditions are fully understood and
met.
WARNING
A WARNING notice denotes a
hazard. It calls attention to an
operating procedure, practice, or
the like that, if not correctly per-
formed or adhered to, could result
in personal injury or death. Do not
proceed beyond a WARNING
notice until the indicated condi-
tions are fully understood and
met.

U2300A Series USB DAQ Programming Guide III
Content
1 Introduction to Programming 1
Syntax Conventions 3
Command Separators 4
Using the MIN and MAX Parameters 4
Querying Parameter Settings 5
SCPI Command Terminators 5
IEEE-488.2 Common Commands 5
SCPI Parameter Types 6
Numeric Parameters 6
Discrete Parameters 6
Boolean Parameters 7
ASCII String Parameters 7
Channel List Parameters 7
Using Device Clear 9
2 ACQuire Subsystem 11
ACQuire:SRATe 12
ACQuire:POINts 13
ACQuire:BURSt 14
3APPLySubsystem15
APPLy? 16
APPLy:SINusoid 17
APPLy:SQUare 18
APPLy:SAWTooth 19
APPLy:TRIangle 20
APPLy:NOISe 21
APPLy:USER 22

IV U2300A Series USB DAQ Programming Guide
Contents
4 CALibration Subsystem 23
CALibration:BEGin 24
5CONFigureSubsystem25
CONFigure Subsystem Introduction 26
CONFigure:DIGital:DIRection 27
CONFigure:TIMEbase:SOURce 28
CONFigure:TIMEbase:ECLocK 29
CONFigure:SSI 30
6 IEEE-488 Common Command 33
*CLS 34
*ESE 35
*ESR? 38
*IDN? 39
*OPC? 40
*RCL 41
*RST 42
*SAV 43
*SRE 46
*STB? 48
*TST? 50
*WAI 51
7 MEASure Subsystem 53
MEASure[:VOLTage][:DC]? 54
MEASure:COUNter:DATA? 55
MEASure:COUNter:FREQuency? 56
MEASure:COUNter:PERiod? 57
MEASure:COUNter:PWIDth? 58
MEASure:COUNter:TOTalize? 59
MEASure:DIGital? 60
MEASure:DIGital:BIT? 61

Contents
U2300A Series USB DAQ Programming Guide V
8 OUTPut Subsystem 63
OUTPut 64
OUTPut:WAVeform:ITERate 65
OUTPut:WAVeform:SRATe 66
OUTPut:WAVeform:FREQuency 67
OUTPut:TRIGger:SOURce 68
OUTPut:TRIGger:TYPe 69
OUTPut:TRIGger:DCouNT 70
OUTPut:TRIGger:ATRiGger:SOURce 71
OUTPut:TRIGger:ATRiGger:HTHReshold 72
OUTPut:TRIGger:ATRiGger:LTHReshold 73
OUTPut:TRIGger:ATRiGger:CONDition 74
OUTPut:DTRiGger:POLarity 75
9 Root Commands 77
DIGitize 78
RUN 79
STOP 80
MODel? 81
SERial? 82
DATA[:USER] 83
10 ROUTe Subsystem 85
ROUTe:SCAN 86
ROUTe:CHANnel:RANGe 88
ROUTe:CHANnel:POLarity 90
ROUTe:CHANnel:STYPe 92
ROUTe:CHANnel:RSouRCe 94
ROUTe:CHANnel:RVOLtage 95
ROUTe:ENABle 97
11 SENSe Subsystem 99
[SENSe:]VOLTage:RANGe 100
[SENSe:]VOLTage:POLarity 102

VI U2300A Series USB DAQ Programming Guide
Contents
[SENSe:]VOLTage:STYPe 104
[SENSe:]COUNter:FUNCtion 106
[SENSe:]COUNter:ABORt 108
[SENSe:]COUNter:GATE:POLarity 109
[SENSe:]COUNter:GATE:SOURce 111
[SENSe:]COUNter:GATE:CONTrol 112
[SENSe:]COUNter:CLocK:INTernal? 113
[SENSe:]COUNter:CLocK:EXTernal? 114
[SENSe:]COUNter:CLocK:POLarity 115
[SENSe:]COUNter:CLocK:SOURce 116
[SENSe:]COUNter:TOTalize:IVALue 117
[SENSe:]COUNter:TOTalize:INITiate 118
[SENSe:]COUNter:TOTalize:CLEar 119
[SENSe:]COUNter:TOTalize:UDOWn:SOURce 120
[SENSe:]COUNter:TOTalize:UDOWn:DIRection 121
12 SOURce Subsystem 123
SOURce:VOLTage[:LEVel] 124
SOURce:VOLTage:POLarity 125
SOURce:VOLTage:RSouRCe 126
SOURce:VOLTage:RVOLtage 127
SOURce:DIGital:DATA 128
SOURce:DIGital:DATA:BIT 130
SOURce:COUNter:OUTPut:POLarity 132
13 SYSTem Subsystem 133
SYSTem:CDEScription? 134
SYSTem:ERRor? 135
14 TRIGger Subsystem 137
TRIGger:SOURce 138
TRIGger:TYPe 139
TRIGger:DCouNT 140
TRIGger:ATRiGger:SOURce 141

VIII U2300A Series USB DAQ Programming Guide
Contents

1
Agilent U2300A Series Multifunction USB DAQ
Programming Guide
Agilent Technologies
1
Introduction to Programming
Introduction to the SCPI Language 2
Syntax Conventions 3
Command Separators 4
Using the MIN and MAX Parameters 4
Querying Parameter Settings 5
SCPI Command Terminators 5
IEEE-488.2 Common Commands 5
SCPI Parameter Types 6
Numeric Parameters 6
Discrete Parameters 6
Boolean Parameters 7
ASCII String Parameters 7
Channel List Parameters 7
Using Device Clear 9
This chapter provides introduction to remote programming of a USB DAQ device with the
SCPI programming language.

1 Introduction to Programming
2 U2300A Series USB DAQ Programming Guide
Introduction to the SCPI Language
SCPI (Standard Commands for Programmable Instruments) is an
ASCII- based instrument command language designed for test and
measurement instruments. SCPI commands are based on a hierarchical
structure, also known as a tree system. In this system, associated
commands are grouped together under a common node or root, thus
forming subsystems. A portion of the SENSe subsystem is shown below to
illustrate the tree system.
SENSe:
VOLTage:
DC:RANGe {<range>|MIN|MAX}[,(@<ch_list>)]
DC:RANGe? [(@<ch_list>)|MIN|MAX}]
RESistance:
OCOMpensated {OFF|0|ON|1}[,(@<ch_list>)]
OCOMpensated? [(@<ch_list>)]
TEMPerature:
RJUNction? [(@<ch_list>)]
SENSe is the root keyword of the command, VOLTage, RESistance, and
TEMPerature are second- level keywords, and DC, OCOMpensated,and
RJUNction are third- level keywords. A colon (:) separates a command
keyword from a lower- level keyword.

Introduction to Programming 1
U2300A Series USB DAQ Programming Guide 3
Syntax Conventions
The format used to show commands is illustrated below:
VOLTage:DC:RANGe {<range>|MIN|MAX}[,(@<ch_list>)]
The command syntax shows most commands (and some parameters) as a
mixture of upper- and lower- case letters. The upper- case letters indicate
the abbreviated spelling for the command. For shorter program lines, you
can send the abbreviated form. For better program readability, you can
send the long form.
For example, in the above syntax statement, VOLTage and VOLT are both
acceptable forms. You can use upper- or lower- case letters. Therefore,
VOLTAGE, volt, and Volt are all acceptable. Other forms, such as VOL
and VOLTAG, are not valid and will generate an error.
Braces ( { } ) enclose the parameter choices for a given command string.
The braces are not sent with the command string.
A vertical bar ( |) separates multiple parameter choices for a given
command string.
Triangle brackets ( < > ) indicate that you must specify a value for the
enclosed parameter. For example, the above syntax statement shows the
<range> parameter enclosed in triangle brackets. The brackets are not sent
with the command string. You must specify a value for the parameter (e.g.,
"VOLTage:DC:RANGe 10").
Some parameters are enclosed in square brackets ( [ ] ). This indicates
that the parameter is optional and can be omitted. The brackets are not
sent with the command string. If you do not specify a value for an
optional parameter, the instrument chooses a default value.

1 Introduction to Programming
4 U2300A Series USB DAQ Programming Guide
Command Separators
A colon ( :) is used to separate a command keyword from a lower- level
keyword. You must insert a blank space to separate a parameter from a
command keyword. If a command requires more than one parameter, you
must separate adjacent parameters using a comma as shown below:
CONFigure:VOLTage:DC 10, 0.003
A semicolon ( ;) is used to separate commands within the same
subsystem, and can also minimize typing. For example, sending the
following command string:
TRIGger:SOURce EXTernal; COUNT 10
is the same as sending the following two commands:
TRIGger:SOURce EXTernal
TRIGger:COUNT 10
Use a colon and a semicolon to link commands from different subsystems.
For example, in the following command string, an error is generated if you
do not use both the colon and semicolon:
ROUTe:CHANnel:DELAY 1; :TRIGger:SOURce EXTernal
Using the MIN and MAX Parameters
For many commands, you can substitute "MIN" or "MAX" in place of a
parameter. For example, consider the following command:
VOLTage:DC:RANGe {<range>|MIN|MAX}[,(@<ch_list>)]
Instead of selecting a specific value for the <range> parameter, you can
substitute MIN to set the range to its minimum value or MAX to set the
range to its maximum value.

Introduction to Programming 1
U2300A Series USB DAQ Programming Guide 5
Querying Parameter Settings
You can query the current value of most parameters by adding a question
mark ( ?) to the command. For example, the following command sets the
scan count to 10 sweeps:
TRIGger:COUNT 10
You can then query the scan count value by sending:
TRIGger:COUNT?
You can also query the minimum or maximum scan count allowed as
follows:
TRIGger:COUNT? MIN
TRIGger:COUNT? MAX
SCPI Command Terminators
A command string sent to the instrument must terminate with a <new
line> (<NL>) character. The IEEE- 488 EOI (End- Or- Identify) message is
interpreted as a <NL> character and can be used to terminate a command
string in place of a <NL> character. A <carriage return> followed by a
<NL> is also accepted. Command string termination will always reset the
current SCPI command path to the root level.
IEEE-488.2 Common Commands
The IEEE- 488.2 standard defines a set of common commands that perform
functions such as reset, self- test, and status operations. Common
commands always begin with an asterisk ( *), are three characters in
length, and may include one or more parameters. The command keyword
is separated from the first parameter by a blank space. Use a semicolon
( ;) to separate multiple commands as shown below:
*RST; *CLS; *ESE 32; *OPC?

1 Introduction to Programming
6 U2300A Series USB DAQ Programming Guide
SCPI Parameter Types
The SCPI language defines several data formats to be used in program
messages and response messages.
Numeric Parameters
Commands that require numeric parameters will accept all commonly used
decimal representations of numbers including optional signs, decimal
points, and scientific notation. Special values for numeric parameters such
as MIN, MAX, and DEF are also accepted. You can also send engineering
unit suffixes with numeric parameters (e.g., M, K, or u). If only specific
numeric values are accepted, the instrument will automatically round the
input numeric parameters. The following command requires a numeric
parameter for the range value:
VOLTage:DC:RANGe {<range>|MIN|MAX}[,(@<ch_list>)]
Discrete Parameters
Discrete parameters are used to program settings that have a limited
number of values (like BUS, IMMediate, EXTernal). They have a short
form and a long form just like command keywords. You can mix upper-
and lower- case letters. Query responses will always return the short form
in all upper- case letters. The following command requires discrete
parameters for the temperature units:
UNIT:TEMPerature {C|F|K}[,(@<ch_list>)]

Introduction to Programming 1
U2300A Series USB DAQ Programming Guide 7
Boolean Parameters
Boolean parameters represent a single binary condition that is either true
or false. For a false condition, the instrument will accept "OFF" or "0".
For a true condition, the instrument will accept "ON" or "1". When you
query a Boolean setting, the instrument will always return "0" or "1".
The following command requires a Boolean parameter:
INPut:IMPedance:AUTO {OFF|0|ON|1}[,(@<ch_list>)]
ASCII String Parameters
String parameters can contain virtually any set of ASCII characters. A
string must begin and end with matching quotes; either with a single
quote or a double quote. You can include the quote delimiter as part of
the string by typing it twice without any characters in between. The
following command uses a string parameter:
DISPlay:TEXT <quoted string>
For example, the following command displays the message
"SCANNING..." on the instrument's front panel (the quotes are not
displayed).
DISPlay:TEXT "SCANNING..."
You can also display the same message using the following command with
single quotes.
DISPlay:TEXT 'SCANNING...'
Channel List Parameters
Channel list parameters have the form (@sccc), where sis the mainframe
slot number (1 through 8) and ccc is the channel number. You can specify
a single channel, multiple channels, or a range of channels. The channel
list must be preceded with the "@" symbol and must be enclosed in
parentheses. The following commands use a channel list (<ch_list>)
parameter:

1 Introduction to Programming
8 U2300A Series USB DAQ Programming Guide
ROUTe:CLOSe (@<ch_list>)
INPut:IMPedance:AUTO <mode> [,(@<ch_list>)]
As shown above, the <ch_list> parameter is optional for some
commands (as indicated by square brackets). If you omit the <ch_list>
parameter, the command will be applied to the internal DMM.
The following command closes channel 10 on the module in slot 3.
ROUTe:CLOSe (@3010)
The following command closes channels 10, 12, and 15 on the module in
slot 2.
ROUTe:CLOSe (@2010,2012,2015)
The following command closes channels 5 through 10 (slot 1) and channel
15 (slot 2). When you specify a range of channels, any channels that are
invalid will be ignored (no error will be generated) but the first and last
channel in the range must be valid.
ROUTe:CLOSe (@1005:1010,2015)
The Analog Bus relays (numbered s911, s912, s913, etc.) on the
multiplexer and matrix modules are ignored if they are included in a
range of channels. An error will be generated if an Analog Bus relay is
specified as the first or last channel in a range of channels. For example,
the following command closes all valid channels between channel 30 (slot
1) and channel 5 (slot 2). In addition, this command closes Analog Bus
relay 911 on the module in slot 1 (Bank 1). Note that although the
specified range of channels includes the other Analog Bus relays, they are
ignored and are not closed by this command.
ROUTe:CLOSe (@1030:2005,1911)
The following command will generate an error since the Analog Bus relays
cannot be specified as the first or last channel in a range of channels
(none of the channels will be closed).
ROUTe:CLOSe (@1005:1911) !Generates an error

Introduction to Programming 1
U2300A Series USB DAQ Programming Guide 9
Using Device Clear
Device Clear is an IEEE- 488 low- level bus message that you can use to
return the instrument to a responsive state (e.g., during a lengthy query).
Different programming languages and IEEE- 488 interface cards provide
access to this capability through their own unique commands. The status
registers, the error queue, and all configuration states are left unchanged
when a Device Clear message is received.
Device Clear performs the following actions:
1If a scan is running, it is aborted.
2The instrument returns to the trigger "idle" state.
3The instrument's input and output buffers are cleared.
4The instrument is prepared to accept a new command string.
An overlapped command, if any, will be terminated with no "Operation
Complete" indication.
NOTE
•The ABORt command is the recommended method to terminate a
measurement.
•It is recommended that you allow for a two-second wait following a Device
Clear to enable the instrument to process the clear operation.

1 Introduction to Programming
10 U2300A Series USB DAQ Programming Guide

2 ACQuire Subsystem
12 U2300A Series USB DAQ Programming Guide
ACQuire:SRATe
Syntax
ACQuire:SRATe <value>
This command is used to set the sampling rate of the analog input.
ACQuire:SRATe?
The query command returns a numeric value representing the sampling
rate set for the instrument.
Supported Model
U2351A, U2352A, U2353A, U2354A, U2355A, U2356A, U2331A
Parameters
Remarks
•<value> * <number of entries> is the maximum ADC sampling
rate.
•For U2331A, the maximum sampling rate is 3 MHz if only one channel
is enabled and 1 MHz or the <number of entries> for multiple
channels.
Query Returned Format
<value> [Hz]
See Also
DIGitize
RUN
Item Type Range of Values Default Value
<value> Numeric U2351A/U2352A/U2355A: 3 Hz - 250 kHz
U2353A/U2354A/U2356A: 3 Hz - 500 kHz
U2331A: 3 Hz - 3 MHz
1000 Hz
Other manuals for U2300A Series
2
This manual suits for next models
7
Table of contents
Other Agilent Technologies Data Logger manuals