LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Ethernet TCPIP (Socket) Termination Character


@BarnaCsenteri wrote:

 

I had the same issue. But never the less even if I switched it on, the plain TCPIP Visa raw socket does not appends anything (at least it is not visible in IO Trace).


This might be your issue! Raw sockets have absolutely nothing to do with IEEE 488.2. You need a TCP Instr session for this property to have any effect!

Rolf Kalbermatter
My Blog
0 Kudos
Message 21 of 29
(340 Views)

I had quite a lot of problem with VXI and other type of "autodetect" implementations (even blocking and freezing visa connect/open) with quite many devices over the years - while on paper looks good I don't trust those anymore mostly because the issues were random, also connected to async vs sync visa. 

 

And with industrial stuff this is not an option and async also is a must (cannot afford to have synced VISA with lot's of measurements going on in parallel).
This is eliminated with RAW socket, no fancy connect protocols. 

 

It is just annoying that it is known from years and it is still dragged on, always have to tweak something on few thousand euro/usd equipments before using them ...

 

 

0 Kudos
Message 22 of 29
(333 Views)

Changing behavior for TCP Raw is not really an option. TCP Raw means really raw. It doesn't add anything that is part of things like SCPI or IEEE 488.2 for a very specific reason. Doing so would make many existing software suddenly fail.

 

Raw means any byte you place on the line is transferred exactly as you specify. No special processing, handling, translation or whatever is performed. So if you absolutely want to use raw, you should not expect existing instrument drivers to simply work but have to possibly modify them. Those instrument drivers are tested with an instrument session and your fear of standard instrument session handling may be somewhat justified in case of some VXI devices and maybe even some obscure TCP devices, but I had generally not many problems with that (but have to admit that I only worked with a few VXI devices way back at the end of last century).

 

Also, if you use an USB interface and the device supports the USB T&M class (responding to the USB Instr session class in LabVIEW) your device is not a virtual serial device and VISA ASRL does not "kick" in. Instead it is an IEEE 488.2 compatible session and communicates over its own specific USB message protocol (which is mostly derived from the USB Mass Storage protocol class as far as low level communication goes and IEEE 488.2 processing on the higher level).

 

If your device instead implements a virtual serial port (USB-CDC or COMM class) it will be recognized and treated as a VISA ASRL port.

 

If it does not implement USB-CDC or USB-T&M you are in the VISA USB Raw world, which while possible to do in VISA, is nowadays in almost all cases a dead end since you not only run into the problem of having to dig up the USB low level protocol specification for your device (which most manufacturers will rather have their arm hacked off than giving that spec out) but also additional issues with driver signing requirements for all but very old OSes.

Rolf Kalbermatter
My Blog
0 Kudos
Message 23 of 29
(321 Views)

@rolfk wrote:

Those instrument drivers are tested with an instrument session and your fear of standard instrument session handling may be somewhat justified in case of some VXI devices and maybe even some obscure TCP devices, but I had generally not many problems with that (but have to admit that I only worked with a few VXI devices way back at the end of last century).


I use TCP for instrument communications whenever possible.  GPIB is expensive and I don't trust USB (I've had random disconnects and resource names change on reconnection).  Of all the devices I have had to communicate with, I think only 1 needed to use the raw TCP class (I'd have to really dig to figure out what the device it was).  Granted, I have my own special SCPI library that appends the Carriage Return before sending out the message.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 24 of 29
(309 Views)

"Changing behavior for TCP Raw is not really an option"

Yea that is correct. 

 

But I do not want to use Raw - I want to use anything works reliable 🙂

 

- USB does not (a windows update can trash the USB enumeration and NI-MAX completely, had that numerous times, switching a HUB can do that too. We even had power outage and had to log in for factory to put back Ni-Max devices from scratch)

 

- VXI I had problems with almost all devices from Keysight and BK Precision (and others too) till yesterday. If you are very parallel (all industrial systems are) sometimes the VXI connect phase does freezes if the Visa type is async.
I do not know if that is coming from bad implementation in the devices or bad implementation of the VXI standard when async VISA is used. I would think it is the latter one because if I switch to synched VISA it does works. But that is not ok for me - I need async,

 

These two issues forced me to use RAW TCPIP because the other two are simply not reliable.

 

But most of the equipment providers are giving their libraries tested with ancient 2004-2005 Labview + Visa on USB (most of them are serial adapters using the ASRL class with default endline character on for old VISA implementations) and nobody gives a damn about doing a try with real parallel VXI and/or RAW TCPIP or even newer ASRL where the newline is not default anymore and at least one additional call is needed to switch it on.

 

So I am still in the situation that we buy 5-6-7 figure worth of equipment and I have to start with going through all their VI's they use and switch the VISA Write/Reads-s from them to a custom one which deals with this issues. And we are in 2024 so those problems are not new, they were there since 10+ years and still I am the one who have to deal with it 🙂 

0 Kudos
Message 25 of 29
(272 Views)

Well VXI, while not completely dead, is factually since many years on extended life support. New development is nearly non existent, and any investment in existing drivers is definitely seen as a case of throwing money out of the window, unless you work in some very specialistic field. The hardware being close to custom made in terms of numbers sold, makes it both extremely expensive and also difficult to justify any further investment beyond trying to maintain the necessary supply chain to still be able to produce them.

 

USB enumeration and power management issues is something that VISA can't change. It is part of the OS plug and pray technology and something you have to learn to live with and to some extend you can manage it. 

 

Asynchronous I/O may seem like the perfect solution to solve all your large application difficulties but in most situations it is indeed a recipe for failure. I have used it and have been able to make it work in some specific situations but it is much much more tricky than just plopping down a few LabVIEW nodes and hope to be done with. The typical approach of blindly setting everything to asynchronous and massively launch everything in parallel is for sure going to get into nasty blocking situations. But in most cases asynchronous I/O can be avoided by smartly using the synchronous VISA I/O operations to communicate with a device. For instance if you use serial, it is much much more efficient and safe to simply use the Bytes at Serial Port property to check that there is actually some data to read (but never ever use that value to decide how much you need to read unless you want to start doing your own data caching layer in your instrument driver)!

 

Also your expectations about instrument drivers may be slightly to high. They are in my experience very rarely ready made plug and play solutions but often need some extra functionality or tweaking to be applicable for a specific situation. Some even do not deserve the name instrument driver, but that is usually from more obscure instrument manufacturers, who put some summer vacation intern at a desk with a computer and an instrument and tell him to get going. I have many of such drivers more or less from the ground up rewritten and in quite a few cases not even used the provided "driver" as anything more than trying to gather some particularities about the usually badly documented device protocol.

 

VISA Asynchronous can work quite well when used from traditional programming languages such as C if you know how asynchronous programming works and that can help to make it work in LabVIEW too, but it is not as simple as changing VISA nodes to asynchronous operation and hope all is well. For most LabVIEW applications it is definitely more simple to not even try to use it.

Rolf Kalbermatter
My Blog
0 Kudos
Message 26 of 29
(260 Views)

Async is only "half async" and every client from production requests it - which means one given instrument does not need to be accessed in parallel but two of the same kind has to.

If you know Teststand it's basically a batch model running 2-N parallel and sort of independent process. 

 

And yea - sometimes semaphores are needed and can end it quite complex specially in cases when some slots do share one single instrument with multiplexing.

 

But it is not an option to not use it - production sites are fighting for every second of "speed", at the end of the year can make a $ difference with many zeros at the end ...

 

I might have high expectations but at least I expect to have a "hello world" example working when I get an expensive equipment without needing a tweak. But it seems this is still too high 🙂 

 

"Well VXI, while not completely dead, is factually since many years on extended life support"
Didn't knew this, now I know why those implementations are so bad 🙂

0 Kudos
Message 27 of 29
(254 Views)

@BarnaCsenteri wrote:

 

I might have high expectations but at least I expect to have a "hello world" example working when I get and expensive equipment without needing a tweak. But it seems this is still too high 🙂 


A "hello world" application and asynchronous communication are pretty much at the opposite end of the programming learning curve!

Rolf Kalbermatter
My Blog
0 Kudos
Message 28 of 29
(244 Views)

"A "hello world" application and asynchronous communication are pretty much at the opposite end of the programming learning curve!"

 

I know. Have 20+ years of C/C++  programming background with many parallel and distributed system architectures over the years on quite a lot of areas (both design and code).
So I do not have issues with this at all.

 

But I was expecting that I need to apply those levels on the top and at least I can try out the instrument with a "hello world" example when they arrived. Seems that is too high 🙂

0 Kudos
Message 29 of 29
(239 Views)