SIGLENT SDG Series Programming Manual

SIGLENT SDG Series Programming Manual

Function/ arbitrary waveform generator
Hide thumbs Also See for SDG Series:

Advertisement

Quick Links

Programming Guide
Programming Guide
SDG Series
Function/Arbitrary
Waveform Generator
2016 SIGLENT TECHNOLOGIES CO., LTD
1

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Summary of Contents for SIGLENT SDG Series

  • Page 1 Programming Guide Programming Guide SDG Series Function/Arbitrary Waveform Generator 2016 SIGLENT TECHNOLOGIES CO., LTD...
  • Page 2: Table Of Contents

    Programming Guide Catalogue PROGRAMMING OVERVIEW ...................... 4 ......................4 UILD COMMUNICATION 1.1.1 Install NI-VISA ........................4 1.1.2 Connect the instrument ..................... 6 ...................... 7 EMOTE ONTROL 1.2.1 User-defined Programming ....................7 1.2.2 Send SCPI Commands via NI-VISA ..................7 INTRODUCTION TO THE SCPI LANGUAGE ................... 8 &...
  • Page 3 Programming Guide 3.13 ....................35 ONFIGURATION OMMAND 3.14 ....................... 35 UZZER OMMAND 3.15 ......................35 CREEN OMMAND 3.16 ...................... 36 LOCK OURCE OMMAND 3.17 ..................... 36 REQUENCY OUNTER OMMAND 3.18 ........................ 37 NVERT OMMAND 3.19 ......................38 OUPLING OMMAND 3.20 ....................
  • Page 4: Programming Overview

    Programming Guide 1 Programming Overview This chapter introduces build communication between series function/arbitrary waveform generator and the PC. It also introduces how to remote control. 1.1 Build communication 1.1.1 Install NI-VISA Before programming, you need to install NI-VISA, which you can download from the NI-VISA web site.
  • Page 5 Programming Guide iii. The NI-VISA installing dialog is shown above. Click Next to start the installation process. 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, dialog shown as below:...
  • Page 6: Connect The Instrument

    Programming Guide Click Next to run installation. Now the installation is complete, reboot your PC. 1.1.2 Connect the instrument Depending on your specific model your function/arbitrary waveform generator may be able to communicate with a PC through the USB or LAN interface. This manual takes the USB as an example.
  • Page 7: How To Remote Control

    Programming Guide b. Wait for the installation to complete and then proceed to the next step. 1.2 How To Remote Control 1.2.1 User-defined Programming Users can use SCPI commands to program and control the function/arbitrary waveform generator. For details, refer to the introductions in "Programming Examples".
  • Page 8: Introduction To The Scpi Language

    Programming Guide 2 Introduction to the SCPI Language 2.1 About Commands & Queries This section lists and describes the remote control commands and queries recognized by the instrument. All commands and queries can be executed in either local or remote state. Each command or query, with syntax and other information, has some examples listed.
  • Page 9: Table Of Command & Queries

    Programming Guide [ ] Square brackets enclose optional items. … An ellipsis indicates that the items both to its left and right may be repeated for a number of times. 2.6 Table of Command & Queries Short Long Form Subsystem What Command/Query does *IDN *IDN...
  • Page 10 Programming Guide SCSV SCREEN_SAVE SYSTEM Sets or gets screen save state. ROSC ROSCILLATOR SIGNAL Sets or gets state of clock source. FCNT FREQCOUNTER SIGNAL Sets or gets frequency counter parameters. INVT INVERT SIGNAL Sets or gets polarity of current channel. COUP COUPLING SIGNAL...
  • Page 11: Commands And Queries

    Programming Guide 3 Commands and Queries 3.1 IEEE 488.2 Common Command Introduction IEEE standard defines the common commands used for querying the basic information of the instrument or executing basic operations. These commands usually start with "*" and the length of the keywords of the command is usually 3 characters.
  • Page 12: Opc

    Programming Guide Notes: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X <hardware version> 2) Explain for <hardware version>:value1- value2- value3- value4- value5. value1: PCB version. value2: Hardware version. value3: Hardware subversion. value4: FPGA version. value5: CPLD version. 3.1.2 OPC DESCRIPTION The *OPC (Operation Complete) command sets the OPC bit (bit 0) in the standard Event Status Register (ESR).
  • Page 13: Ese

    Programming Guide 3.1.4 ESE DESCRIPTION The *ESE command sets the Standard Event Status Enable register (ESE). This command allows one or more events in the ESR register to be reflected in the ESB summary message bit (bit 5) of the STB register. The *ESE? query reads the contents of the ESE register.
  • Page 14: Rst

    Programming Guide RELATED COMMANDS *CLS, *ESE 3.1.6 RST DESCRIPTION The *RST command initiates a device reset. The *RST recalls the default setup. COMMAND SYNTAX * RST EXAMPLE This example resets the signal generator: *RST 3.1.7 SRE DESCRIPTION The *SRE command sets the Service Request Enable register (SRE).
  • Page 15: Stb

    Programming Guide *SRE 17 3.1.8 STB DESCRIPTION The *STB? query reads the contents of the 488.2 defined status register (STB), and the Master Summary Status (MSS). The response represents the values of bits 0 to 5 and 7 of the Status Byte register and the MSS summary message.
  • Page 16: Wai

    Programming Guide RELATED COMMANDS *CAL Note: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X 3.1.10 DESCRIPTION The *WAI (WAIT to continue) command, requires by the IEEE 488.2 standard, has no effect on the instrument, as the signal generator only starts processing a command when the previous command has been entirely executed.
  • Page 17: Cmr

    Programming Guide External input overload condition detected 6…4 Reserved Reserved Reserved Channel 2 overload condition detected Channel 1 overload condition detected Note: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000x 3.1.12 DESCRIPTION The CMR? query reads and clears the contents of the command error register (CMR) .See the table below which specifies the last syntax error type detected by the instrument.
  • Page 18: Comm_Header Command

    Programming Guide Note: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X 3.2 Comm_Header Command DESCRIPTION This command is used to change the query command returned format. “SHORT” parameter returns short format. “LONG” parameter returns long format. “OFF” returns nothing. COMMAND SYNTAX CHDR (Comm_HeaDeR) <parameter> <parameter>:= {SHORT,LONG,OFF} QUERY SYNTAX CHDR (Comm_HeaDeR)?
  • Page 19 Programming Guide Turn on Turn off Value of load ( LOAD <load> default unit is ohm Value of polarity PLRT <NOR, INVT> parameter < load>:= {please see the note below.} QUERY SYNTAX <channel>: OUTP(OUTPut)? RESPONSE FORMAT <channel>: OUTP <load> EXAMPLE Turn on channel one.
  • Page 20: Basic Wave Command

    Programming Guide 3.4 Basic Wave Command DESCRIPTION Sets or gets basic wave parameters. In SDG1000X if turn on wave combine, you can’t set wave to square. Combining a square waveform is not possible. COMMAND SYNTAX <channel>:BSWV(BaSic_WaVe) <parameter> <channel>:={C1, C2} <parameter>:= {a parameter from the table below} Parameters Value Description...
  • Page 21 Programming Guide switch > is Noise, you can set this parameter. <bandwidth Value of noise bandwidth. Only when wave type is BANDWIDTH value> noise, you can set this parameter. Note: if the command doesn’t set basic wave type, WVPT parameter will be set to current wave type.
  • Page 22: Modulate Wave Command

    Programming Guide OFST,0V,HLEV,1V,LLEV,-1V,PHSE,0 Set noise bandwidth value of channel one to 100MHz C1: BSWV BANDWIDTH, 100000000 Note: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X no(single <channel> channel) RISE BANDSTATE BANDWIDTH 3.5 Modulate Wave Command DESCRIPTION Sets or gets modulation parameters. COMMAND <channel>:MDWV(MoDulateWaVe)<parameter>...
  • Page 23 Programming Guide frequency> source is set to INT, you can set the parameter. FM, SRC <src> FM signal source. FM modulation wave. Only when FM signal FM, MDSP <mod wave shape> source is set to INT, you can set the parameter.
  • Page 24 Programming Guide CARR, FRQ <frequency> Value of carrier frequency. CARR, AMP <amplitude> Value of carrier amplitude. CARR, OFST <offset> Value of carrier offset. Value of carrier symmetry. Only ramp can set CARR, SYM <symmetry> this parameter. Value of duty cycle. Only square and pulse CARR, DUTY <duty>...
  • Page 25 Programming Guide Note: There are some parameters Value depends on the model, You can read version datasheet to get specific parameters QUERY SYNTAX <channel>: MDWV (MoDulateWaVe)? <channel>:={C1, C2} RESPONSE <channel>:MDWV <parameter> FORMAT <parameter> :={ Return all parameter of the current modulation parameters.} EXAMPLE Set channel one modulation type to AM.
  • Page 26: Sweep Wave Command

    Programming Guide Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000x <channel> No(single channel) [type], SRC no(only internal source) CARR, DLY CARR, RISE CARR, FALL [type]:={AM, FM, PM, FSK, ASK, DSBAM, PWM} 3.6 Sweep Wave Command DESCRIPTION Sets or gets sweep parameters. COMMAND SYNTAX <channel>SWWV(SweepWaVe) <parameter>...
  • Page 27 Programming Guide PHSE Note: If carrier is Pulse or Noise you can’t turn on sweep. If you want to set CARR and STATE, the first parameter has to be one of them. where: <state>:= {ON, OFF} <time>:= { Default unit is "S". Value depends on the model.} <stop frequency>...
  • Page 28: Burst Wave Command

    Programming Guide FRQ, 1000HZ, AMP, 4V, OFST, 0V, DUTY, 50, PHSE, 0 Read channel two sweep parameters of which STATE is OFF. C2: SWWV? Return: C2: SWWV STATE, OFF Note: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X no(single <channel> channel) TRMD EDGE 3.7 Burst Wave Command DESCRIPTION...
  • Page 29 Programming Guide EDGE <edge> Value of edge. When carrier is NOISE wave, you can’t set it. When NCYC is chosen and TRSR is set to EXT, you can set it. TIME <circle time> Value of Ncycle number. When carrier is NOISE wave, you can’t set it.
  • Page 30 Programming Guide <wave type>:={SINE ,SQUARE, RAMP, PULSE, NOISE, ARB} <frequency> :={ Default unit is "HZ". Value depends on the model.} <amplitude>:= {Default unit is "V". Value depends on the model.} <offset>:= {Default unit is "V". Value depends on the model.} <duty>:= {0% to 100%.} <symmetry>...
  • Page 31: Parameter Copy Command

    Programming Guide Read channel two burst parameters of which STATE is OFF. C2: BTWV? Return: C2: BTWV STATE, OFF Note: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X no(single <channel> channel) TRMD EDGE CARR, DLY CARR, RISE CARR, FALL 3.8 Parameter Copy Command DESCRIPTION Copies parameters from one channel to another.
  • Page 32 Programming Guide COMMAND SYNTAX <channel> ARWV(ArbWaVe) INDEX,<value1>, NAME,<value2> <channel>:={C1, C2} < value1>: the table below shows what the index number mean.) < value2>: see table below. QUERY SYNTAX <channel>: ARWV (ARbWaVe)? <channel>:={C1, C2} RESPONSE FORMAT <channel>:ARWV <index> EXAMPLE Set StairUp arbitrary wave output by index. C1:ARWV INDEX, 2 Read system current wave.
  • Page 33: Sync Command

    Programming Guide yes(only yes(only INDEX built-in wave) built-in wave) yes(user yes(user NAME define wave) define wave) 3.10 Sync Command DESCRIPTION Sets synchronization signal. COMMAND SYNTAX <channel>: SYNC <parameter> <channel>:={C1, C2} <parameter>:= {ON, OFF} QUERY SYNTAX <channel>: SYNC? <channel>:={C1, C2} RESPONSE FORMAT <channel>:SYNC <parameter>...
  • Page 34: Language Command

    Programming Guide QUERY SYNTAX NBFM (NumBer_ForMat)? RESPONSE FORMAT NBFM <parameter> EXAMPLE Set point format to DOT. NBFM PNT, DOT Set Separator format to ON. NBFM SEPT,ON Read number format. NBFM? Return: NBFM PNT, DOT, SEPT, ON 3.12 Language Command DESCRIPTION Sets or gets system language.
  • Page 35: Configuration Command

    Programming Guide 3.13 Configuration Command DESCRIPTION Sets or gets the power-on system setting.. COMMAND SYNTAX SCFG(Sys_CFG)<parameter> <parameter>:= {DEFAULT, LAST} QUERY SYNTAX SCFG (Sys_CFG)? RESPONSE FORMAT SCFG <parameter> EXAMPLE Set the power-on system setting to LAST. SCFG LAST 3.14 Buzzer Command DESCRIPTION Turns on or off the buzzer.
  • Page 36: Clock Source Command

    Programming Guide EXAMPLE Set screen save time to 5 minutes. SCSV 5 Read the current screen save time. SCreen_SaVe? Return: SCSV 5MIN 3.16 Clock Source Command DESCRIPTION Sets or gets the clock source. COMMAND SYNTAX ROSC (ROSCillator) <parameter> <parameter>:= {INT, EXT} QUERY SYNTAX ROSC (ROSCillator)? RESPONSE FORMAT...
  • Page 37: Invert Command

    Programming Guide <triglev> Value of trigger level. MODE <mode> Value of mode. <HFR> State of HFR. where: < state >:={ON, OFF} <frequency>:= {Default unit is "Hz". Value range depends on the model.} < mode >:={AC, DC} <HFR>:={ON, OFF} QUERY SYNTAX FCNT (FreqCouNTer)? RESPONSE FORMAT FCNT <...
  • Page 38: Coupling Command

    Programming Guide Set C1 ON: C1: INVT ON Read the polarity of channel one. C1: INVT? Return: C1: INVT ON Notes: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X no(single <channel> channel) 2. The <channel> is a selectable parameter. If channel is not set, default is current channel.
  • Page 39: Voltage Overload Command

    Programming Guide < bsch >:= {CH1, CH2} < frq_dev >:={ Default unit is “Hz”, value range depends on the model} < pha_dev >:={ Default unit is “°”value range depends on the model } <fcoup>,<acoup>,<pcoup>:={ON, OFF} <frat>,<prat>,< arat >:={a ratio value. value range depends on the model } <adev>:={ a deviation value.
  • Page 40: Store List Command

    Programming Guide COMMAND SYNTAX VOLTPRT<parameter> <parameter>:= {ON, OFF} QUERY SYNTAX VOLTPRT? RESPONSE FORMAT VOLTPRT<parameter> Note: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X VOLTPRT 3.21 Store List Command DESCRIPTION This command is used to read the stored wave data names if the store unit is empty;...
  • Page 41: Arbitrary Wave Data Command

    Programming Guide M24, Gmonopuls, M25, Tripuls, M26, Cardiac, M27, Quake, M28, Chirp, M29, Twotone, M3, StairDn, M30, SNR, M31, Hamming, M32, Hanning, M33, kaiser, M34, Blackman, M35, Gausswin, M36, Triang, M37, Harris, M38, Bartlett, M39, Tan, M4, StairUD, M40, Cot, M41, Sec, M42, Csc, M43, Asin, M44, Acos, M45, Atan, M46, Acot, M47, Square, M5, Ppulse, M6, Npulse, M7, Trapezia, M8, Upramp, M9, Dnramp Read wave data defined by user.
  • Page 42 Programming Guide FREQ <frequency> Wave frequency. AMPL <amplifier> Wave amplifier. OFST <offset> Wave offset. PHASE <phase> Wave phase. <wave WAVEDATA data> Wave data. QUERY For all the arbitrary wave of SDG800/1000/5000 and the built-in wave of SDG2000X SYNTAX /SDG1000X: WVDT? Mn For SDG2000X / SDG1000X user define wave:...
  • Page 43: Virtual Key Command

    Programming Guide FF\FE\FF\FE\FF\FE\FF\FE\FF\FE\FF\FE\FF\FE\FF\FD\FF\FD\FF\FD\FF\ FD\FF\FD\FF\FD\FF\FD\FF\FD\FF\FC\FF\FC\FF\FC\FF\FC\FF\FC\FF\FC\ FF\FC\FF\FC\FF\FA\FF\FA\FF\FA\FF\FA\FF\FA\FF\FA\FF\FA\FF\FA\FF\ F9\FF\F9\FF\F9\FF\F9\FF\F9\FF\F9\FF\F9\FF\F9\FF\F8\FF\F8\FF\F8\ FF\F8\FF\F8\FF\F8\FF\F8\FF\F8\FF\F7\FF\F7\FF\F7\FF\F7\FF\F7\FF\ F7\FF\F7\FF\F7\FF\F6\FF\F6\FF\F6\FF\F6\FF\F6\FF\F6\FF\F6\FF\F6\ FF\F6\FF\F6\FF\F6\FF\F6\FF\F6\FF\F6\FF\F6\FF\F6\FF\F5\FF\F5\FF\ …… Note: Parameter/comm SDG1000X SDG800 SDG1000 SDG2000X SDG5000 (0<=n<=59): (0<=n<=59): (0<=n<=196): (0<=n<=68): (0<=n<=196): M0~M49: M0~M49: M0~M196: all M0~M35: build M0~M196: build build of them are in wave (32KB). them wave wave building M36~M59: building...
  • Page 44: Ip Command

    Programming Guide KB_FUNC5 KB_NUMBER_8 KB_FUNC6 KB_NUMBER_9 KB_SINE KB_POINT KB_SQUARE KB_NEGATIVE KB_ RAMP KB_LEFT KB_PULSE KB_RIGHT KB_NOISE KB_UP KB_ARB KB_DOWN KB_MOD KB_OUTPUT1 KB_SWEEP KB_OUTPUT2 KB_BURST KB_KNOB_RIGHT KB_WAVES KB_KNOB_LEFT KB_UTILITY KB_KNOB_DOWN KB_PARAMETER KB_HELP KB_STORE_RECALL KB_CHANNEL KB_NUMBER_0 KB_NUMBER_1 KB_NUMBER_2 KB_NUMBER_3 Note: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X...
  • Page 45: Subnet Mask Command

    Programming Guide <parameter1>:={a integer value between 1 and 223} <parameter2>:={a integer value between 0 and 255} <parameter3>:={a integer value between 0 and 255} <parameter4>:={a integer value between 0 and 255} QUERY SYNTAX SYST:COMM:LAN:IPAD (SYSTem:COMMunicate:LAN:IPADdress)? EXAMPLES Set IP address to 10.11.13.203 SYSTem: COMMunicate: LAN:IPADdress 10.11.13.203 Get IP address.
  • Page 46: Gateway Command

    Programming Guide Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X SYST:COMM:LAN:SMAS 3.26 Gateway Command DESCRIPTION The Command can set and get system Gateway. COMMAND SYNTAX SYST:COMM:LAN:GAT(SYSTem:COMMunicate:LAN:GATeway) <parameter1>.<parameter2>.<parameter3>.<parameter4> <parameter1>:={a integer value between 0 and 223} <parameter2>:={a integer value between 0 and 255} <parameter3>:={a integer value between 0 and 255} <parameter4>:={a integer value between 0 and 255} QUERY SYNTAX SYSTem:COMMunicate:LAN:GATeway?
  • Page 47: Harmonic Command

    Programming Guide QUERY SYNTAX <channel>: SRATE? EXAMPLES Get the channel one sample rate value C1: SRATE? Return: C1: SRATE MODE, DDS Set channel one to TureArb mode. C1: SRATE MODE, TARB Set channel one sample rate value to 1000000Sa/s. C1: SRATE VALUE, 1000000 Note: Parameter/command SDG800...
  • Page 48: Waveform Combining Command

    Programming Guide C1: HARM? Return: C1:HARM HARMSTATE, ON,HARMTYPE, EVEN,HARMORDER, 2, HARMAMP, 0V, HARMPHASE, 0 Note: Parameter/command SDG800 SDG1000 SDG2000X SDG5000 SDG1000X HARM 3.29 Waveform Combining Command DESCRIPTION Sets or gets waveform combining information. The command can be used by SDG2000X/SDG1000X. COMMAND SYNTAX <channel>:CMBN (CoMBiNe) <parameter>...
  • Page 49: Programming Examples

    Programming Guide 4 Programming Examples This chapter gives some examples for the programmer. In these examples you can see how to use the NI-VISA lib and the commands which have been described before this chapter to control our devices. By the examples’ guide, you can develop more functions application as you want.
  • Page 50 Programming Guide 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. file:project---properties---Linker---Command Line---Additional Options:...
  • Page 51 Programming Guide /* 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. /* The general flow of the code is */ Open Resource Manager Open VISA Session to an Instrument...
  • Page 52 Programming Guide 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); if (status<VI_SUCCESS) printf ("An error occurred while finding resources.\nHit enter to continue."); fflush(stdin);...
  • Page 53 Programming Guide 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 54 Programming Guide system("pause"); // pause to keep off the console flashed. return 0; Result: 3.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; ViUInt32 count; ViUInt16 portNo; /* First we will need to open the default resource manager. */ status = viOpenDefaultRM (&defaultRM);...
  • Page 55: Example Of Vb

    Programming Guide status = viOpen (defaultRM, head, VI_LOAD_CONFIG, VI_NULL, &instr); if (status<VI_SUCCESS) printf ("An error occurred opening the session\n"); viClose(defaultRM); status = viPrintf(instr, "*idn?\n"); status = viScanf(instr, "%t", outputBuffer); if (status<VI_SUCCESS) printf("viRead failed with error code: %x \n",status); viClose(defaultRM); }else printf ("\ndata read from device: %*s\n", 0,outputBuffer);...
  • Page 56 Programming Guide Follow the steps to complete the example: Open Visual Basic, build a standard application program project (Standard EXE) Set the project environment to use the NI-VISA lib, Click the Existing tab of Project>>Add Existing Item. Search for the visa32.bas file in the include folder under the NI-VISA installation path and add the file.
  • Page 57 Programming Guide Dim defaultRM As Long Dim instrsesn As Long Dim numlnstrs As Long Dim findList As Long Dim retCount As Long Dim writeCount As Long Dim status As Long Dim instrResourceString As String * VI_FIND_BUFLEN Dim Buffer As String * MAX_CNT Dim i As Integer ' First we must call viOpenDefaultRM to get the manager ' handle.
  • Page 58 Programming Guide ' 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 59 Programming Guide 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) If (status <...
  • Page 60 Programming Guide ' First we will need to open the default resource manager. status = viOpenDefaultRM(defaultRM) If (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 61 Programming Guide status = viClose(defaultRM) TCP_IP_Test = 0 End Function 3.3、Button control code: Private Sub exitBtn_Click() End Sub Private Sub tcpipBtn_Click() Dim stat As Long stat = TCP_IP_Test(ipTxt.Text) If (stat < VI_SUCCESS) Then resultTxt.Text = Hex(stat) End If End Sub Private Sub usbBtn_Click() Dim stat As Long stat = Usbtmc_test...
  • Page 62: Example Of Matlab

    Programming Guide 4.3 Example of MATLAB Environment: Win7 32bit system, MATLAB R2010b The function of this example: Use the NI-VISA, to control the device with USBTMC or TCP/IP access to do a write and read. Follow the steps to complete the example: Open MATLAB, modify the current directory.
  • Page 63 Programming Guide %Request the data outputbuffer = fscanf(vu); disp(outputbuffer); %Close the VISA object fclose(vu); delete(vu); clear vu; 1.2 TCP/IP access code. Write a function TCP_IP_Test: function TCP_IP_test( IPstr ) % 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 64: Example Of Labview

    Programming Guide fclose(vt); delete(vt); clear vt; 4.4 Example of LabVIEW Environment: Win7 32bit system, LabVIEW 2011 The functions of this example: use the NI-VISA, to control the device with USBTMC and TCP/IP access to do a write and read. Follow the steps to complete the example: 1、...
  • Page 65 Programming Guide 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.
  • Page 66 Programming Guide Note: you can obtain the source code of above examples, please visit SIGLENT website at www.siglent.com.
  • Page 67: Index

    Programming Guide 5 Index *IDN *CLS *ESE *ESR *RST *SRE *STB *TST *WAI ARWV ARBWAVE BSWV BASIC_WAVE BTWV BURSTWAVE BUZZ BUZZER CHDR COMM_HEADER COUP COUPLING CMBN COMBINE FCNT FREQCOUNTER HARM HARMONIC IVNT INVERT LAGG LANGUAGE MDWV MODULATEWAVE...
  • Page 68 Programming Guide NBFM NUMBER_FORMAT OUTP OUTPUT PACP PARACOPY ROSC ROSCILLATOR SCFG Sys_CFG SCSV SCREEN_SAVE SWWV SWEEPWAVE SYNC SYNC STORELIST SYST:COMM:LAN:IPAD SYSTEM:COMMUNICATE:LAN:IPADDRESS SYST:COMM:LAN:SMAS SYSTem:COMMunicate:LAN:SMASk SYST: COMM: LAN:GAT SYSTem:COMMunicate:LAN:GATeway SRATE SAMPLERATE WVDT WVDT VOLTPRT VOLTPRT VKEY VIRTUALKEY...

Table of Contents

Save PDF