Products > Test Equipment

How do you find the proper communication TCP/IP port number for Rigol DG-1022z?

<< < (4/4)

rcjoy:

--- Quote from: Ben321 on February 12, 2024, 10:22:32 pm ---I prefer to avoid python if possible.

--- End quote ---

VXI-11 library for C is at https://github.com/f4exb/libvxi11

VXI-11 library for C++ is at https://github.com/Lew-Engineering/libvxi11

Those 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.

Jeroen3:

--- Quote from: Ben321 on February 12, 2024, 10:22:32 pm ---
--- Quote from: rcjoy on February 12, 2024, 09:50:10 pm ---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.

--- End quote ---

I 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?

--- End quote ---

Python 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

Veteran68:
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 pm ---*c# is also interpreted

--- End quote ---

Meh, 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.

Ben321:
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.

Berni:
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.html

The 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.

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod