Oscilloscope UNI-T UDT2202CE Programming Software
Oscilloscope UNI-T UDT2202CE Programming Software
Oscilloscope
Programming Manual
Statement
1、All the command of file must issue by interface UCI of uci.dll, the detailed description refer to 《UCI Help
Document.pdf》
2、All the character instruction is not case-sensitive;
3、UCI interface:
[C:DSO][D:DSO-X][T:USB][PID:0x5537][VID:0x4348][EI:0x82][EO:0x2][CFG:1][I:0]
Or use UCI interface to query device address
4、Connect with several similar devices, use UCI interface to query the unique device address.
1 / 19
Uni-Trend Technology (China) Co., Ltd.
Instruction Set
IDN?
For example:
UTG2102CEX%**#SN005
Query the version number of system information, to check whether the protocol interface is support.
Command Name Command Parameter Command Parameter Type
CVer?; none none
Example:
“CVer?;”
Interface:
Use interface uci_Read to read data。
Data size is 50bytes.
Data:
1,BG, 100M,1GS,2CH
Keypad
2 / 19
Uni-Trend Technology (China) Co., Ltd.
C2 CH2
F1 F1
F2 F2
F3 F3
F4 F4
F5 F5
PS PrScrn(screenshot)
MEA Measure
CSR Cursor
ACQ Acquire
DISP Display
STG Storage
UTIL Utility
FKN Function Knob
FKNL Function Knob Left Rotation
FKNR Function Knob Right Rotation
VKNL Vertical Position Knob Left Rotation
VKNR Vertical Position Knob Right Rotation
HKNL Horizontal Position Knob Left Rotation
HKNR Horizontal Position Knob Right Rotation
TGKNL Trigger Position Knob Left Rotation
TGKNR Trigger Position Knob Right Rotation
VBKNL Voltage Base Knob Left Rotation
VBKNR Voltage Base Knob Right Rotation
TBKNL Time Base Knob Left Rotation
TBKNR Time Base Knob Right Rotation
Integer(4B): 0 – unlock; 1 –
Lock? Query key status R
locked
Example
“KEY:AT;”
“KEY:C1;”
“KEY:MATH;”
“KEY:FKN;” -> push
“KEY:FKNL;” -> functional knob increase
“KEY:FKNR;” -> functional knob decrease
“KEY:FKNL@lock;” -> functional knob increase - locked
3 / 19
Uni-Trend Technology (China) Co., Ltd.
Notes:
Due to different device has different key name, the abbreviation is to avoid the difference!
Use local command to lock/unlock full qwerty(the same as UPO2000CS).
Command with question mark should read by interface uci_Read.
Screenshot
For Example:
BMP file: “PrtScn:bmp;”
Notes:
“PrtScn:bmp;” use interface uci_Read,buffer area size can set to 387072,read 8 bits BMP file.
Running Status
For Example:
query:“Proc?;”
setup:“Proc:Stop;” “Proc:AUTO;”
Notes:
The difference of “Proc:Stop”, “Proc:Run” and button “RUN/STOP”:
4 / 19
Uni-Trend Technology (China) Co., Ltd.
It is different from button function of “RUN/STOP”. Hereon “RUN” put DSO at RUN status whatever the current condition is.
“STOP” is the same.
Channel Control
The Basic(Common)Attribute
5 / 19
Uni-Trend Technology (China) Co., Ltd.
-- 10ns 100ns 1us 10us 100us 1ms 10ms 100ms 1s 10s
2ns 20ns 200ns 2us 20us 200us 2ms 20ms 200ms 2s 20s
5ns 50ns 500ns 5us 50us 500us 5ms 50ms 500ms 5s 50s
Voltage base and the current base command written numeric value and unit directly, for example 100mv :
“CH:0@VB:100MV”,“CH:0@TB:500US;”,unit is not case-sensitive.
For Example:
Channel number:0/1/2/3/4{CH1/ CH2/ MATH/ REF-A/ REF-B }
setup:
“CH:0@EN:1@VP:128@HP:350@VB:100MV@TB:500US;”
“CH:2@EN:1;” --- open MATH channel
“CH:2@VP:128;” --- adjust the vertical position of MATH channel to 128
“CH:2@SEL;” --- select MATH channel
query:
“CH:0@VP;”
“CH:0@TB;”
“CH:0@TBV;”
Notes:
1、 The command protocol of basic command and physical channel:
The command name of basic command and physical channel both use “CH”, format is “CH: channel
id@Attribute:Value;” the basic command is suitable for physical channel, MATH,REF, distinguish by channel ID;
2、 CH command and channel number should be command parameter, otherwise it be the wrong command format;
3、 If selected channel does not open when executing command “@SEL;”,return error “channel doesn’t open”;
4、 If it is a physical channel(CH1/ CH2),“@VB” in fine tuning(set by “@ VD”) can only set by the way of
“Enum(String) : +/- {plus/minus one grid }”, get the actual voltage base information from command “@VB”.
Physical Channel
6 / 19
Uni-Trend Technology (China) Co., Ltd.
amplitude)
Probe Probe(probe ratio) WR Enum(Decimals): 1/10/100/1000
Invert Invert(inverse) WR Enum(Integer): 0/1{ON/OFF}
For Example:
“CH:0@CP:D@BW:0@VD:C@Probe:1@invert:0;”
Notes:
1、“CH:0;” this is an invalid command,selected channel should use command “CH:0@SEL;”
2、 Read attribute, buffer area is 10 bytes at least, return character string, coding format of character string is based on
compiler. If it is UNICODE, return character string of UNICODE coding.
Frequency Meter
Parameter Measurement
7 / 19
Uni-Trend Technology (China) Co., Ltd.
freq Freq R Double<8Bytes>
Cycle Cycle R Double<8Bytes>
rtime Rise R Double<8Bytes>
ftime Fall R Double<8Bytes>
pwidth +Width R Double<8Bytes>
nwidth -Width R Double<8Bytes>
oshoot Overshoot R Double<8Bytes>
pshoot Preshoot R Double<8Bytes>
pduty +Duty R Double<8Bytes>
nduty -Duty R Double<8Bytes>
avg Average R Double<8Bytes>
vpp Peak R Double<8Bytes>
rms RMS R Double<8Bytes>
high High R Double<8Bytes>
low Low R Double<8Bytes>
mid Middle R Double<8Bytes>
max Max R Double<8Bytes>
min Min R Double<8Bytes>
amp Amplitude R Double<8Bytes>
For Example:
“mea:freq;” --- read frequency value;
“mea:all;” -- packaging read measured parameter
“mea:all?;” -- packaging read all measured parameters(common)
“mea@src:0;” --- set measurement source as CH1;
Code Example:
Read parameter alone:
double dv = 0.0;
r = uci_ReadX(m_session, _T("mea:freq"), 1000, (byte*)&dv, sizeof(dv));
if (UCISUCCESS(r)) {
printf("Freq = %f", dv);
}
void Test_MeasureParams_DSO() {
comAPICommon::MeaValue params[50];
8 / 19
Uni-Trend Technology (China) Co., Ltd.
auto r = uci_ReadX(m_session, _T("mea:all?;"), 2000, (byte*)params, sizeof(params));
ASSERT(r >= 0);
PrintMeasureParams(params);
};
PrintMeaParam(_p[cb::MP_NDUTY], "NDUTY");
PrintMeaParam(_p[cb::MP_PDUTY], "PDUTY");
PrintMeaParam(_p[cb::MP_MAX], "MAX");
PrintMeaParam(_p[cb::MP_MIN], "MIN");
PrintMeaParam(_p[cb::MP_PKPK], "VPP");
PrintMeaParam(_p[cb::MP_RMS], "RMS");
PrintMeaParam(_p[cb::MP_OVERSHOOT], "OVERSHOOT");
PrintMeaParam(_p[cb::MP_PRESHOOT], "PRESHOOT");
PrintMeaParam(_p[cb::MP_AMP], "AMP");
PrintMeaParam(_p[cb::MP_RISE_TIME], "RISE_TIME");
PrintMeaParam(_p[cb::MP_FALL_TIME], "FALL_TIME");
printf("\n----------------------------------------------------");
}
9 / 19
Uni-Trend Technology (China) Co., Ltd.
unit::uci_UnitFindTypeName(_p.Unit.Type));
}
For Example:
“capture wave:.bin@CH:0@DT:AD;” -- read waveform data of CH1, AD value
“capture wave:.bin@CH:0@DT:vol;” -- read waveform data of CH1, voltage value
“capture wave:.csv@CH:0@DT:vol;” -- read waveform data of CH1, voltage value, keep in CSV file
(only use uci_ReadToFileX)
“capture wave:.sav@CH:0;” -- read waveform data of CH1 (.sav file)
Description:
1、 “.bin” and ”.csv“ file must include:@CH:0” and“@DT:”attribute,and ”.sav” file must include @CH:0 attribute;
2、 This waveform data is the initial data, not display data((there are only a few hundred points),it can use in
waveform analysis task;
3、 It can use read parameter interface{uci_Read or uci_ReadX}or read file interface{uci_ReadToFile or uci_ReadToFileX},
the former keep data in buffer are of in-memory, the latter keep data in hard disk file(if it is UCI_DEMO.EXE
program,please correct the corresponding suffix name.)
4、 When use read interface uci_ReadX:
“capture wave:.bin@CH:0@DT:AD;” received the buffer area size of data:≥64000Bytes
“capture wave:.bin@CH:0@DT:vol;” received the buffer area size of data:≥128000Bytes
“capture wave:.sav@CH:0;” received the buffer area size of data:≥64000Bytes
Notes:the final actual valid data size, it confirmed by interface uci_ReadX returned value.
5、 .sav file is belong to internal format; it can open by waveform analysis of upper computer or parse by protocol.
6、 Waveform data format:
a) AD value : 16 bits short type, a waveform point of waveform data;
b) VOL value,that is voltage value, zero point based on channel base line.
10 / 19
Uni-Trend Technology (China) Co., Ltd.
Trigger System
Parameter address in this command is digital coding; it need refer to the command coding definition in file comApiDef.h
This command is to compatible the old protocol.
Parameter address in this command is digital coding; it need refer to the command coding definition in file comApiDef.h
This command is to compatible the old protocol.
11 / 19
Uni-Trend Technology (China) Co., Ltd.
Command Name Command Parameter Command Parameter Type Remark
rp -- -- --
Case
Method
1. Use parameter measure function to test signal, including frequency, amplitude, cycle etc. The detailed see
Measure function: Parameter measurement
2. Use UTILITY->frequency meter to test signal frequency:Frequency Meter
Difference:
1. MEASURE is software measurement, frequency meter is hardware measurement, frequency meter test accuracy is
higher;
2. Frequency meter test the signal source that is the corresponding signal of trigger source; parameter measurement
test signal source that is source only can set in parameter measurement.
For example:CH1 is the signal test channel which to connect with test source. CH2 is the trigger channel which to
connect with trigger signal, it is usually user-defined. The aim is to find trigger timing, to capture waveform block in CH1
in corresponding time, subtract data and then analyze it.
Common model:
1、 trigger mode set as single trigger, command:“trig@mode:s;”(use write parameter interface);
2、 running status as RUN,command:“proc:run;” (use write parameter interface);
3、 get running status, check running status whether is STOP, if it is STOP, that is means it’s been triggered, command
“proc?”(use read and write interface)
4、 If it has been triggered, subtract waveform data, command:“capture wave:.bin@CH:0@DT:vol;”
Repeat 2-4 steps to complete this model.
12 / 19
Uni-Trend Technology (China) Co., Ltd.
Appendix
MeasureParamPacket:
typedef struct
{
MeasureParam freq;
MeasureParam period;
MeasureParam risetime;
MeasureParam falltime;
MeasureParam pwidth;
MeasureParam nwidth;
MeasureParam overshoot;
MeasureParam preshoot;
MeasureParam pduty;
MeasureParam nduty;
MeasureParam vmean;
MeasureParam vpp;
MeasureParam vrms;
MeasureParam vtop;
MeasureParam vbase;
MeasureParam vmid;
MeasureParam vmax;
MeasureParam vmin;
MeasureParam vamp;
//
char Reserve[24];
}MeasureParamPacket_UTD2000CEX;
13 / 19
Uni-Trend Technology (China) Co., Ltd.
MeasureDataPacket:
Code Definition
Data packet is MeaValue mp[50] (400Bytes), that is fixed 50 test parameter in one dimensional sequence. EMeaParam
defines the position of each parameter in the sequence.
struct UnitParam {
char Type; //unit type,like Time,Freq etc.,define by EType
char Scale; //magnitude,like k、n,p,M etc.,define by EScale
};
Each parameter takes 8 bits, 50 parameter space, and 400 bytes in total.
In-memory model of each parameter:
Fields Value Unit.Type Unit.Scale Is Valid Is Exist
Byte 4Bytes 1Byte 1Byte 1Byte 1Byte
Meaning Physical value Unit type coding Unit quantity Whether is valid Whether is
(decimal) coding existence
Data Value Value 0:invalid;1:valid 0:absent; 1:
existence
Code Definition
14 / 19
Uni-Trend Technology (China) Co., Ltd.
SCALE_n,
SCALE_μ,
SCALE_m,
SCALE_STD = 0,
SCALE_K,
SCALE_M,
SCALE_G,
SCALE_T,
};
Coding table
Unit Coding:
Unit Coding
p -4
n -3
μ -2
m -1
Standard unit 0
K 1
M 2
G 3
T 4
15 / 19
Uni-Trend Technology (China) Co., Ltd.
Unit Type Coding:
Unit Coding
Invalid type -1
frequency(Hz) 0
time(s) 1
area(Vs) 2
sampling rate(Sa/s) 3
count(Sa , pkts) 4
peak-to-peak value(VPP) 5
voltage(V) 6
current(A) 7
power(DB) 8
VV 9
percentage(%) 10
degree(°) 11
Watt(W) 12
unknown unit(U) 13
Parameter Coding
Coding Definition
16 / 19
Uni-Trend Technology (China) Co., Ltd.
MP_CYCRMS, //cycle root mean square
MP_AREA, //area
MP_CYCAREA, // cycle area
MP_OVERSHOOT,//overshoot
MP_PRESHOOT, //preshoot
MP_PERIOD, //period
MP_FREQ, //frequency
MP_RISE_TIME,//rise time
MP_FALL_TIME,//fall time
MP_PWIDTH, //positive pulse width
MP_PHASE, //phase
MP_FRR, //
MP_FRF,
MP_FFR,
MP_FFF,
MP_LRF,
MP_LRR,
MP_LFR,
MP_LFF,
MP_BURST_WIDTH, //burst
//
//reserve section
//
//fixed 50 parameters
MP_MAX_COUNT = 50,
};
Coding Table
Parameter Coding
Maximum value 0
17 / 19
Uni-Trend Technology (China) Co., Ltd.
Minimum value 1
High level/ top value (High/Top) 2
Middle value 3
High level/bottom value(Low) 4
Peak-to-peak value(PKPK) 5
Amplitude(AMP) 6
Mean value(MEAN) 7
Cycle mean(Cycmean) 8
Root mean square(RMS) 9
Cycle root mean square(Cycrms) 10
Area(AREA) 11
Cycle area(Cycarea) 12
Overshoot 13
Preshoot 14
Cycle 15
Frequency(Freq) 16
Rise Time 17
Fall Time 18
Positive pulse width(PWidth) 19
Negative pulse width(NWidth) 20
Positive duty ratio(PDuty) 21
Negative duty ratio(NDuty) 22
Rise delay 23
Fall delay 24
Phase 25
FRR 26
FRF 27
FFR 28
FFF 29
LRF 30
LRR 31
LFR 32
LFF 33
Burst(Burst Width) 34
Reserved 35~39
Notes:
1、 This model only support a part of parameter in the above table;
2、 Different definition name in C#Interface,put it in the name space ucics.unit and ucics.mea.
18 / 19
Uni-Trend Technology (China) Co., Ltd.
Data Unit Table:
Unit Coding
null 0
ps 1
ns 2
μs 3
ms 4
ks 5
nVs 7
μVs 8
mVs 9
μV 11
mV 12
V 13
kV 14
pHz 18
nHz 19
μHz 20
mHz 21
Hz 22
KHz 23
MHz 24
GHz 25
mVV 52
VV 53
KVV 54
mDB 80
DB 81
KDB 82
19 / 19
Uni-Trend Technology (China) Co., Ltd.