SIGLENT Siglent Programming Guide SDL1000X Programmable DC Electronic Load PG0801X-C01A 2019 SIGLENT TECHNOLOGIES CO.
SIGLENT Copyright and Statement Copyright SIGLENT TECHNOLOGIES CO., LTD. All rights reserved. Trademark Information SIGLENT is registered trademark of SIGLENT TECHNOLOGIES CO., LTD. Statement ● SIGLENT products are protected by patent laws in and outside of the P.R. China. ● SIGLENT reserves the rights to change the specification and price. ● Information in this publication replaces all previous corresponding published material.
SIGLENT Content Copyright and Statement ........................................................................................ 2 1. Programming Overview ...................................................................................... 1 1.1 1.1.1 Install NI-VISA ..................................................................................................... 1 1.1.2 Connect the Instrument ..................................................................................... 3 1.2 2. 3.
SIGLENT 4. 3.3.10 Source OPPT Subsystem Command ................................................................. 37 3.3.11 Source Program Subsystem Command ............................................................ 40 3.3.12 Source Wave Subsystem Command ................................................................. 45 3.3.13 Source Utility Subsystem Command ................................................................ 47 3.4 Subsystem Command.............................................
SIGLENT 1. Programming Overview This chapter introduces how to build communication between the instrument and the PC. It also introduces how to configure a system for remote instrument control. By using USB and LAN interfaces, in combination with NI-VISA and programming languages, users can remotely control the instruments. Through LAN interface, VXI-11, Sockets and Telnet protocols can be used to communicate with the instruments. 1.1 Establishing Communications 1.1.
SIGLENT b. Click Unzip, the installation process will automatically launch after unzipping files. If your computer needs to install .NET Framework 4, it may auto start. c. The NI-VISA installing dialog is shown above. Click Next to start the installation process. d. Set the install path, default path is “C:\Program Files\National Instruments\”, you can change it. Click Next, dialog shown as above.
SIGLENT e. 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: f. Click Next to begin installation. g. Now the installation is complete. Reboot your PC. 1.1.2 Connect the Instrument Depending on the specific model, your electronic load may be able to communicate with a PC through the USB or LAN interface.
SIGLENT cable. Assuming your PC is already turned on, turn on your electronic load, and then the PC will display the “Device Setup”screen as it automatically installs the device driver as shown below. Wait for the installation to complete and then proceed to the next step. 1.2 Remote Control 1.2.1 User-defined Programming Users can use SCPI commands via a computer to program and control the electronic load. For details, refer to the introductions in "Programming Examples". 1.2.
SIGLENT 2.2 Symbol Instruction The following four symbols are not the content of SCPI commands and can not be sent with the commands, but are usually used in the commands. 1、Triangle Brackets < > The parameter in the triangle brackets can be ignored.When parameter is ignored, the instrument will set parameter to its default. For example: In the“[:SOURce]:BATTery:LEVel ”command in“:SOURce:BATTery: LEVel 4”.
SIGLENT 1、Boolean The parameters in the commands could be “OFF”, “ON”, “0” or “1”. For example: [:SOURce]:SHORt[:STATe] {ON | OFF | 0 | 1} 2、Enumeration The parameter could be any of the values listed. For example: [:SOURce]:FUNCtion {CURRent | VOLTage | POWer | RESistance | LED} The parameter is “CURRent”、 “VOLTage”、 “POWer”、 “RESistance”、 “LED” 3、Integer All parameters expressed by and are integer. It can be any integer within the effective value range.
SIGLENT written completely. For example: :SOURce:CURRent:SLEW:POSitive? Can be abbreviated to: :SOUR:CURR:SLEW:POS? 2.5 Special instructions 1、 When sets the current range,if is greater than 5, the current range will be set to 30A; if is less than 5, the current range will be set to 5A. 2、 When sets the voltage range,if is greater than 36, the voltage range will be set to 150V; if is less than 36, the voltage range will be set to 36V.
SIGLENT 3. System Commands 3.1 IEEE Common Subsystem Commands Command Format Description Example Response Command Format Description Example Command Format Description Example Command Format Description Example Command Format Description Example Response Command Format Description Example *IDN? Returns an instrument identification information string. The string will contain the manufacturer, model number, serial number and software number. *IDN? Siglent\sTechnologies,SDL1020X,0123456789,1.01.01.15.
SIGLENT Response 0 Command Format *OPC Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Response Command Format Description Example Response Set bit 0 in the standard event status register to “1” when all operations have finished. *OPC *OPC? Query whether the current operation has been finished. Returns a “1” if the operation is complete.
SIGLENT Command Format Description Example 3.2 *WAI This command causes the instrument to wait until all pending commands are completed before executing any additional commands.
SIGLENT Command Format Description Example Response 3.3 MEASure:WAVEdata? {CURRent | VOLTage | POWer | RESistance} Gets the waveform data of the waveform display interface in CC/CV/CP/CR mode. Totally include 200 float data . MEASure:WAVEdata? VOLTage 3.947389,3.928473,3.197493,3.573992… Source Subsystem Command 3.3.
SIGLENT Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Response Command Format Description Example Response :SOURce:FUNCtion:TRANsient VOLTage [:SOURce]:FUNCtion:TRANsient? Query current mode in transient operation.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description [:SOURce]:CURRent[:LEVel][:IMMediate]? Query the preset current value of CC mode in static operation. :SOURce:CURRent:LEVel:IMMediate? 2.674 [:SOURce]:CURRent:IRANGe Sets the current range of CC mode in static operation.
SIGLENT Format Description Example Response Query the rise slope of CC mode in static operation.s :SOURce:CURRent:SLEW:POSitive? 0.498 Command Format Description Example [:SOURce]:CURRent:SLEW:NEGative { | MINimum | MAXimum | DEFault} Sets the descending slope of CC mode in static operation. :SOURce:CURRent:SLEW: NEGative 1.
SIGLENT Format Description Example Command Format Description Example Response Sets the voltage range of CC mode in transient operation. :SOURce:CURRent:TRANsient:VRANGe 80 [:SOURce]:CURRent:TRANsient:VRANGe? Query the voltage range of CC mode in transient operation. :SOURce:CURRent:TRANsient:VRANGe? 150 Command Format Description Example [:SOURce]:CURRent:TRANsient:ALEVel { | MINimum | MAXimum | DEFault} Sets the A Level of CC mode in transient operation. :SOURce:CURRent:TRANsient:ALEVel 4.
SIGLENT Description Example Response Command Format Description Example Command Format Description Query the A Level pulse width time value of CC mode in transient operation. Its unit is “s” :SOURce:CURRent:TRANsient:AWIDth? 1.000 [:SOURce]:CURRent:TRANsient:BWIDth { | MINimum | MAXimum | DEFault} Sets the B Level pulse width time value of CC mode in transient operation. Its unit is “s” :SOURce:CURRent:TRANsient:BWIDth 0.
SIGLENT 3.3.3 Source Voltage Subsystem Command Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example [:SOURce]:VOLTage[:LEVel][:IMMediate] { | MINimum | MAXimum | DEFault} Sets the preset voltage value of CV mode in static operation. :SOURce:VOLTage:LEVel:IMMediate 3.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response [:SOURce]:VOLTage:TRANsient:MODE? Query the waveform mode of CV mode in static operation. :SOURce:VOLTage:TRANsient:MODE? PULSe [:SOURce]:VOLTage:TRANsient:IRANGe Sets the current range of CV mode in transient operation.
SIGLENT Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response MAXimum | DEFault} Sets the B Level of CV mode in transient operation. :SOURce:VOLTage:TRANsient:BLEVel MAXimum [:SOURce]: VOLTage:TRANsient:BLEVel? Query the B Level of CV mode in transient operation. :SOURce: VOLTage:TRANsient:BLEVel? 10.
SIGLENT Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Sets the preset power value of CP mode in static operation. :SOURce:POWer:LEVel:IMMediate 3.000 [:SOURce]:POWer[:LEVel][:IMMediate]? Query the preset power value of CP mode in static operation.
SIGLENT Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example PULSe [:SOURce]:POWer:TRANsient:IRANGe Sets the current range of CP mode in transient operation.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response [:SOURce]:POWer:TRANsient:BLEVel? Query the B Level of CP mode in transient operation. :SOURce:POWer:TRANsient:BLEVel? 10.000 [:SOURce]: POWer:TRANsient:AWIDth { | MINimum | MAXimum | DEFault} Sets the A Level pulse width time value of CP mode in transient operation.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command [:SOURce]:RESistance[:LEVel][:IMMediate]? Query the preset resistor value of CR mode in static operation. :SOURce:RESistance:LEVel:IMMediate? 4.
SIGLENT Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description PULSe | TOGGle} Sets the waveform mode of CR mode in transient operation. :SOURce:RESistance:TRANsient:MODE TOGGle [:SOURce]:RESistance:TRANsient:MODE? Query the waveform mode of CR mode in static operation.
SIGLENT Example Response :SOURce:RESistance:TRANsient:VRANGe? LOW Command Format Description Example [:SOURce]:RESistance:TRANsient:ALEVel { | MINimum | MAXimum | DEFault} Sets the A Level of CR mode in transient operation.
SIGLENT Description Example Command Format Description Example Response Sets the B Level pulse width time value of CR mode in transient operation. Its unit is “s”. :SOURce:RESistance:TRANsient:BWIDth 0.800 [:SOURce]:RESistance:TRANsient:BWIDth? Query the B Level pulse width time value of CR mode in transient operation. Its unit is “s”. :SOURce:RESistance:TRANsient:BWIDth? 1.500 3.3.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response [:SOURce]:LED:VOLTage? Query the “Vo” preset voltage of LED mode in static operation. :SOURce:LED: VOLTage? 60.000 [:SOURce]:LED:CURRent {< value > | MINimum | MAXimum | DEFault} Sets the “Io” preset current of LED mode in static operation.
SIGLENT Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response [:SOURce]:BATTery:MODE {CURRent | POWer | RESistance} Sets CC/CP/CR mode in BATTERY function. :SOURce:BATTery:MODE POWer [:SOURce]:BATTery:MODE? Query the current mode in BATTERY function.
SIGLENT Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Query the resistor range in BATTERY function. :SOURce:BATTery:IRANGe? MIDDLE [:SOURce]:BATTery:LEVel Sets the preset discharging value in BATTERY CC/CR/CP mode. :SOURce:BATTery:LEVel 5.
SIGLENT Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Sets the cut-off discharging time value in BATTERY function. :SOURce:BATTery:TIMer DEFault [:SOURce]:BATTery:TIMer? Query the cut-off discharging time value in BATTERY function. :SOURce:BATTery:TIMer? 999.
SIGLENT Command Format Description Example Response Command Format Description Example Response Command Format Description Example Response [:SOURce]:BATTery:TIMer:STATe? Query whether the discharging time is the terminating condiation in BATTERY function. :SOURce:BATTery: TIMer:STATe? 1 [:SOURce]:BATTery:DISCHArg:CAPability? Gets the discharging capacity after user start the BATTERY test.
SIGLENT Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Query the current range in LIST function. :SOURce:LIST:IRANGe? 30 [:SOURce]:LIST:VRANGe Sets the voltage range in LIST function.
SIGLENT Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Sets the execution of steps in LIST function. :SOURce:LIST: STEP 5 [:SOURce]:LIST:STEP? Query the execution of steps in LIST function.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description Example Response [:SOURce]:LIST:WIDth? Query the run time of the step which is set in this command in LIST sequence. :SOURce:LIST:WIDth? 5 0.100 [:SOURce]:LIST:STATe:ON Enter the LIST function of the eclectronic load. :SOURce:LIST:STATe:ON [:SOURce]:LIST:STATe? Query whether the electronic load is in LIST test mode. :SOURce:LIST:STATe? 0.100 3.3.
SIGLENT Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example :SOURce:OCP:IRANGe? 5 [:SOURce]:OCP:VRANGe Sets the voltage range in OCPT function. :SOURce:OCP:VRANGe 36 [:SOURce]:OCP:VRANGe? Query the voltage range in OCPT function.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description [:SOURce]:OCP:STEP:DELay? Query the delay time of each step in OCPT function. :SOURce:OCP:STEP:DELay? 2.000 [:SOURce]:OCP:END {< value > | MINimum | MAXimum | DEFault} Sets the stop current in OCPT function. :SOURce:OCP: END 5.
SIGLENT Example Response function. :SOURce:OCP: MAX? 8.000 Command Format Description Example [:SOURce]:OCP:VOLTage {< value > | MINimum | MAXimum | DEFault} Sets the protection voltage in OCPT function. :SOURce:OCP: VOLTage 8.000 Command Format Description Example Response [:SOURce]:OCP:VOLTage? Query the value of the protection voltage in OCPT function. :SOURce:OCP: VOLTage? 10.000 3.3.
SIGLENT Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example [:SOURce]:OPP:VRANGe Sets the voltage range in OPPT function. :SOURce:OPP:VRANGe 36 [:SOURce]:OPP:VRANGe? Query the voltage range in OPPT function.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description [:SOURce]:OPP:STEP:DELay? Query the delay time of each step in OPPT function. :SOURce:OPP:STEP:DELay? 2.000 [:SOURce]:OPP:END {< value > | MINimum | MAXimum | DEFault} Sets the stop power value in OCPT function. :SOURce:OPP: END 5.000 [:SOURce]:OPP:END? Query the stop power value in OPPT function.
SIGLENT Command Format Description Example Command Format Description Example Response [:SOURce]:OPP:VOLTage {< value > | MINimum | MAXimum | DEFault} Sets the protection voltage in OPPT function. :SOURce:OPP: VOLTage 8.000 [:SOURce]:OPP:VOLTage? Query the value of the protection voltage in OPPT function. :SOURce:OPP: VOLTage? 10.000 3.3.
SIGLENT Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Sets the current range of the step which is set in this command in PROGRAM test list. :SOURce:PROGram:IRANGe 4,5 [:SOURce]:PROGram:IRANGe? Query the current range of the step which is set in this command in PROGRAM test list.
SIGLENT Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Whether set the step of the electronic load which is set in this command to be short circuit in PROGRAM test list. :SOURce:PROGram: SHORt 3,ON [:SOURce]:PROGram:SHORt? Query Whether the step of the electronic load which is set in this command is short circuit in PROGRAM test list.
SIGLENT Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description PROGRAM test list. Its unit is “s” :SOURce:PROGram:TIME:OFF 4,0.500 [:SOURce]:PROGram:TIME:OFF? Query the unloading time of the step which is set in this command in PROGRAM test list. Its unit is “s” :SOURce:PROGram:TIME:OFF? 6 2.
SIGLENT Description Example Command Format Description Example Response Command Format Description Example Command Format Description Sets the maximum allowed value of the step which is set in this command in PROGRAM test list. The value is current value in CV and is voltage value in CC/CR/CP/LED. :SOURce:PROGram: MAX 2,10.000 [:SOURce]:PROGram:MAX? Query the minimum allowed value of the step which is set in this command in PROGRAM test list.
SIGLENT Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example Response [:SOURce]:PROGram:LED:RCOnf | MINimum | MAXimum | DEFault}> Sets the “Rco” value of the step which is set in this command in PROGRAM function when the step is in LED mode. :SOURce:PROGram: LED: RCOnf 6,0.
SIGLENT Command Format Description [:SOURce]:WAVE:TIME? Query the window time in Waveform Display Function. Its unit is “s” Example Response :SOURce:WAVE:TIME? 3600 Command Format Description [:SOURce]:WAVE:MODE {CURRent | VOLTage | POWer | RESistance } Sets different data type include I, U, R and P displayed in Waveform Display Function.
SIGLENT Command Format Description Example Response [:SOURce]:WAVE:DISPlay? Query whether the electronic load is in Waveform Display Function. :SOURce:WAVE:DISPlay? ON 3.3.13 Source Utility Subsystem Command Command Format Description Example Command Format Description Example Response Command Format Description Example Command Format Description Example Response Command Format Description Example [:SOURce]:VOLTage[:LEVel]:ON Sets the breakover voltage of electronic load.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description [:SOURce]: EXT:INPUT [:STATe]? Query whether the external control switch of the electronic load is enabled. :SOURce: EXT:INPUT:STATe? 0 [:SOURce]:CURRent:PROTection:STATe {ON | OFF | 0 | 1} Sets whether enable the current protection switch of the electronic load.
SIGLENT Command Format Description Example Response Command Format Description Example Command Format Description [:SOURce]:CURRent:PROTection:DELay? Query the delay time of the current protection of the electronic load. :SOURce:CURRent:PROTection:DELay? 3.000 [:SOURce]:POWer:PROTection:STATe {ON | OFF | 0 | 1} Sets whether enable the power protection switch of the electronic load.
SIGLENT Command Format [:SOURce]:POWer:PROTection:DELay? Description Query the delay time of the power protection of the electronic load. Example Response :SOURce:POWer:PROTection:DELay? 3.000 3.4 Subsystem Command Command Format Description Example SYSTem:SENSe[:STATe] {ON | OFF | 0 | 1} Sets whether enable the Sense function switch of the electronic load.
SIGLENT Description Example Sets whether enable the voltage monitoring terminal switch of the electronic load. SYSTem:VMONItor:STATe OFF Command Format SYSTem: VMONItor [:STATe]? Description Query whether the voltage monitoring terminal switch of the electronic load is enabled. Example Response SYSTem: VMONItor:STATe? 1 Command Format Description Example STOP:ON:FAIL[:STATe] {ON | OFF | 0 | 1} Sets whether stop the PROGRAM test when test step is failed.
SIGLENT Command Format Description Example SENSe:AVERage:COUNt {6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14} Sets the average point number of the read-back current and voltage of the electronic load. The value is the index of “2”. SENSe:AVERage:COUNt 10 Command Format SENSe:AVERage:COUNt? Description Query the average point number of the read-back current and voltage of the electronic load.
SIGLENT Command Format Description Example EXT:VRANGe Sets the voltage range in external sink mode of the electronic load. EXT:VRANGe 36 Command Format EXT:VRANGe? Description Query the voltage range in external sink mode of the electronic load. Example Response EXT:VRANGe? 150 Command Format Description Example TIME:TEST[:STATe] {ON | OFF | 0 | 1} Sets whether enable the time measurement switch.
SIGLENT Command Format Description Example TIME:TEST:VOLTage:HIGH {< value > | MINimum | MAXimum | DEFault} Sets the V_High voltage in the time measurement function (SLMT). TIME:TEST:VOLTage: HIGH 10.000 Command Format TIME:TEST:VOLTage:HIGH? Description Query the V_High voltage in the time measurement function (SLMT). Example Response TIME:TEST:VOLTage: HIGH? 150.00 Command Format TIME:TEST:RISE? Description Query the voltage rise time in the time measurement function (SLMT).
SIGLENT Command Format Description Example DHCP {ON | OFF | 0 | 1} Sets whether enable the DHCP switch of the electronic load. DHCP ON Command Format DHCP? Description Query whether the DHCP switch of the electronic load is enabled Example Response DHCP? 1 Command Format Description Example LAN:IPADdress Sets IP address of the electronic load when DHCP is disabled. LAN:IPADdress 10.12.15.64 Command Format LAN:IPADdress? Description Query the IP address of the electronic load.
SIGLENT Description Example Sets the gateway of the electronic load when DHCP is disabled. LAN: GATeway 10.11.13.1 Command Format LAN:GATeway? Description Query the subnet mask of the electronic load. Example Response LAN: GATeway? 10.12.16.1 Command Format LAN:MAC? Description Query the MAC address of the electronic load. Example Response LAN:MAC? 00.80.e1.00.00.
SIGLENT 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 spectrum analyzer. By following these examples, you can develop many more applications. 4.1 Examples of Using VISA 4.1.
SIGLENT 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.
SIGLENT Include visa.h file: In the projectname.cpp file: #include 3、Add codes: (1)USBTMC access code. Write a function Usbtmc_test: int 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.
SIGLENT /***********************************************************/ ViSessiondefaultRM; ViSessioninstr; ViUInt32numInstrs; ViFindListfindList; ViStatus status; char instrResourceString[VI_FIND_BUFLEN]; unsigned char buffer[100]; int i; /** First we must call viOpenDefaultRM to get the manager * handle. We will store this handle in defaultRM.*/ status=viOpenDefaultRM (&defaultRM); if (status
SIGLENT * 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. After opening a session to the * 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.
SIGLENT continue; } /** Now we will attempt to read back a response from the device to * the identification query that was sent. We will use the viScanf * function to acquire the data. * After the data has been read the response is displayed.*/ status = viScanf(instr, "%t", buffer); if (status
SIGLENT (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); if (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::"; char tail[] ="::INSTR"; char re
SIGLENT { printf("viRead failed with error code: %x \n",status); viClose(defaultRM); }else printf ("\ndata read from device: %*s\n", 0,outputBuffer); status = viClose (instr); status = viClose (defaultRM); return 0; } 4.1.2 Example of VB Environment: Win7 32bit system, Microsoft Visual Basic 6.0 The function of this example: Use the NI-VISA, to control the device with USBTMC and TCP/IP access to do a write and read.
SIGLENT (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 & 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.
SIGLENT Debug.Print "Could not open a session to the VISA Resource Manager!" Usbtmc_test = status Exit Function End If ' 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, numlnstrs, instrResourceString) If (status < VI_SUCCESS) Then Debug.Print "An error occurred while finding resources.
SIGLENT instrsesn) If (status < VI_SUCCESS) Then Debug.Print "Cannot open a session to the device ", i + 1 GoTo NextFind End If ' At this point we now have a session open to the USB TMC instrument. ' We will now use the viWrite function to send the device the string "*IDN?", ' asking for the device's identification. status = viWrite(instrsesn, "*IDN?", 5, retCount) If (status < VI_SUCCESS) Then Debug.Print "Error writing to the device.
SIGLENT ' viClose. This operation frees all system resources. status = viClose(defaultRM) Usbtmc_test = 0 End Function (2)TCP/IP access code: Write a function TCP_IP_Test. Private Function TCP_IP_Test(ip As String) As Long Dim outputBuffer As String * VI_FIND_BUFLEN Dim defaultRM As Long Dim instrsesn As Long Dim status As Long Dim count As Long ' First we will need to open the default resource manager. status = viOpenDefaultRM (defaultRM) If (status < VI_SUCCESS) Then Debug.
SIGLENT End If status = viWrite(instrsesn, "*IDN?", 5, count) If (status < VI_SUCCESS) Then Debug.Print "Error writing to the device." End If status = viRead(instrsesn, outputBuffer, VI_FIND_BUFLEN, count) If (status < VI_SUCCESS) Then Debug.Print "Error reading a response from the device.", i + 1 Else Debug.Print "read from device:", outputBuffer End If status = viClose(instrsesn) status = viClose(defaultRM) TCP_IP_Test = 0 End Function 4.1.
SIGLENT %Open the VISA object created fopen(vu); %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; end 2)TCP/IP access code.
SIGLENT column. 3、 Open the Block Diagram interface. Right-click on the VISA resource name and you can select and add the following functions from VISA Palette from the pop-up menu: VISA Write, VISA Read, VISA Open and VISA Close. 4、 Connect them as shown in the figure below 5、Select the device resource from the VISA Resource Name list box and run the program. In this example, the VI opens a VISA session to a USBTMC device, writes a command to the device, and reads back the response.
SIGLENT need to change VISA Write and VISA Read Function to Synchronous I/O. The LabVIEW default is asynchronous I/O. Right-click the node and select Synchronous I/O Mod>>Synchronous from the shortcut menu to write or read data synchronously. 7、 Connect them as shown in the figure below 8、 Input the IP address and run the program.