SIGLENT SSG6080A Series Programming Manual

SIGLENT SSG6080A Series Programming Manual

Signal generator
Table of Contents

Advertisement

Quick Links

SSG6080A Series
Signal Generator
Programming Guide
PG0805A-E01A

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SSG6080A Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for SIGLENT SSG6080A Series

  • Page 1 SSG6080A Series Signal Generator Programming Guide PG0805A-E01A...
  • Page 3: Table Of Contents

    Contents Programming Overview ....................5 Build Communication ....................5 Build Communication Using VISA ............... 5 1.1.1 Build Communication Using Sockets ..............9 1.1.2 Connecting the signal generator via the USB Host port ........9 1.1.3 Remote Control Capabilities ................. 10 User-defined Programming ................
  • Page 4 System Date (:SYSTem:DATE) ................. 23 3.2.2 IP Address (:SYSTem:COMMunicate:LAN:IPADdress) ........23 3.2.3 Gateway (:SYSTem:COMMunicate:LAN:GATeway) ......... 24 3.2.4 Subnet Mask (:SYSTem:COMMunicate:LAN:SMASk) ........24 3.2.5 IP Config (:SYSTem:COMMunicate:LAN:TYPE) ..........25 3.2.6 Language (SYSTem:LANGuage) ..............25 3.2.7 Screen Saver (SYSTem:SCReen:SAVer) ............26 3.2.8 Beeper (SYSTem:ALARm) ................
  • Page 5 [:SOURce]:POWer Subsystem ................36 3.5.2 [:SOURce]:SWEep Subsystem ................. 49 3.5.3 [:SOURce]:MODulation Subsystem ..............63 3.5.4 [:SOURce]:AM Subsystem ................64 3.5.5 错误 未定义书签。 [:SOURce]:FM Subsystem ............3.5.6 错误 未定义书签。 [:SOURce]:PM Subsystem ............3.5.7 [:SOURce]:PULM Subsystem ................67 3.5.8 [:SOURce]:LFOutput Subsystem ..............75 3.5.9 [:SOURce]:LFOutput:SWEep Subsystem ............
  • Page 6 Internal Noise (:SENSe[:POWer]:FILTer:NSRatio) ........... 91 3.6.19 Logging (:SENSe[:POWer]:LOGGing:STATe) ........... 92 3.6.20 Programming Examples .................... 93 VISA Examples ......................93 VC++ Example ....................93 4.1.1 VB Example ..................... 101 4.1.2 MATLAB Example.................... 109 4.1.3 LabVIEW Example ................... 111 4.1.4 Socket Examples ....................114 Python Example ....................
  • Page 7: Programming Overview

    Programming Overview The SSG6080A supports both USB and LAN interfaces. By using these interfaces, in combination with NI-VISA and programming languages, users can remotely control the signal generator. The instrument comes with an embedded web interface; VXI-11, Sockets and Telnet protocols can be used to communicate with the signal generator.
  • Page 8 Click Unzip, the installation process will automatically launch after unzipping files. If your computer needs to install .NET Framework 4.6.2, its setup process will auto start. The NI-VISA installing dialog is shown above. Click Next to start the installation process. SSG6000A Programming Guide...
  • Page 9 Set the install path, default path is “C:\Program Files\National Instruments\”, you can change it. Click Next, dialog shown as above. Click Next twice, in the License Agreement dialog, select the “I accept the above 2 License Agreement(s).”, and click Next, “Start Installation” dialog shown. Click Next to run installation.
  • Page 10 Now the installation is complete, reboot your PC. Connect the Instrument Depending on your specific model, your signal generator may be able to communicate with a PC through the USB or LAN interface. This manual uses the USB connection in the examples. (For instructions to communicate with a PC through the LAN interface see the User Manual.) Connect the USB Device interface at the rear panel of the signal generator and the USB Host interface of the PC using a USB cable.
  • Page 11: Build Communication Using Sockets

    Refer to the following steps to finish the connection via USB: 1. Install NI-VISA on your PC for GPIB driver. 2. Connect the signal generator USB Host port to a PC’s GPIB card port, with SIGLENT USB- GPIB adaptor. 3. Switch on the signal generator.
  • Page 12: Remote Control Capabilities

    1.2 Remote Control Capabilities User-defined Programming Users can use SCPI commands to program and control the signal generator. For details, refer to the introductions in “Programming Examples”. Send SCPI Commands via NI-MAX Users can control the signal generator remotely by sending SCPI commands via NI-MAX software. 1.2.2.1 Using USB Run NI MAX software.
  • Page 13 NOTE: The “*IDN?” command (known as the Identification Query) returns the instrument manufacturer, instrument model, serial number, and other identification information. 1.2.2.2 Using LAN Add a Network Device, and select a VISA TCP/IP Resource as shown: Run NI MAX software. Click “Device and interface”...
  • Page 14 NOTE: Leave the LAN Device Name BLANK or the connection will fail. After a brief scan, the connection should be shown under Network Devices: SSG6000A Programming Guide...
  • Page 15 Right-click on the product and select Open NI-VISA Test Panel: Click “Input/Output” option button and click “Query” option button. If everything is OK, you will see the Read operation information returned as shown below. SSG6000A Programming Guide...
  • Page 16 SSG6000A Programming Guide...
  • Page 17: Scpi Overview

    SCPI Overview 2.1 Command Format SCPI commands present a hierarchical tree structure containing multiple subsystems; each of the subsystems is made up of a root keyword and several sub keywords. The command string usually starts with a colon “:”, the keywords are separated by a colon “:” and the parameter settings are separated by spaces.
  • Page 18: Parameter Type

    The content in the square brackets can be ignored. When the parameter is ignored, the instrument will set the parameter to its default. For example, In the “[:SOURce]:POWer?” command, sending either of the commands below can generate the same effect: :SOURce:POWer? :POWer? Vertical Bar |...
  • Page 19 For example: [:SOURce]:AM:STATe OFF|ON|0|1 Enumeration The parameter could be any of the values listed. For example: [:SOURce]:SWEep:STATe OFF|FREQuency|LEVel|LEV_FREQ Valid parameters are “OFF”, “FREQuency”, “LEVel” or LEV_FREQ. Integer Except other notes, the parameter can be any integer within the effective value range. For example: [:SOURce]:SWEep:STEP:POINts <value>...
  • Page 20: Command Abbreviation

    The parameter <value> can be set to any real number between -100 and 100. String The parameter should be the combinations of ASCII characters. For example: :SYSTem:COMMunicate:LAN:IPADdress <“xxx.xxx.xxx.xxx”> The IP address can be set as the string “192.168.1.12”. 2.4 Command Abbreviation All of the commands are not case sensitive, so you can use any of them.
  • Page 21: Scpi Commands

    SCPI Commands This chapter introduces the Siglent Technologies SSG6000A SCPI commands, including: IEEE Common Commands System Subsystem Preset Subsystem Output Subsystem Source Subsystem Sense Subsystem 3.1 IEEE Common Commands Identification Query (*IDN) Command Format *IDN? Instruction Returns an instrument identification information string. The string contains the manufacturer, model number, serial number, software number, FPGA number and CPLD number.
  • Page 22: Clear Status (*Cls)

    Clear Status (*CLS) Command Format *CLS Instruction Clears the status byte register. It does this by emptying the error queue and clearing all bits in all of the event registers. The status byte register summarizes the states of the other registers. It is also responsible for generating service requests.
  • Page 23: Operation Complete Query (*Opc)

    Operation Complete Query (*OPC) Command Format *OPC *OPC? Instruction Set bit 0 in the standard event status register to “1” when all pending operations have finished. The query stops any new commands from being processed until the current processing is complete. Then it returns a “1”, and the program continues.
  • Page 24: Wait-To-Continue (*Wai)

    Wait-to-Continue (*WAI) Command Format *WAI Instruction This command causes the instrument to wait until all pending commands are completed before executing any additional commands. There is no query form to the command. Menu None Example *WAI Self Test Query (*TST) Command Format *TST? Instruction...
  • Page 25: System Date (:System:date)

    :SYSTem:TIME 182559 Get System time: :SYSTem:TIME? System Date (:SYSTem:DATE) Command Format :SYSTem:DATE <yyyymmdd> :SYSTem:DATE? Instruction Set system date Get system date Parameter Type String Parameter Range Years(four digits), month(1 ~ 12), date(1 ~ 31) Return String Default None Menu Utility > Setting > Time Setting Example Set System date: :SYSTem:DATE 20050101...
  • Page 26: Gateway (:System:communicate:lan:gateway)

    Example :SYSTem:COMMunicate:LAN:IPADdress “192.168.1.12” :SYSTem:COMMunicate:LAN:IPADdress? Gateway (:SYSTem:COMMunicate:LAN:GATeway) Command Format :SYSTem:COMMunicate:LAN:GATeway <“xxx.xxx.xxx.xxx”> :SYSTem:COMMunicate:LAN:GATeway? Instruction Set the gateway for the signal generator in the network. The gateway will be fetched automatically if the IP assignment is set to DHCP. Get the gateway. Parameter Type String Parameter Range Conforms to the IP standard (0~255.0~255.0~255.0~255)
  • Page 27: Ip Config (:System:communicate:lan:type)

    IP Config (:SYSTem:COMMunicate:LAN:TYPE) Command Format :SYSTem:COMMunicate:LAN:TYPE STATIC|DHCP :SYSTem:COMMunicate:LAN:TYPE? Instruction Toggles the IP assignment setting between static (manual) and DHCP (dynamic assignment) mode. Get the IP config mode. Parameter Type Enumeration Parameter Range STATIC|DHCP Return Enumeration Default None Menu Utility > Interface > LAN Setting > DHCP State Example :SYSTem:COMMunicate:LAN:TYPE DHCP :SYSTem:COMMunicate:LAN:TYPE?
  • Page 28: Screen Saver (System:screen:saver)

    Screen Saver (SYSTem:SCReen:SAVer) Command Format SYSTem:SCReen:SAVer OFF|10S|1MIN|5MIN|15MIN|30MIN|1HOUR|2HOUR SYSTem:SCReen:SAVer? Instruction Set screen saver. Get screen saver. Parameter Type Enumeration Parameter Range OFF|10S|1MIN|5MIN|15MIN|30MIN|1HOUR|2HOUR Return Enumeration Default Menu Utility > Setting > Screen Saver Example SYSTem:SCReen:SAVer 30MIN SYSTem:SCReen:SAVer? Beeper (SYSTem:ALARm) Command Format SYSTem:ALARm ON|OFF|1|0 SYSTem:ALARm? Instruction Set system beeper state.
  • Page 29: Setup Type (:System:pon:type)

    Setup Type (:SYSTem:PON:TYPE) Command Format :SYSTem:PON:TYPE DFT|LAST :SYSTem:PON:TYPE? Instruction Sets the signal generator power on state. Default is the factory configuration and last recalls all of the settings used before the last power down. Get power on type. Parameter Type Enumeration Parameter Range DFT|LAST...
  • Page 30: Adjustment State (:System:ref:dac:stat)

    10M Adjustment State (:SYSTem:REF:DAC:STAT) Command Format :SYSTem:REF:DAC:STAT ON|OFF|1|0 :SYSTem:REF:DAC:STAT? Instruction Set 10M Adjustment State. Get 10M Adjustment State. Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu Utility > Setting > 10M Adjustment Example :SYSTem:REF:DAC:STAT ON :SYSTem:REF:DAC:STAT? Ref Osc Code (:SYSTem:REF:DAC) Command Format :SYSTem:REF:DAC <value>...
  • Page 31: Ref Osc Code Store (:System:ref:dac:save)

    Ref Osc Code Store (:SYSTem:REF:DAC:SAVE) Command Format :SYSTem:REF:DAC:SAVE <file_name> Instruction Save the ref osc code in file. Parameter Type String Parameter Range None Return None Default None Menu Utility > Setting > 10M Adjustment > Save Ref Osc Setting Example :SYSTem:REF:DAC:SAVE “U-disk3/test.dac”...
  • Page 32: Gpib Address (System:gpib)

    Default None Menu Utility > Setting > 10M Adjustment > Reset to Default Example :SYSTem:REF:DAC:DEFault GPIB Address (SYSTem:GPIB) Command Format SYSTem:GPIB <value> SYSTem:GPIB? Instruction Set GPIB address of the signal source. Get GPIB address of the signal source. Parameter Type Integer Parameter Range 1 ~ 30...
  • Page 33: System Preset (:System:preset)

    System Preset (:SYSTem:PRESet) Command Format :SYSTem:PRESet Instruction According to the preset type, preset the parameter configuration of the machine. Parameter Type None Return None Default None Menu Utility > Preset Example For example, preset signal generator to default configuration: :SYSTem:PRESet:TYPE DFT :SYSTem:PRES Or preset signal generator to current configuration: :SYSTem:PRESet:TYPE USER...
  • Page 34: Preset Path (:System:preset:path)

    Preset Path (:SYSTem:PRESet:PATH) Command Format :SYSTem:PRESet:PATH <path> Instruction Set preset file when preset type is user Parameter Type String Return None Default None Menu Utility > Setting > Preset Type Example :SYSTem:PRESet:PATH “Local/test.xml” :SYSTem:PRESet:PATH “U-disk1/test.xml” Preset Type (:SYSTem:PRESet:TYPE) Command Format :SYSTem:PRESet:TYPE DFT|USER :SYSTem:PRESet:TYPE? Instruction...
  • Page 35: Factory Reset (:System:fdefault)

    Factory Reset (:SYSTem:FDEFault) Command Format :SYSTem:FDEFault Instruction Set both the measure and setting parameters to the factory settings. Parameter Type None Parameter Range None Return None Default None Menu Utility > Setting > Factory Reset Example :SYSTem:FDEFault Reset & Clear (SYSTem:RESet:CLEar) Command Format SYSTem:RESet:CLEar Instruction...
  • Page 36: Output Subsystem

    3.4 Output Subsystem RF Output (:OUTPut[:STATe]) Command Format :OUTPut[:STATe] ON|OFF|1|0 :OUTPut[:STATe]? Instruction Activate/Deactivate the RF output Get the state of the RFoutput Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu Example :OUTPut ON :OUTPut? RF Output ([:SOURce]:OUTPut) Command Format [:SOURce]:OUTPut ON|OFF|1|0 Instruction Activate/Deactivate the RF output...
  • Page 37: Source Subsystem

    3.5 Source Subsystem [:SOURce]:FREQuency Subsystem 3.5.1.1 Frequency Display ([:SOURce]:FREQuency:DISPlay) Command Format [:SOURce]:FREQuency:DISPlay <freq> [:SOURce]:FREQuency:DISPlay? Instruction Set the frequency display on parameter bar Get the frequency display on parameter bar Parameter Type Float, unit: Hz, kHz, MHz, GHz, Default “Hz” Parameter Range Frequency offset + Full frequency range Return Float, unit: Hz...
  • Page 38: Source]:Power Subsystem

    3.5.1.3 Frequency Offset ([:SOURce]:FREQuency:OFFSet) Command Format [:SOURce]:FREQuency:OFFSet <freq> [:SOURce]:FREQuency:OFFSet? Instruction Set the frequency offset of a downstream circuit element Get the frequency offset of a downstream circuit element Parameter Type Float, unit: Hz, kHz, MHz, GHz, Default “Hz” Parameter Range -200 GHz ~ 200 GHz Return Float, unit: Hz...
  • Page 39 3.5.2.2 Level ([:SOURce]:POWer) Command Format [:SOURce]:POWer <power> [:SOURce]:POWer? Instruction Set the RF output level Get the RF output level Parameter Type Float, unit: dBm, dBuV, uV, mV, V, nW, uW, mW, W, Default: dBm Parameter Range Please refer to SSG6000A datasheet. Return Float, unit: dBm Default...
  • Page 40 3.5.2.4 Level Offset ([:SOURce]:POWer:OFFSet) Command Format [:SOURce]:POWer:OFFSet <power> [:SOURce]:POWer:OFFSet? Instruction Set the RF offset level of the RF output Get the RF offset level of the RF output Parameter Type Float Parameter Range -100 dB ~ 100 dB Return Float, unit: dB Default 0 dB Menu...
  • Page 41 POWer:ALC? 3.5.2.6 Flatness List State ([:SOURce]:CORRection[:FLATness]) Command Format [:SOURce]:CORRection[:FLATness] ON|OFF|1|0 [:SOURce]:CORRection[:FLATness]? Instruction Activate/deactivate flatness correction list. Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu LEVEL > Flatness Example CORRection:FLATness ON :CORRection? 3.5.2.7 Flatness List Add Row ([:SOURce]:CORRection:FLATness:PAIR) Command Format [:SOURce]:CORRection:FLATness:PAIR <freq>,<power>...
  • Page 42 Instruction Delete the selected row in the flatness list. Parameter Type Integer Parameter Range Less than the total count of the flatness. Return None Default None Menu LEVEL > Flatness > Delete Example CORRection:FLATness:DELete 0 3.5.2.9 Flatness List Count ([:SOURce]:CORRection:FLATness:COUNt?) Command Format [:SOURce]:CORRection:FLATness:COUNt? Instruction...
  • Page 43 Example :CORRection:STORe “U-disk3/test.uflt” 3.5.2.11 Flatness List Load ([:SOURce]:CORRection:LOAD) Command Format [:SOURce]:CORRection:LOAD <file_name> Instruction Load an existing flatness correction file Parameter Type String Parameter Range None Return None Default None Menu LEVEL > Flatness > Load Example :CORRection:LOAD “U-disk3/test.uflt” 3.5.2.12 Flatness List Clear ([:SOURce]:CORRection:FLATness:PRESet) Command Format [:SOURce]:CORRection:FLATness:PRESet Instruction...
  • Page 44 Parameter Type Enumeration Parameter Range FLATness|MANUal|SWEEPlist Return Enumeration Default FLATness Menu LEVEL > Flatness > Setting > Fill Type Example :CORRection:FLATness:FILL:TYPE FLATness :CORRection:FLATness:FILL:TYPE? 3.5.2.14 Flatness List Start Freq ([:SOURce]:CORRection:FLATness:STARtfreq) Command Format [:SOURce]:CORRection:FLATness:STARtfreq <freq> [:SOURce]:CORRection:FLATness:STARtfreq? Instruction Set the start frequency when you want to fill the flatness list with the sensor and filling type is “Manual Step”.
  • Page 45 Parameter Type Float, unit: Hz, kHz, MHz, GHz, Default “Hz” Parameter Range Full frequency range Return Float, unit: Hz Default Maximum frequency Menu LEVEL > Flatness > Setting > Fill Type > Manual Step > Stop Freq Example :CORRection:FLATness:STOPfreq 500 MHz :CORRection:FLATness:STOPfreq? 3.5.2.16 Flatness List Fill Space ([:SOURce]:CORRection:FLATness:SPACe) Command Format...
  • Page 46 Return Float, unit: Hz Default None Menu LEVEL > Flatness > Setting > Fill Type > Manual Step > Step Linear Example :CORRection:FLATness:LINStep 200 MHz :CORRection:FLATness:LINStep? 3.5.2.18 Flatness List Log Step ([:SOURce]:CORRection:FLATness:LOGStep) Command Format [:SOURce]:CORRection:FLATness:LOGStep <value> [:SOURce]:CORRection:FLATness:LOGStep? Instruction Set the log frequency step in Manual Step Fill Type. Get the log frequency step in Manual Step Fill Type.
  • Page 47 Example :CORRection:FLATness:POINt 5 :CORRection:FLATness:POINt? 3.5.2.20 Fill Flatness with Sensor ([:SOURce]:CORRection:CSET:DATA[:SENSor][:POWer]:SONCe) Command Format [:SOURce]:CORRection:CSET:DATA[:SENSor][:POWer]:SONCe Instruction Fill the level values of the flaness list with the power meter. Parameter Type None Parameter Range None Return None Default None Menu LEVEL > Flatness > Setting > Fill Flatness with Sensor Example :CORRection:CSET:DATA:SONCe 3.5.2.21 Level Control ([:SOURce]:POWer:SPC:STATe)
  • Page 48 3.5.2.22 Level Control (:SENSe[:POWer]:LEV:CTL:STATe) Command Format :SENSe[:POWer]:LEV:CTL:STATe ON|OFF|1|0 :SENSe[:POWer]:LEV:CTL:STATe? Instruction Activate/Deactivate power control using an external USB power sensor Get the level control state Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu SENSOR > Level Control Example :SENSe:LEV:CTL:STATe OFF :SENSe:LEV:CTL:STATe? 3.5.2.23 Target Level ([:SOURce]:POWer:SPC:TARGet) Command Format...
  • Page 49 3.5.2.24 Target Level (:SENSe[:POWer]:SPC:TARGet) Command Format :SENSe[:POWer]:SPC:TARGet <power> :SENSe[:POWer]:SPC:TARGet? Instruction Set the nominal level expected at the input of the sensor Get the nominal level expected at the input of the sensor Parameter Type Float, unit: dBm, dBuV, uV, mV, V, nW, uW, mW, W, Default: dBm Parameter Range -120 dBm ~ 20 dBm Return...
  • Page 50 3.5.2.26 Level Limit (:SENSe[:POWer]:LIMit) Command Format :SENSe[:POWer]:LIMit <power> :SENSe[:POWer]:LIMit? Instruction Set the upper limit for the RF output power Get the upper limit for the RF output power Parameter Type Float, unit: dBm, dBuV, uV, mV, V, nW, uW, mW, W, Default: dBm Parameter Range -120 dBm ~ 20 dBm Return...
  • Page 51: Source]:Sweep Subsystem

    3.5.2.28 Catch Range (:SENSe[:POWer]:SPC:CRANge) Command Format :SENSe[:POWer]:SPC:CRANge <power> :SENSe[:POWer]:SPC:CRANge? Instruction Set the capture range of the control system Get the capture range of the control system Parameter Type Float, unit: dB Parameter Range 0 dB ~ 50 dB Return Float, unit: dB Default 0 dB Menu...
  • Page 52 3.5.3.2 Sweep Type ([:SOURce]:SWEep:TYPE) Command Format [:SOURce]:SWEep:TYPE LIST|STEP [:SOURce]:SWEep:TYPE? Instruction Set sweep type Get sweep type Parameter Type Enumeration Parameter Range LIST|STEP Return Enumeration Default STEP Menu SWEEP > Step Sweep / List Sweep Example :SWEep:TYPE STEP :SWEep:TYPE? 3.5.3.3 Start Frequency ([:SOURce]:SWEep:STEP:STARt:FREQuency) Command Format [:SOURce]:SWEep:STEP:STARt:FREQuency <freq>...
  • Page 53 3.5.3.4 Stop Frequency ([:SOURce]:SWEep:STEP:STOP:FREQuency) Command Format [:SOURce]:SWEep:STEP:STOP:FREQuency <freq> [:SOURce]:SWEep:STEP:STOP:FREQuency? Instruction Set the stop frequency for the sweep mode Get the stop frequency for the sweep mode Parameter Type Float, unit: Hz, kHz, MHz, GHz, Default “Hz” Parameter Range Full frequency range. Return Float, unit: Hz Default...
  • Page 54 3.5.3.6 Stop Level ([:SOURce]:SWEep:STEP:STOP:LEVel) Command Format [:SOURce]:SWEep:STEP:STOP:LEVel <level> [:SOURce]:SWEep:STEP:STOP:LEVel? Instruction Set the stop level for the sweep mode Get the stop level for the sweep mode Parameter Type Float, unit: dBm, dBuV, uV, mV, V, nW, uW, mW, W, Default dBm Parameter Range Full level range.
  • Page 55 3.5.3.8 Sweep Points ([:SOURce]:SWEep:STEP:POINts) Command Format [:SOURce]:SWEep:STEP:POINts <points> [:SOURce]:SWEep:STEP:POINts? Instruction Set the number of steps in an RF sweep Get the number of steps in an RF sweep Parameter Type Integer Parameter Range 2 ~ 65535 Return Integer Default Menu SWEEP >...
  • Page 56 3.5.3.10 Sweep Space ([:SOURce]:SWEep:STEP:SPACe) Command Format [:SOURce]:SWEep:STEP:SPACe LINear|LOGarithmic [:SOURce]:SWEep:STEP:SPACe? Instruction Select the sweep spacing Get the sweep spacing Parameter Type Enumeration Parameter Range LINear|LOGarithmic Return Enumeration Default LINear Menu SWEEP > Step Sweep > Sweep Space Example :SWEep:STEP:SPACe LOGarithmic :SWEep:STEP:SPACe? 3.5.3.11 Sweep Step in Linear Sweep Space ([:SOURce]:SWEep[:FREQuency]:STEP[:LINear]) Command Format...
  • Page 57 3.5.3.12 Sweep Step in Log Sweep Space ([:SOURce]:SWEep[:FREQuency]:STEP:LOGarithmic) Command Format [:SOURce]:SWEep[:FREQuency]:STEP:LOGarithmic <value> [:SOURce]:SWEep[:FREQuency]:STEP:LOGarithmic? Instruction Set the sweep step in logarithmic sweep space. Get the sweep step in logarithmic sweep space. Parameter Type Float, unit: % Parameter Range None Return Float, unit: % Default Menu SWEEP >...
  • Page 58 3.5.3.14 Sweep List Delete Row ([:SOURce]:SWEep:LIST:DELete) Command Format [:SOURce]:SWEep:LIST:DELete <row> Instruction Delete the sweep list pair Parameter Type Integer Parameter Range 1 to the full count of the sweep list. Return None Default None Menu SWEEP > List Sweep > Delete Example :SWEep:LIST:DELete 1 3.5.3.15 Sweep List Edit ([:SOURce]:SWEep:LIST:CHANGe)
  • Page 59 3.5.3.16 Sweep List Row Count ([:SOURce]:SWEep:LIST:CPOint?) Command Format [:SOURce]:SWEep:LIST:CPOint? Instruction Get how many rows in sweep list Parameter Type None Parameter Range None Return Float Default Menu SWEEP > List Sweep Example :SWEep:LIST:CPOint? 3.5.3.17 Show Sweep List ([:SOURce]:SWEep:LIST:LIST?) Command Format [:SOURce]:SWEep:LIST:LIST? <begin_ row>,<end_row>...
  • Page 60 Menu SWEEP > List Sweep > Clear Example SWEep:LIST:INITialize:PRESet 3.5.3.19 Sweep List Initialize From Step ([:SOURce]:SWEep:LIST:INITialize:FSTep) Command Format [:SOURce]:SWEep:LIST:INITialize:FSTep Instruction Regenerate the sweep list based on the data points of the current step sweep settings Parameter Type None Parameter Range None Return None...
  • Page 61 Parameter Range None Return None Default None Menu SWEEP > List Sweep > Save Example :SWEep:STORe “U-disk3/test.lsw” 3.5.3.22 Sweep Direction ([:SOURce]:SWEep:DIRect) Command Format [:SOURce]:SWEep:DIRect FWD|REV [:SOURce]:SWEep:DIRect? Instruction Select the direction for sweep Parameter Type Enumeration Parameter Range FWD|REV Return Enumeration Default Menu SWEEP >...
  • Page 62 Example :SWEep:MODE SINGle :SWEep:MODE? 3.5.3.24 Execute Single Sweep ([:SOURce]:SWEep:EXECute) Command Format [:SOURce]:SWEep:EXECute Instruction Execute one single sweep when the sweep mode is Single. Parameter Type None Parameter Range None Return None Default None Menu SWEEP > Execute single sweep Example :SWEep:EXECute 3.5.3.25 Trigger Mode ([:SOURce]:SWEep:SWEep:TRIGger:TYPE) Command Format...
  • Page 63 3.5.3.26 Point Trigger ([:SOURce]:SWEep:POINt:TRIGger:TYPE) Command Format [:SOURce]:SWEep:POINt:TRIGger:TYPE AUTO|KEY|BUS|EXT [:SOURce]:SWEep:POINt:TRIGger:TYPE? Instruction Select the point trigger Get the point trigger Parameter Type Enumeration Parameter Range AUTO|KEY|BUS|EXT Return Enumeration Default AUTO Menu SWEEP > Point Trigger Example :SWEep:POINt:TRIGger:TYPE KEY :SWEep:POINt:TRIGger:TYPE? 3.5.3.27 Bus Trigger ([:SOURce]:*TRG) Command Format [:SOURce]:*TRG Instruction...
  • Page 64 Get the trigger slope when the trigger mode or point trigger is EXT. Parameter Type Enumeration Parameter Range POSitive|NEGative Return Enumeration Default POSitive Menu SWEEP > Trigger Slope Example :INPut:TRIGger:SLOPe NEGative :INPut:TRIGger:SLOPe? 3.5.3.29 Get Sweep Point ([:SOURce]:SWEep:CURRent:Data?) Command Format [:SOURce]:SWEep:CURRent:Data? Instruction Get the currently sweep point.
  • Page 65: Source]:Modulation Subsystem

    [:SOURce]:MODulation Subsystem 3.5.4.1 Modulation State ([:SOURce]:MODulation) Command Format [:SOURce]:MODulation ON|OFF|1|0 [:SOURce]:MODulation? Instruction Switch modulation on and off Get the modulation state Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu Example MODulation ON :MODulation? 3.5.4.2 Modulation State (:OUTPut:MODulation[:STATe]) Command Format :OUTPut:MODulation[:STATe] ON|OFF|1|0 :OUTPut:MODulation[:STATe]? Instruction...
  • Page 66: Source]:Am Subsystem

    [:SOURce]:AM Subsystem 3.5.5.1 AM State ([:SOURce]:AM:STATe) Command Format [:SOURce]:AM:STATe ON|OFF|1|0 [:SOURce]:AM:STATe? Instruction Activate/Deactivate amplitude modulation (AM) Get the AM state Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu AM > AM State Example :AM:STATe ON :AM:STATe? 3.5.5.2 AM Shape ([:SOURce]:AM:WAVEform) Command Format [:SOURce]:AM:WAVEform SINE|SQUAre [:SOURce]:AM:WAVEform?
  • Page 67 3.5.5.3 AM Source ([:SOURce]:AM:SOURce) Command Format [:SOURce]:AM:SOURce INTernal|EXTernal|INT,EXT [:SOURce]:AM:SOURce? Instruction Select the modulation signal source for amplitude modulation Get the AM source Parameter Type Enumeration Parameter Range INTernal|EXTernal|INT,EXT Return Enumeration Default INTernal Menu AM > AM Source Example :AM:SOURce EXTernal :AM:SOURce? 3.5.5.4 AM Depth ([:SOURce]:AM:DEPTh)
  • Page 68 3.5.5.5 AM Rate ([:SOURce]:AM:FREQuency) Command Format [:SOURce]:AM:FREQuency <value> [:SOURce]:AM:FREQuency? Instruction Set the AM modulation frequency Get the AM modulation frequency Parameter Type Float, unit: Hz, kHz, MHz, GHz, Default “Hz” Parameter Range Sine: 0.01 Hz ~ 100 kHz Square: 0.01 Hz ~ 20 kHz Return Float, unit: Hz Default...
  • Page 69: Source]:Pulm Subsystem

    [:SOURce]:PULM Subsystem 3.5.6.1 Pulse State ([:SOURce]:PULM:STATe) Command Format [:SOURce]:PULM:STATe ON|OFF|1|0 [:SOURce]:PULM:STATe? Instruction Activate/Deactivate the pulse modulation Get the state of pulse modulation Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu PULSE > Pulse State Example PULM:STAT ON :PULM:STATe? 3.5.6.2 Pulse Out ([:SOURce]:PULM:OUT:STATe) Command Format...
  • Page 70 3.5.6.3 Pulse Source ([:SOURce]:PULM:SOURce) Command Format [:SOURce]:PULM:SOURce INTernal|EXTernal [:SOURce]:PULM:SOURce? Instruction Select the source for the pulse modulation signal Get the source for the pulse modulation signal Parameter Type Enumeration Parameter Range INTernal|EXTernal Return Enumeration Default INTernal Menu PULSE > Pulse Source Example PULM:SOUR INTernal :PULM:SOURce?
  • Page 71 3.5.6.5 Pulse Out Polarity ([:SOURce]:PULM:POLarity) Command Format [:SOURce]:PULM:POLarity NORMal|INVerted [:SOURce]:PULM:POLarity? Instruction Set the period of the generated pulse. The period determines the repetition frequency of the internal signal Get the period of the generated pulse Parameter Type Enumeration Parameter Range NORMal|INVerted Return Enumeration...
  • Page 72 Menu PULSE > Pulse Mode Example PULM:MODE DOUB PULM:MODE? 3.5.6.7 Pulse Period ([:SOURce]:PULM:PERiod) Command Format [:SOURce]:PULM:PERiod <value> [:SOURce]:PULM:PERiod? Instruction Set the period of the generated pulse when pulse mode is Single or Double. The period determines the repetition frequency of the internal signal Get the period of the generated pulse Parameter Type...
  • Page 73 Menu PULSE > Pulse Period Example :PULM:INT1:PERiod 900 ns :PULM:INT1:PERiod? 3.5.6.9 Pulse Width ([:SOURce]:PULM:WIDTh) Command Format [:SOURce]:PULM:WIDTh <value> [:SOURce]:PULM:WIDTh? Instruction Set the width of the generated pulse when pulse mode is Single or Double. Get the width of the generated pulse when pulse mode is Single or Double.
  • Page 74 Menu PULSE > Pulse Width Example :PULM:INT:PWIDth 400 ns :PULM:INT:PWIDth? 3.5.6.11 Double Pulse Delay ([:SOURce]:PULM:DOUBle:DELay) Command Format [:SOURce]:PULM:DOUBle:DELay <value> [:SOURce]:PULM:DOUBle:DELay? Instruction Set the delay from the start of the first pulse to the start of the second pulse when pulse mode is Double. Get the delay from the start of the first pulse to the start of the second pulse when pulse mode is Double.
  • Page 75 Example PULM:DOUBle:WIDTh 2 s PULM:DOUBle:WIDTh? 3.5.6.13 Trigger Out ([:SOURce]:PULM:TRIGger:STATe) Command Format [:SOURce]:PULM:TRIGger:STATe ON|OFF|1|0 [:SOURce]:PULM:TRIGger:STATe? Instruction Set the trigger output status Get the trigger output status Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu PULSE > Trigger Out Example PULM:TRIGger:STATe ON :PULM:TRIGger:STATe? 3.5.6.14 Pulse Trigger ([:SOURce]:PULM:TRIGger:MODE)
  • Page 76 3.5.6.15 Trig Polarity ([:SOURce]:PULM:TRIGger:EXTernal:GATE:POLarity) Command Format [:SOURce]:PULM:TRIGger:EXTernal:GATE:POLarity NORMal|INVerted [:SOURce]:PULM:TRIGger:EXTernal:GATE:POLarity? Instruction Select the polarity of the gate signal Get the polarity of the gate signal Parameter Type Enumeration Parameter Range NORMal|INVerted Return Enumeration Default NORMal Menu PULSE > Pulse Polarity Example PULM:TRIG:EXT:GATE:POL NORMal :PULM:TRIGger:EXTernal:GATE:POLarity? 3.5.6.16 Trig Delay ([:SOURce]:PULM:DELay)
  • Page 77: Source]:Lfoutput Subsystem

    [:SOURce]:PULM:TRIGger:EXTernal:SLOPe? Instruction Set the polarity of the active slope of an applied trigger at the PULSE EXT connector Get the polarity of the active slope of an applied trigger at the PULSE EXT connector Parameter Type Enumeration Parameter Range NEGative|POSitive Return Enumeration Default...
  • Page 78 [:SOURce]:LFOutput:VOLTage? Instruction Set the voltage of the LF output signal Get the voltage of the LF output signal Parameter Type Float, unit: dBm, uVpp, mVpp, Vpp, nW, uW, mW, Default: Vpp Parameter Range 1 mVpp ~ 3 Vpp Return Float, unit: Vpp Default 0.5 Vpp Menu...
  • Page 79 Get LF out put frequency. If the signal source is set to “Internal”, the instrument performs the analog modulations (AM/FM /PM) with this frequency. Parameter Type Float, unit: Hz, kHz, MHz, GHz, Default “Hz” Parameter Range 0.01 Hz ~ 1 MHz Return Float, unit: Hz Default...
  • Page 80: Source]:Lfoutput:sweep Subsystem

    Parameter Type Float, unit: deg Parameter Range -360 deg ~ 360 deg Return Float, unit: deg Default 0 deg Menu LF > LF Phase Example LFOutput:PHASe 20 LFOutput:PHASe? [:SOURce]:LFOutput:SWEep Subsystem 3.5.8.1 Sweep State ([:SOURce]:LFOutput:SWEep) Command Format [:SOURce]:LFOutput:SWEep ON|OFF|1|0 [:SOURce]:LFOutput:SWEep? Instruction Activate/Deactivate the LF frequency sweep signal generation Get the state of LF frequency sweep Parameter Type...
  • Page 81 Parameter Range UP|DOWN Return Enumeration Default Menu LF Sweep > Sweep Direction Example :LFOutput:SWEep:DIRect DOWN :LFOutput:SWEep:DIRect? 3.5.8.3 Start Freq ([:SOURce]:LFOutput:SWEep:STARt:FREQuency) Command Format [:SOURce]:LFOutput:SWEep:STARt:FREQuency <freq> [:SOURce]:LFOutput:SWEep:STARt:FREQuency? Instruction Set the start frequency of sweep mode Get the start frequency of sweep mode Parameter Type Float, unit: Hz, kHz, MHz, GHz, Default “Hz”...
  • Page 82 Default 1.5 kHz Menu LF Sweep > Stop Freq Example :LFOutput:SWEep:STOP:FREQuency 1000 :LFOutput:SWEep:STOP:FREQuency? 3.5.8.5 Center Freq ([:SOURce]:LFOutput:SWEep:CENTer:FREQuency) Command Format [:SOURce]:LFOutput:SWEep:CENTer:FREQuency <freq> [:SOURce]:LFOutput:SWEep:CENTer:FREQuency? Instruction Set the center frequency of sweep mode Get the center frequency of sweep mode Parameter Type Float, unit: Hz, kHz, MHz, GHz, Default “Hz” Parameter Range 0.01 Hz ~ Maximum frequency of LF Return...
  • Page 83 Menu LF Sweep > Freq Span Example :LFOutput:SWEep:SPAN:FREQuency 550 :LFOutput:SWEep:SPAN:FREQuency? 3.5.8.7 Sweep Time ([:SOURce]:LFOutput:SWEep:DWELl) Command Format [:SOURce]:LFOutput:SWEep:DWELl <time> [:SOURce]:LFOutput:SWEep:DWELl? Instruction Set the sweep time of sweep mode Get the sweep time of sweep mode Parameter Type Float, unit: ns, us, ms, s, and default is s. Parameter Range 1 ms ~ 500 s Return...
  • Page 84 Example :LFOutput:SWEep:TRIGger:TYPE KEY :LFOutput:SWEep:TRIGger:TYPE? 3.5.8.9 Trigger Slope ([:SOURce]:LFOutput:SWEep:XPOLar) Command Format [:SOURce]:LFOutput:SWEep:XPOLar POS|NEG [:SOURce]:LFOutput:SWEep:XPOLar? Instruction Select the trigger slope of the external trigger signal Get the trigger slope of the external trigger signal Parameter Type Enumeration Parameter Range POS|NEG Return Enumeration Default Menu LF Sweep >...
  • Page 85: Sense Subsystem

    3.5.8.11 Sweep Space ([:SOURce]:LFOutput:SWEep:SPACing) Command Format [:SOURce]:LFOutput:SWEep:SPACing LINear|LOGarithmic [:SOURce]:LFOutput:SWEep:SPACing? Instruction Select the mode for the calculation of the frequency sweep intervals Get the mode for the calculation of the frequency sweep intervals Parameter Type Enumeration Parameter Range LINear|LOGarithmic Return Enumeration Default LINear Menu...
  • Page 86: Sensor State (:Sense[:Power]:Status)

    Sensor State (:SENSe[:POWer]:STATus) Command Format :SENSe[:POWer]:STATus OFF|ON|0|1 :SENSe[:POWer]:STATus? Instruction Set the sensor state Get the sensor state Parameter Type Boolean Parameter Range OFF|ON|0|1 Return Boolean Default Menu SENSOR > Sensor State Example SENSe:STATus ON SENSe:STATus? Measurement (:SENSe[:POWer]:VALue?) Command Format :SENSe[:POWer]:VALue? Instruction Indicate the current reading of the sensor Parameter Type...
  • Page 87: Statistics Value (:Read[:Power]?)

    Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu SENSOR > Statistics Example SENSe:STATIStics:STATe ON SENSe:STATIStics:STATe? Statistics Value (:READ[:POWer]?) Command Format :READ[:POWer]? Instruction Indicate the measured mean value and maximum value of power meter readings Parameter Type None Parameter Range None Return String...
  • Page 88: Statistics Min Value (:Sense[:Power]:Statistics:min?)

    Example SENSe:STATIStics:MAX? Statistics Min Value (:SENSe[:POWer]:STATIStics:MIN?) Command Format :SENSe[:POWer]:STATIStics:MIN? Instruction Indicate the measured minimum value of power meter readings Parameter Type None Parameter Range None Return Float, unit: dBm Default None Menu SENSOR > Statistics Example SENSe:STATIStics:MIN? Statistics Mean Value (:SENSe[:POWer]:STATIStics:AVG?) Command Format :SENSe[:POWer]:STATIStics:AVG? Instruction...
  • Page 89: Statistics Clear (:Sense[:Power]:Statistics:clear)

    Parameter Type None Parameter Range None Return Integer Default None Menu SENSOR > Statistics Example SENSe:STATIStics:COUNt? Statistics Clear (:SENSe[:POWer]:STATIStics:CLEAr) Command Format :SENSe[:POWer]:STATIStics:CLEAr Instruction Clear the statistics counter of power meter Parameter Type None Parameter Range None Return None Default None Menu SENSOR >...
  • Page 90: Zeroing (:Sense[:Power]:Zero)

    Example CALibration:ZERO:TYPE EXTernal :CALibration:ZERO:TYPE? Zeroing (:SENSe[:POWer]:ZERO) Command Format :SENSe[:POWer]:ZERO Instruction Perform zeroing of the sensor Parameter Type None Parameter Range None Return None Default None Menu SENSOR > Click to perform zeroing Example :SENSe:ZERO Frequency Type (:SENSe[:POWer]:SOURce) Command Format :SENSe[:POWer]:SOURce RF|USER :SENSe[:POWer]:SOURce? Instruction Select the signal source for the measurement...
  • Page 91: Frequency (:Sense[:Power]:Frequency)

    Frequency (:SENSe[:POWer]:FREQuency) Command Format :SENSe[:POWer]:FREQuency <freq> :SENSe[:POWer]:FREQuency? Instruction Set the frequency for frequency type "USER" Get the frequency for frequency type "USER" Parameter Type Float, unit: Hz, kHz, MHz, GHz, Default “Hz” Parameter Range 9 kHz ~ Full frequency range Return Float, unit: Hz Default...
  • Page 92: Level Offset (:Sense[:Power]:Offset)

    Level Offset (:SENSe[:POWer]:OFFSet) Command Format :SENSe[:POWer]:OFFSet <power> :SENSe[:POWer]:OFFSet? Instruction The command enters a level offset which is mathematically added to the measured level value Get the level offset which is mathematically added to the measured level value Parameter Type Float, unit: dB Parameter Range Limit by power sensor.
  • Page 93: Average Times (:Sense[:Power]:Filter:length)

    Average Times (:SENSe[:POWer]:FILTer:LENGth) Command Format :SENSe[:POWer]:FILTer:LENGth <length> :SENSe[:POWer]:FILTer:LENGth? Instruction Set the average number times Parameter Type Integer Parameter Range Limit by power sensor Return Float Default None Menu SENSOR > Averaging Example SENSe:FILTer:LENGth 10 SENSe:FILTer:LENGth? Internal Noise (:SENSe[:POWer]:FILTer:NSRatio) Command Format :SENSe[:POWer]:FILTer:NSRatio <noise>...
  • Page 94: Logging (:Sense[:Power]:Logging:state)

    Logging (:SENSe[:POWer]:LOGGing:STATe) Command Format :SENSe[:POWer]:LOGGing:STATe <state> :SENSe[:POWer]:LOGGing:STATe? Instruction Set logging state Get logging state Parameter Type Boolean Parameter Range ON|OFF|1|0 Return Boolean Default Menu SENSOR > Logging Example SENSe:LOGGing:STATe ON SENSe:LOGGing:STATe? SSG6000A Programming Guide...
  • Page 95: Programming Examples

    4 Programming Examples This chapter gives some examples for the programmer. In these examples you can see how to use the VISA or sockets, in combination with the commands have been described above to control the signal generator. By following these examples, you can develop many more applications. 4.1 VISA Examples VC++ Example Environment: Win10 64bit system, Visual Studio...
  • Page 96 Set lib path set lib file: Set lib path: the NI-VISA install path, in our computer we set the path is: C:\Program Files\IVI Foundation\VISA\WinNT\lib\msc. Set this path to project---properties---Linker---General---Additional Library Directories: as seen in the pictures below. Set lib file: project---properties---Linker---Command Line---Additional Options: visa32.lib Include visa.h file: In the projectname.cpp file: #include <visa.h>...
  • Page 97 3. Add the following code: (1) USBTMC access code. Write a function Usbtmc_test: Usbtmc_test() /* 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 98 * handle. We will store this handle in defaultRM.*/ status = viOpenDefaultRM (&defaultRM); (status<VI_SUCCESS) printf ("Could not open a session to the VISA Resource Manager!\n"); return status; /* Find all the USB TMC VISA resources in our system and store the number of resources in the system in numInstrs.*/ status = viFindRsrc (defaultRM, "USB?*INSTR", &findList, &numInstrs, instrResourceString);...
  • Page 99 (i> 0) viFindNext (findList, instrResourceString); status = viOpen (defaultRM, instrResourceString, VI_NULL, VI_NULL, &instr); (status<VI_SUCCESS) printf ("Cannot open a session to the device %d.\n", i+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 100 printf ("Error reading a response from the device %d.\n", i+1); else printf ("\nDevice %d: %s\n", i+1, buffer); status = viClose (instr); /** Now we will close the session to the instrument using * viClose. This operation frees all system resources. status = viClose (defaultRM);...
  • Page 101 (2) TCP/IP access code. Write a function TCP_IP_Test: int TCP_IP_Test(char *pIP) 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 102 printf("Error writing to the device.\n"); viClose(defaultRM); status = viScanf(instr, "%t", outputBuffer); (status<VI_SUCCESS) printf("viRead failed with error code: %x \n",status); viClose(defaultRM); else printf ("\nMesseage read from device: %*s\n", 0,outputBuffer); status = viClose (instr); status = viClose (defaultRM); printf("Press 'Enter' to exit."); fflush(stdin);...
  • Page 103: Vb Example

    return The run result: VB Example Environment: Win10 64bit system, Microsoft Visual Basic 6.0 The function of this example: Use National Instruments NI-VISA to control the device with USBTMC and TCP/IP access and perform write and read operations. Follow the steps to complete the example: 1.
  • Page 104 This allows the VISA functions and VISA data types to be used in a program. 3. Add the following code: (1) USBTMC access code. Write a function Usbtmc_test: Private Function Usbtmc_test() As Long ' This code demonstrates sending synchronous read & write commands ' to an USB Test &...
  • Page 105 defaultRM As Long instrsesn As Long numlnstrs As Long findList As Long retCount As Long status As Long instrResourceString As String * VI_FIND_BUFLEN Buffer As String * MAX_CNT Dim i As Integer ' First we must call viOpenDefaultRM to get the manager ' handle.
  • Page 106 ' Now we will open VISA sessions to all USB TMC instruments. ' We must use the handle from viOpenDefaultRM and we must ' also use a string that indicates which instrument to open. This ' is called the instrument descriptor. The format for this string ' can be found in the function panel by right clicking on the ' descriptor parameter.
  • Page 107 End If ' Now we will attempt to read back a response from the device to ' the identification query that was sent. We will use the viRead ' function to acquire the data. ' After the data has been read the response is displayed. status = viRead(instrsesn, Buffer, MAX_CNT, retCount) (status <...
  • Page 108 status As Long count As Long ' 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 Exit Function End If ' Now we will open a session via TCP/IP device status = viOpen(defaultRM, "TCPIP0::"...
  • Page 109 resultTxt.Text = "read from device:" + outputBuffer End If status = viClose(instrsesn) status = viClose(defaultRM) TCP_IP_Test = 0 End Function (3) Button control code: Private Sub exitBtn_Click() End Sub Private Sub tcpipBtn_Click() stat As Long stat = TCP_IP_Test(ipTxt.Text) (stat < VI_SUCCESS) Then resultTxt.Text = Hex(stat) End If...
  • Page 110 SSG6000A Programming Guide...
  • Page 111: Matlab Example

    MATLAB Example Environment: Win10 64bit system, MATLAB R2021a The function of this example: Use National Instruments NI-VISA to control the device with USBTMC or TCP/IP access and perform write and read operations. Follow the steps to complete the example: 1. Open MATLAB, modify the current directory. In this demo, the current directory is modified to D:\USBTMC_TCPIP_Demo.
  • Page 112 %Send the string "*IDN?",asking for the device's identification. fprintf(vu,'*IDN?'); %Request the data outputbuffer = fscanf(vu); disp(outputbuffer); %Close the VISA object fclose(vu); delete(vu); clear vu; The run result: (2) TCP/IP access code. Write a function TCP_IP_Test: function TCP_IP_test() % This code demonstrates sending synchronous read & write commands % to an TCP/IP instrument using NI-VISA %Create a VISA-TCPIP object connected to an instrument %configured with IP address.
  • Page 113: Labview Example

    vt = visa('ni',['TCPIP0::','10.11.13.212','::INSTR']); %Open the VISA object created fopen(vt); %Send the string "*IDN?",asking for the device's identification. fprintf(vt,'*IDN?'); %Request the data outputbuffer = fscanf(vt); disp(outputbuffer); %Close the VISA object fclose(vt); delete(vt); clear vt; The run result: LabVIEW Example Environment: Win7 32bit system, LabVIEW 2011 SSG6000A Programming Guide...
  • Page 114 The functions of this example: Use National Instruments NI-VISA to control the device with USBTMC and TCP/IP access to perform write and read operations. Follow the steps to complete the example: Open LabVIEW, create a VI file. Add controls. Right-click in the Front Panel interface, select and add VISA resource name, error in, error out and some indicators from the Controls column.
  • Page 115 In this example, the VI opens a VISA session to a USBTMC device, writes a command to the device, and reads back the response. In this example, the specific command being sent is the device ID query. Check with your device manufacturer for the device command set. After all communication is complete, the VI closes the VISA session.
  • Page 116: Socket Examples

    Input the IP address and run the program. 4.2 Socket Examples Python Example Python is an interpreted programming language that lets you work quickly and is very portable. Python has a low-level networking module that provides access to the socket interface. Python scripts can be written for sockets to do a variety of test and measurements tasks.
  • Page 117 Environment: Win10 64bit system, Python v3.6.5 The functions of this example: Opens a socket, sends a query, and closes the socket. It does this loop 10 times. Below is the code of the script: #!/usr/bin/env python #-*- coding:utf-8 –*- #----------------------------------------------------------------------------- # The short script is an example that open a socket, sends a query, # print the return message and closes the socket.
  • Page 118 input('Failed to connect to ip %s!\nPress "Enter" to exit: ' % remote_ip) s.close() sys.exit() return s def SocketQuery(Sock, cmd): try : #Send cmd string Sock.sendall(cmd) time.sleep(1) except socket.error: #Send failed input('Send failed!\nPress "Enter" to exit: ') SocketClose(Sock) sys.exit() reply = Sock.recv(4096) reply = reply.decode() return reply def SocketClose(Sock):...
  • Page 119: Telnet Example

    for i in range(10): qStr = SocketQuery(s, b'*IDN?\n') print (str(count) + ":: " + qStr) count = count + 1 SocketClose(s) input('Press "Enter" to exit') if __name__ == '__main__': main() The run result: Telnet Example Telnet SCPI: Provides the ability to send single SCPI commands from a remote PC to the signal generator using LAN port number 5024.
  • Page 120 How to send single SCPI commands using Telnet: On the remote PC, click Start, then Run cmd Type: telnet <ip address> 5024 A Telnet window with a >> prompt should appear on the remote PC screen. From the SCPI prompt: ...
  • Page 121  To get SCPI prompt again, type open <ip Address> 5024 and press Enter: To close the normal telnet window, type Quit and press Enter.  SSG6000A Programming Guide...
  • Page 123 DC power supplies, electronic loads and other general purpose test instrumentation. Since its first oscilloscope was launched in 2005, SIGLENT has become the fastest growing manufacturer of digital oscilloscopes. We firmly believe that today SIGLENT is the best value in electronic test & measurement. Headquarters: SIGLENT Technologies Co., Ltd...

Table of Contents