Page 1
Programming Manual UTG4000A Series Programming Manual UTG4000A Series Function/Arbitrary Waveform Generator June 19th,2023 Uni-Trend Technology (China) Co., Ltd. UTG4000 Series Programmable Signal Source – Programming Manual 1 / 53...
Page 2
Programming Manual UTG4000A Series Warranty and Statement Copyright 2017 UNI-TREND TECHNOLOGY (CHINA) CO., LTD. Trademark UNI-T is a registered trademark owned by UNI-TREND TECHNOLOGY (CHINA) CO., LTD. File Number 20230619 Software Version V1.23.07 Product functions may be changed or supplemented if software upgrade occurs. Please go to...
Programming Manual UTG4000A Series Introduction to SCPI SCPI (Standard Commands for Programmable Instruments) is a standardized programming language formed based on current IEEE 488.1 and IEEE 488.2 standards and following multiple standards such as the rule of floating point arithmetic in IEEE754 standard, 7-digit numbering symbols (equivalent to ASCII programming) of information exchange in ISO646, and more.
Page 4
Programming Manual UTG4000A Series Boolean Take the parameter value as “ON” ( 1)or “OFF” ( 0) . Example: :SYSTem:LOCK {{1 | ON} | {0 | OFF}}. Integer Unless otherwise specified, any integer within the valid value can be taken as the parameter. Note: Do not set the parameter as decimal format, otherwise, abnormality can occur.
Page 5
Manufacturer name, product model, serial number, and software version number separated by period. Note: The model number returned shall be consistent with the information of nameplate. Example: UNI-T Technologies, UTG4000, 000000001, 00.00.01 *RST Command format: *RST Functional description: ...
Page 6
Programming Manual UTG4000A Series Return format: Query returning the current configuration file data of signal source. Example: :SYSTem:CONFigure Write configuration file data to signal source and load it :SYSTem:CONFigure? Query returning the binary stream of current configuration file...
Page 7
Programming Manual UTG4000A Series Return format: Query returning the separator of the format of system number. Example: :SYSTem:NUMBer:FORMat COMMa Set the number format as comma :SYSTem:NUMBer:FORMat? Query returning COMMa :SYSTem:BRIGhtness Command format: :SYSTem:BRIGhtness { 30|40|50|60|70|80|90|100} :SYSTem:BRIGhtness? Functional description: ...
Page 8
Programming Manual UTG4000A Series Return format: Query returning the acquisition of the current frequency (unit: Hz) measured by cymometer. Returning data by scientific notation. Example: :SYSTem:CYMometer:FREQuency? Query returning 2e+3 :SYSTem:CYMometer:PERiod? Command format: :SYSTem:CYMometer:PERiod? Functional description: Acquire the current period measured by cymometer.
Programming Manual UTG4000A Series CHANnel Command Used to set related functions of the channels of signal source. :CHANnel<n>:MODE Command format: :CHANnel<n>:MODE {CONTinue | MODulation| SWEep| BURSt } :CHANnel<n>:MODE? Functional description: Set the modes of the signal of designated channel to CONTinue, MODulation, SWEep, and BURSt respectively.
Page 10
Programming Manual UTG4000A Series Functional description: Set the channel to output inversion synchronously. Note: There is only one synchronous output port with the equipment, and synchronous output can be turned on for one channel only. <n>: Channel number. The value of n is taken as 1 and 2.
Page 11
Programming Manual UTG4000A Series notation. Example: :CHANnel1:LIMit:UPPer 2 Set the upper limit of the amplitude limit of channel 1 to 2V :CHANnel1:LIMit:UPPer? Query returning 2e+0 :CHANnel<n>:AMPLitude:UNIT Command format: :CHANnel<n>:AMPLitude:UNIT {VPP | DBM | VRMS} :CHANnel<n>:AMPLitude:UNIT? Functional description: ...
Page 12
Programming Manual UTG4000A Series :CHANnel1:PSK:PNCode PN9 Set the PN code of channel 1 as PN9 :CHANnel1:PSK:PNCode? Query returning PN9 :CHANnel<n>:QAM:PNCode Command format: :CHANnel<n>:QAM:PNCode <code> :CHANnel<n>:QAM:PNCode? Functional description: Set the PN code of designated channel. The command is valid for the waveforms of PN code function of quadrature modulation.
Page 13
Programming Manual UTG4000A Series Continuation :CHANnel<n>:BASE:WAVe Command format: :CHANnel<n>:BASE:WAVe { SINe | SQUare | PULSe | RAMP | ARB | NOISe | DC | HARMonic } :CHANnel<n>:BASE:WAVe? Functional description: Set the types of fundamental wave of designated channel. The types include sine wave, square wave, pulse wave, ramp wave, arbitrary wave, noise, direct current, and harmonic binary sequence.
Page 14
Programming Manual UTG4000A Series :CHANnel<n>:BASE:PHASe Command format: :CHANnel<n>:BASE:PHASe { <phase>} :CHANnel<n>:BASE:PHAse? Functional description: Set the output phase of designated channel. <phase> represents phase (unit: °), with range at -360~360. <n>: Channel number. The value of n is taken as 1 and 2.
Page 15
Programming Manual UTG4000A Series :CHANnel<n>:BASE:HIGH Command format: :CHANnel<n>:BASE:HIGH { <voltage>} :CHANnel<n>:BASE:HIGH? Functional description: Set the high value of the signal output of designated channel. <voltage> represents voltage. The unit is the designated unit of current channel. <n>: Channel number. The value of n is taken as 1 and 2.
Page 16
Programming Manual UTG4000A Series :CHANnel<n>:BASE:ARB <source>,<filename> :CHANnel<n>:BASE:ARB? Functional description: Set the designated channel to load arbitrary wave data of a certain file under the arbitrary wave source of fundamental wave. <n>: Channel number. The value of n is taken as 1 and 2.
Page 17
Programming Manual UTG4000A Series Set the pulse width of falling edge of signal pulse of designated channel. <width> represents pulse width (unit: s). <n>: Channel number. The value of n is taken as 1 and 2. Return format: Query returning the pulse width of falling edge of signal pulse of designated channel. Returning by scientific notation.
Page 18
Programming Manual UTG4000A Series Query returning the self-defined harmonic type of designated channel. Returning integer data. Example: :CHANnel1:HARMonic:USER:TYPe #H7FFF Set the self-defined harmonic type of channel 1 :CHANnel1:HARMonic:USER:TYPe? Query returning 32767 :CHANnel<n>:HARMonic:ORDer? Command format: :CHANnel<n>:HARMonic:ORDer <order> :CHANnel<n>:HARMonic:ORDer? Functional description: ...
Page 19
Programming Manual UTG4000A Series :CHANnel1:HARM:ORDer2:PHASe? Query returning 2e+1 :CHANnel<n>:ARB:MODe Command format: :CHANnel<n>:ARB:MODe {DDS | POINTS } :CHANnel<n>:ARB:MODe? Functional description: Set the output modes of arbitrary wave of designated channel. The modes include DDS mode and pointwise mode. <n>: Channel number. The value of n is taken as 1 and 2.
Page 20
Programming Manual UTG4000A Series :CHANnel1:MODulate:WAVe SINe Set the type of modulation wave of the signal of channel 1 to sine wave. :CHANnel1:MODulate:WAVe? Query returning SINe :CHANnel<n>:MODulate:SOURce Command format: :CHANnel<n>:MODulate:SOURce { INTernal|EXTernal } :CHANnel<n>:MODulate:SOURce? Functional description: Set the modulation sources of designated channel. There are two types including internal and external.
Page 21
Programming Manual UTG4000A Series :CHANnel<n>:MODulate:ARB Command format: :CHANnel<n>:MODulate:ARB <source>,<filename> :CHANnel<n>:MODulate:ARB? Functional description: Set the designated channel to load arbitrary wave data of a certain file under the arbitrary wave source. <n>: Channel number. The value of n is taken as 1 and 2.
Page 22
Programming Manual UTG4000A Series Set the frequency deviation of designated channel. <freq> represents frequency deviation (unit: Hz). 0Hz ~ Current fundamental frequency <n>: Channel number. The value of n is taken as 1 and 2. Return format: Query returning the frequency deviation of designated channel. Returning by scientific notation.
Page 23
Programming Manual UTG4000A Series notation. Example: :CHANnel1:FSK:FREQ 2000 Set channel 1 to output 2KHz frequency hopping :CHANnel1:FSK:FREQ? Query returning 2e+3 :CHANnel<n>:PSK:PHASe<m> Command format: :CHANnel<n>:PSK:PHASe<m> { < phase >} :CHANnel<n>:PSK:PHASe<m>? Functional description: Set the designated channel to output the phase value of multiple-phase shift keying. The command is valid only when the modulation mode is designated in advance.
Page 24
Programming Manual UTG4000A Series :CHANnel1:SWEep:TYPe LINe Set channel 1 to linear sweep mode. :CHANnel1:SWEep:TYPe? Query returning LINe :CHANnel<n>:SWEep:FREQuency:STARt Command format: :CHANnel<n>:SWEep:FREQuency:STARt <freq> :CHANnel<n>:SWEep:FREQuency:STARt? Functional description: Set the start frequency of the sweep of designated channel. < freq > represents frequency (unit: Hz).
Page 25
Programming Manual UTG4000A Series :CHANnel1:SWEEP:TIMe 2 Set the sweep time of channel 1 to 2S when sweeping frequency :CHANnel1:SWEEP:TIMe? Query returning 2e+0 :CHANnel<n>:SWEep:TRIGger Command format: CHANnel<n> : SWEep :TRIGger Functional description: Trigger the sweep output of designated channel. The parameter is valid only when set as manual trigger in triggering mode.
Page 26
Programming Manual UTG4000A Series Return format: Query returning the burst phase of designated channel. Returning data by scientific notation. Example: :CHANnel1:BURSt:PHASe 18 Set the burst phase of channel 1 to 18° :CHANnel1:BURSt:PHASe? Query returning 1.8e+1 :CHANnel<n>:BURSt:CYCLes Command format: ...
Page 27
Programming Manual UTG4000A Series WARB<n>:MODulate Command format: WARB<n>:MODulate <arb file> Functional description: Used to write modulated arbitrary waveform. There are maximum 4k points for waveform data. Send the command and then send the file data of arbitrary waveform to signal source.
Page 28
Programming Manual UTG4000A Series Example: :DIGital:TYPe UART Set the type of the communication signal as UART :DIGital:TYPe? Query returning UART :DIGital:FORMat Command format: :DIGital:FORMat { DEC|HEX|CHAR } :DIGital:FORMat? Functional description: Set the designated channel to output the data format of digital communication signal. The formats include decimal data, hexadecimal data, and ASCII data.
Page 29
Programming Manual UTG4000A Series :DIGital:TRIGger Command format: :DIGital:TRIGger Functional description: Trigger sending digital communication signal of designated channel. The function is valid in manual signal sending mode. Example: :DIGital:TRIGger Trigger sending digital signal once :DIGital:DATA Command format: ...
Page 30
Programming Manual UTG4000A Series Return format: Query returning the output of the data bit of digital UART communication signal of designated channel. Returning integer data. Example: :DIGital:UART:DATa 4 Set the data bit of UART communication signal to 4...
Programming Manual UTG4000A Series Example: :DIGital:IIC:CLOCk 1000 Set the clock of IIC communication signal to 1KHz :DIGital:IIC:CLOCk? Query returning 1e+3 :DIGital:IIC:ADDRess Command format: :DIGital:IIC:ADDRess <address> :DIGital:IIC:ADDRess? Functional description: Set the designated channel to output the address of digital IIC communication signal.
Page 32
Programming Manual UTG4000A Series Operating Instructions This section describes some problems and solutions that occur during programming. If problems below occur, please handle with that according to the corresponding instructions. Programming Preparation The programming preparation only applies to those programming that using developing tools “Visual Studio”...
Page 33
Programming Manual UTG4000A Series VISA Programming Some programming examples are described in this section. Through these examples, you will learn how to use VISA and control the instrument by the command of programming manual. More applications can be developed through the examples below: VC++ Environment:Window system, Visual Studio.
Page 34
Programming Manual UTG4000A Series Select "Linker-Command Line" on the left side of the properties dialog box, then set the value of the option "Additional" as visa32.lib, as shown in the Figure below. Add visa.h file on the projectname.cpp file: #include <visa.h>...
Page 35
Programming Manual UTG4000A Series * Open Resource Manager * Open VISA Session to an Instrument * Write the Identification Query Using viPrintf * Try to Read a Response With viScanf * Close the VISA Session*/ ViSession defaultRM; ViSession instr; ViUInt32 numInstrs;...
Page 36
Programming Manual UTG4000A Series printf("Cannot open a session to the device %d. \n", + 1); continue; /** At this point we now have a session open to the USB TMC instrument. *We will now use the viPrintf function to send the device the string "*IDN?\n", *asking for the device’s identification.
Page 37
Programming Manual UTG4000A Series char outputBuffer[VI_FIND_BUFLEN]; ViSession defaultRM, instr; ViStatus status; /* First we will need to open the default resource manager. */ status = viOpenDefaultRM(&defaultRM); (status < VI_SUCCESS) printf("Could not open a session to the VISA Resource Manager!\n"); /* Now we will open a session via TCP/IP device */ char head[256] = "TCPIP0::";...
Page 38
Programming Manual UTG4000A Series Environment: Window system, Visual Studio. Description: Access to the instrument via USBTMC and TCP/IP, and query the device information by sending "*IDN?" command in NI-VISA. Steps Open the Visual Studio software and create a C# console project.
Page 39
Programming Manual UTG4000A Series resource string.Format("TCPIP0::{0}::inst0::INSTR", ip); mbSession (MessageBasedSession)rmSession.Open(resource); mbSession.RawIO.Write("*IDN?\n"); System.Console.WriteLine(mbSession.RawIO.ReadString()); catch (Exception System.Console.WriteLine(ex.Message); void Main(string[] args) tcp_ip_test("192.168.20.11"); Environment: Window system, Microsoft Visual Basic 6.0 Description: Access to the instrument via USBTMC and TCP/IP, and query the device information by ...
Page 40
Programming Manual UTG4000A Series ' This code demonstrates sending synchronous read & write commands ' to an USB Test & Measurement Class (USBTMC) instrument using NI-VISA ' The example writes the "*IDN?\n" string to all the USBTMC ' devices connected to the system and attempts to read back ' results using the write and read functions.
Page 41
Programming Manual UTG4000A Series ' device, we will get a handle to the instrument which we ' will use in later VISA functions. The AccessMode and Timeout ' parameters in this function are reserved for future ' functionality. These two parameters are given the value VI_NULL.
Page 42
Programming Manual UTG4000A Series status AsLong count AsLong ' First we will need to open the default resource manager. status = viOpenDefaultRM(defaultRM) (status < VI_SUCCESS) Then resultTxt.Text = "Could not open a session to the VISA Resource Manager!" tcp_ip_test = status...
Page 43
Programming Manual UTG4000A Series shown in the Figure below. Communicating with the device via TCP/IP resembles USBTMC, but the VISA Write and VISA READ functions shall be set as synchronous I/O. The default setting of LabVIEW is asynchronous IO. Right-click the node, then select "Synchronous I/O Mode>>Synchronous" form the shortcut menu, so as to achieve writing or reading data synchronously.
Page 44
Programming Manual UTG4000A Series % to an USB Test & Measurement Class (USBTMC) instrument using % NI-VISA %Create a VISA-USB object connected to a USB instrument vu = visa('ni','USB0::0x5345::0x1234::SN20220718::INSTR'); %Open the VISA object created fopen(vu); %Send the string "*IDN?",asking for the device's identification.
Page 45
Programming Manual UTG4000A Series Python Environment: Window system, Python3.8, PyVISA 1.11.0 Description: Access to the instrument via USBTMC and TCP/IP, and query the device information by sending "*IDN?" command in NI-VISA. Steps Install python, open the Python batch compiler, and create an empty test.py file.
Programming Manual UTG4000A Series Examples of Programming Configuring sine wave This section introduces how to configure sine wave function. Description For sine wave, there are amplitude, offset, and phase relative to synchronous pulse. The amplitude and offset of a sine wave can be set by using high and low voltage values.
Page 47
Programming Manual UTG4000A Series The commands below can generate the square wave as shown above. :CHANnel1:MODe CONTinue :CHANnel1:BASE:WAVe SQUare :CHANnel1:BASE:FREQuency 40000 :CHANnel1:BASE:AMPLitude 2 :CHANnel1:BASE:OFFSet 0 :CHANnel1:BASE:PHAse 90 :CHANnel1:BASE:DUTY 20 :CHANnel1:OUTPut ON Configuring sawtooth wave Description For sawtooth wave, there are amplitude, offset, phase relative to synchronous pulse, and symmetry used to create triangular waveform and other similar waveforms.
Page 48
Programming Manual UTG4000A Series :CHANnel1:MODe CONTinue :CHANnel1:BASE:WAVe RAMP :CHANnel1:BASE:FREQuency 30000 :CHANnel1:BASE:HIGH 2 :CHANnel1:BASE:LOW 0 :CHANnel1:BASE:PHAse 90 :CHANnel1:RAMP:SYMMetry 20 :CHANnel1:OUTPut ON Configuring pulse wave Description For pulse width, there are amplitude, offset, and phase relative to synchronous pulse. It also adds edge slop and duty cycle (or pulse width).
Page 49
Programming Manual UTG4000A Series Configuring arbitrary wave This section introduces how to configure arbitrary wave. Description For harmonic wave, there are frequency, amplitude, offset, and phase. It also adds mode and waveform file. Examples The codes below can load and modify built-in arbitrary waveforms.
Page 50
Programming Manual UTG4000A Series The commands below can generate the harmonic wave as shown above. :CHANnel1:MODe CONTinue :CHANnel1:BASE:WAVe HARMonic :CHANnel1:BASE:FREQuency 1000 :CHANnel1:BASE:HIGH 1 :CHANnel1:BASE:LOW 0 :CHANnel1:BASE:PHAse 90 :CHANnel1:HARMonic:TOTal:ORDer 10 :CHANnel1:HARMonic:TYPe ALL :CHANnel1:HARM:ORDER2:AMPL 0.02 :CHANnel1:HARM:ORDer2:PHASe 20 :CHANnel1:HARM:ORDER3:AMPL 0.01 :CHANnel1:HARM:ORDer3:PHASe 30 :CHANnel1:OUTPut ON Instruments.uni-trend.com...
Page 51
Programming Manual UTG4000A Series Configuring pseudo-random wave Description For pseudo-random wave, there are bit rate, offset, edge time, symbol, and other attributes. The amplitude and offset of a pseudo-random wave can be set by using high and low voltage values.
Programming Manual UTG4000A Series Appendix 2: State (unlocked/locked) of buttons Order of bits Buttons State 0 for Unlocked; 1 for Locked SWEep 0 for Unlocked; 1 for Locked BURSt 0 for Unlocked; 1 for Locked SINe 0 for Unlocked; 1 for Locked SQUare 0 for Unlocked;...
Need help?
Do you have a question about the UTG4000A Series and is the answer not in the manual?
Questions and answers