How do you find the proper communication TCP/IP port number for Rigol DG-1022z? - Page 1
Forum section: electronics / testgear

author: Ben321
author_rank: Frequent Contributor
timestamp: February 11, 2024, 05:06:18 am
content: Ok so I have my DG-1022z connected by ethernet cable to my laptop, and I want to control it without installing the massive framework that comes with NI software. Even for controlling just one device you have to install an entire set of NI drivers for tons of devices. Even if you just download the official Ultra Sigma software, running the installer adds in a ton of NI bloatware (like drivers for every possible device that Rigol makes), with no chance to select just the driver(s) for the device(s) you plan to use. At least that's the situation for the USB connection. As much as I'd like the convenience of operating my DG-1022z as a USB device (so I don't need to waste an Ethernet port), I don't like that Rigol depends exclusively on NI software and driver framework, and doesn't bother to write their own Rigol drivers that you can install by themselves (one for each device that Rigol makes). So to avoid wasting several gigabytes of harddrive space, I've decided to not go with the USB connectivity, and instead go for Ethernet connection.Fortunately the official Rigol programming guide athttps://beyondmeasure.rigoltech.com/acton/attachment/1579/f-0493/1/-/-/-/-/DG1000Z%20Programming%20Guide.pdfgives me every command I'll need to use. Unfortunately, neither this nor any other document I can find tells me what the TCP/IP port number is for sending commands to the DG-1022z. Even the onscreen display on the device itself, when viewing the LAN settings, doesn't show a port number. Instead, the closest thing it shows is a string intended for use with NI VISA drivers (the name of the field is even "VISA" on the onscreen display). The string in question says TCPIP0::192.168.1.1::INSTR and this doesn't tell me at all what the port number is. What I can gather from it is that it's using TCP/IP as the protocol, 192.168.1.1 as the IP address, and that this is for controlling the instrument (it abbreviates it as INSTR). No mention of the port numbers. Apparantly, Rigol intends not only the USB connection to be dependent on NI bloatwear, but also even the TCP/IP connection to be dependent on NI bloatwear. And that's despite the fact that they provide a list of all the commands that can be used in the programming guide, so all you really would need would be to write your own software for sending these commands over TCP/IP (which is a trivial matter, as Windows itself provides API functions for sending data over network sockets), if you could find your device's TCP/IP port number. And that's a big if, as Rigol seems to want to hide it from the end user, as if it were some kind of trade secret.If anybody else can tell me where to discover my device's port number, I'd be really happy to know.

author: JDubU
author_rank: Frequent Contributor
timestamp: February 11, 2024, 06:27:23 am
content: The SCPI command port number for Rigol devices is 5555.

author: Ben321
author_rank: Frequent Contributor
timestamp: February 11, 2024, 09:31:47 am
content: Quote from: JDubU on February 11, 2024, 06:27:23 amWhere did you find that? I couldn't find that documented anywhere.

author: JDubU
author_rank: Frequent Contributor
timestamp: February 11, 2024, 03:36:23 pm
content: I happened to know it from past experience but confirmed it with Google search:rigol scpi "port number"

author: nightfire
author_rank: Frequent Contributor
timestamp: February 11, 2024, 03:38:48 pm
content: Another thing when you are not sure about which ports a device has open is to use a port scanner.Most prominent example here would be nmap:https://nmap.org/These tools scan the target and print out a number of open ports that are listening to data communication.

author: Kean
author_rank: Unknown
timestamp: February 11, 2024, 03:49:49 pm
content: It is kind of hidden in the programming guide, but you will find it mentioned under ":SYSTem:COMMunicate:LAN:CONTrol?"Querying this does kind of end up being a "chicken or the egg" dilemma... so you would have to be querying it over USB.I'd expect it to be shown on the I/O settings page but I don't think it is.

author: Bud
author_rank: Super Contributor
timestamp: February 11, 2024, 04:10:20 pm
content: Quote from: Ben321 on February 11, 2024, 05:06:18 amCan you name any other manufacturer who does their own drivers. They all use one of the major ones like NI or Keysight that I have seen.

author: Bud
author_rank: Super Contributor
timestamp: February 11, 2024, 04:16:35 pm
content: Use Wireshark to capture and analyze LAN messages format, it may not be as simple as you think like just open a connection and send commands in ASCII. There may be particular message format for send and receive, preamble, header, trailer, sequence control, etc. There may also be different numeric data formats that may require translation, depending on what data is sent/received. Integer data format for screen capture may be different from floating data format for aquisition mode, that kind of thing.

author: Kean
author_rank: Unknown
timestamp: February 11, 2024, 05:56:57 pm
content: Quote from: Bud on February 11, 2024, 04:16:35 pmThere is a 264 page programming guide available for the DG1000Z series covering the supported SCPI commands, and giving many examples. I would think it would be relatively straightforward to implement. Even the binary transfers for screen capture are pretty clearly documented.

author: Ben321
author_rank: Frequent Contributor
timestamp: February 12, 2024, 07:07:38 pm
content: Quote from: JDubU on February 11, 2024, 03:36:23 pmI confirmed with a port scan that port 5555 is open. In fact, I found a total of 6 ports are open (including port 80, for the internal web server). The other 5 open ports are:1116176186195555I can't find any documentation online about what these ports are used for, except for port 111. I know that the Rigol DG-1022z uses LXI protocol for network connectivity, because it displays the LXI logo when connected to a network. The official LXI website has a list of used ports athttps://www.lxistandard.org/About/LXI-Protocols.aspxand port 111 is to be used for VXI-11 protocol. Also it mentions the use of ports 5024 and 5025 for SCPI commands, and SCPI is a type of command that the DG-1022z uses (according to official Rigol documentation). So I'm actually quite surprised that this Rigol funcgen doesn't use either of those two SCPI port numbers. I've got no idea why Rigol would use non-standard port numbers, except to try to make their system proprietary, and difficult to write 3rd party software for.And that still doesn't explain what the remaining ports are for. Of the 5 ports that are not for a web server (ports 111, 617, 618, 619, and 5555) I'm not quite sure which one is actually the main communication channel for sending control commands to the device. I really am hoping that there's some kind of official documentation on the use of these 5 ports in general (such as from LXI, VXI, or other standards defining organizations), and more importantly their use with the Rigol DG-1022z specifically. Does Rigol publish a (maybe hard to find) document that actually explains the use of each of those ports?I'd hate to accidentally send a command to the wrong port, and have it brick the device.

author: rcjoy
author_rank: Regular Contributor
timestamp: February 12, 2024, 09:50:10 pm
content: Since you mention it supports VXI-11, then using python with the python-vxi11 package is the easiest way to go.No need to worry about ports, and you don't need to install any NI drivers and frameworks.

author: Ben321
author_rank: Frequent Contributor
timestamp: February 12, 2024, 10:22:32 pm
content: Quote from: rcjoy on February 12, 2024, 09:50:10 pmI prefer to avoid python if possible. It's an interpreted language. This means if you write a program with it, and you want to distribute it, you need to distribute Python as well. I prefer something like C that can make standalone EXEs. But this kind of direct connecting (rather than working through an already existing framework like the Python VXI-11 framework you already mentioned), means I will need to know the port number. Now I know that supposedly the port 5555 is the one I want, but before I start sending commands on it, I would like official documentation from Rigol that port 5555 is indeed the correct port. Do you know any official PDF docs from Rigol that state that port 5555 is the correct one?

author: coromonadalix
author_rank: Super Contributor
timestamp: February 13, 2024, 01:39:51 am
content: If you dont send any calibration, eeprom dump or write "if the scope has theses commands" you can use whaterver you want Pyhton, C, C++, VB, VS blah blahfor the port(s) wellask rigol directly?thats why i ditched Rigol after a scope purchase, documentation is .......... suckstheir SW ............ sucksFor Siglent we developped many apps in Python and or VS 2021 for Siglent stuff lot of fun working with them, the IT guy was drooling lollLXI ... usb and lan controlledI even done my 1st SW in Labview for an SSG3032XAt 1st we used Keysight I/O suite, later the Rhode Schwartz visa drivers with their tools to send receive commands correctly, know their opened ports yesand now absolutely "no drivers needed" nothing, fully lan controlled ... we scan the Instrument declared ID send some "presence request say: IDN" toc toc yahoo are you there ...that's allIf your network is secured, you may need to whitelist their mac's ...you can achieve this too .. if you are afraid to distibute ?? its the same thing as installing usb drivers to make peripheral workmy 2 cents

author: Kean
author_rank: Unknown
timestamp: February 13, 2024, 09:27:07 am
content: Quote from: Ben321 on February 12, 2024, 10:22:32 pmAs I mentioned above, it is documented (poorly) in the official programming guide that you linked to.Page 2-191 (203 of 264).Code::SYSTem:COMMunicate:LAN:CONTrol?Syntax :SYSTem:COMMunicate:LAN:CONTrol?Description Query the number of the initial control connecting terminal used for socket communication.Return Format The query returns 5555; if the interface does not support socket, the query returns 0.

author: alm
author_rank: Super Contributor
timestamp: February 13, 2024, 10:14:03 am
content: Quote from: Ben321 on February 12, 2024, 07:07:38 pmPort 111 is portmap. It tells the port assignment for RPC services. If you run rpcinfo -p <ip address> (for Mac / Linux / Unix, probably rpcinfo /p on Windows), it will show you what some of the other ports are used for.VXI-11 is an RPC based protocol that you could implement in any programming language. Though for something as string-heavy as instrument control, C wouldn't be my first choice.

author: rcjoy
author_rank: Regular Contributor
timestamp: February 13, 2024, 11:32:24 am
content: Quote from: Ben321 on February 12, 2024, 10:22:32 pmVXI-11 library for C is athttps://github.com/f4exb/libvxi11VXI-11 library for C++ is athttps://github.com/Lew-Engineering/libvxi11Those are for Mac or Linux, so they will need some modifications for if you use Windows.But using Python initially is the easy way to see if you can talk to the scope at all via the network.

author: Jeroen3
author_rank: Super Contributor
timestamp: February 13, 2024, 12:01:17 pm
content: Quote from: Ben321 on February 12, 2024, 10:22:32 pmPython it literally limitless. And a big plus is that ChatGPT is fluent in it.https://pyinstaller.org/en/stable/PyInstaller bundles a Python application and all its dependencies into a single package. The user can run the packaged app without installing a Python interpreter or any modules. PyInstaller supports Python 3.8 and newer, and correctly bundles many major Python packages such as numpy, matplotlib, PyQt, wxPython, and others.I recommend using python for controlling instrumentation. It works.You can also use C/C++/C#*, but you'd bo doing your own sockets or depending on NI VISA.*c# is also interpreted

author: Veteran68
author_rank: Frequent Contributor
timestamp: February 14, 2024, 11:12:02 pm
content: pyinstaller is just one of several methods of packaging Python apps as EXE's.I'm an old-school developer who favors ASM/C/C++ for anything I need mad performance out of, but scripting languages have their place. I'm a big fan of Python and Node.js for the right jobs.Quote from: Jeroen3 on February 13, 2024, 12:01:17 pmMeh, I could nitpick that statement. It's compiled down to an intermediate runtime language (IRL) of bytecode, similar to Java. So it's partially compiled and partially interpreted. Depending on the runtime, I've seen IRL applications meet and even exceed unoptimized C++ for certain tasks because their bytecode engines and standard libraries can be heavily optimized for those tasks.

author: Ben321
author_rank: Frequent Contributor
timestamp: February 15, 2024, 11:21:23 am
content: I just tried the port 5555 and it seems to be the right one, even though I can find no official documentation for this, nor even the source material that the community seems to have used to find port 5555. It seems that port 5555 for Rigol is just a piece of knowledge floating around the electronics hobby community with no real known source. It's a piece of knowledge that just seems to "exist" without having been found. Very strange.

author: Berni
author_rank: Super Contributor
timestamp: February 15, 2024, 12:32:34 pm
content: Don't reinvent the wheel. Just install a VISA library and be done with it.You are free to choose whatever VISA implementation you would like to use. Be it from National Instruments, Rigol, Keysight, R&S..etc Personally i like Keysights implementation because it has a nice UI and lets you spy on the traffic live (useful for debugging):https://www.keysight.com/de/de/lib/software-detail/computer-software/io-libraries-suite-downloads-2175637.htmlThe stuff is all standardized by the IVI Foundation, so Keysights VISA library has no problem talking to Rigol or Tek gear. The software side API is also standardized, so the applications making use of it also see no difference. It all looks the same no matter the connection method of the instrument, be it USB, RS232, GPIB, Ethernet, GPIB to Ethernet bridge, PCIe, PXI..etc All you do is include the VISA.dll in your application, tell it you want to connect to "TCPIP0::192.168.2.102::inst0::INSTR" and it will connect and you can start feeding commands to it. The DLL itself is a old school machine code DLL, but it has bindings into modern .net or python or whatever you like.

author: Elmue
author_rank: Newbie
timestamp: February 28, 2025, 12:49:01 pm
content: @Ben321:> I don't like that Rigol depends exclusively on NI software and driver framework,This huge framework of 1 Gigabyte installs a lot of services that will permanently run in the background on your computer.It is really an ugly software.The real driver that you need is the USB driver for TMC (Test and Measurement Class) devices from the IVI foundation.This driver has a size of 24 kB.Yes, you have read correctly: twenty four kilobyte!And this is really ALL you need!Nothing more.The SCPI protocol is extremely primitive, because it sends only some text commands and responses over TCP.The communication with the driver can be written in a few lines of code.The NI framework is TOTAL OVERKILL.It is like throwing an atomic bomb to kill a bug.> and doesn't bother to write their own Rigol drivers that you can install by themselves...Everything that is made by Rigol is ugly buggy shitty CRAP.I find new bugs in my scope every day.There are not two or three bugs. Rigol CRAP is full of hundreds of bugs.And these Chinese have no idea of Windows programming, so they don't even try to communicate directly with the IVI driver.If you tested the Ultra Sigma software, you know what an incredible primitive garbage this is.After installing 500 Megabyte you just get a remote control of the oscilloscope which offers no useful functionality.It is not even able to transfer the signal that your scope has currently in memory.I was so pissed off that I spend much money for my Rigol oscilloscope and got this CRAP.Therefore I wrote my own software:Oszi Waveform AnalyerI published it as open source.It can transfer signals from the oscilloscope over USB or TCP to the computer and does not need ANY additional installation except the tiny IVI driver of 24 kB.It shows the analog and/or digital channels on the computer, has an A/D converter, noise suppression, decoders for UART, SPI, I2C, CAN bus, post decoders for specific chips or protocols and offers functionality that you will find nowhere else.You find download and detailed description on my homepage:https://netcult.ch/elmue/Oszi-Waveform-Analyzer