This behavior is caused by a regression in the NI-VISA Ethernet Passport (NiViEnet.dll) in NI-VISA 2026.x when handling END / End-of-Message (EOM) indicators during partial or bounded buffer transfers on VXI-11 sessions. The passport processes the full payload and END indicator from the network layer, returning VI_SUCCESS and clearing the device buffer even though the calling application requested fewer bytes via count.
To resolve or work around this issue, use one of the following methods:
-
Reduce the Read Chunk Size:
Set the count parameter in viRead() to 1000 bytes or fewer per call. Reading in smaller chunks avoids triggering the pre-buffering condition and allows viRead() to return VI_SUCCESS_MAX_CNT until the entire response is retrieved
-
Switch to Raw TCP Socket Resource:
Change the VISA resource string from VXI-11 to Raw Socket format:
TCPIP0::<IP_Address>::<Port>::SOCKET (e.g., port 5025).
Note: Raw SOCKET sessions do not use VXI-11 protocol framing. If status byte polling is required on a SOCKET resource, issue the SCPI query *STB?\n or set the VISA session attribute VI_ATTR_IO_PROT to VI_PROT_4882_STRS before calling viReadSTB()
-
Suppress the END Indicator:
Set the VISA attribute VI_ATTR_SUPPRESS_END_EN to VI_TRUE on the session prior to executing viRead(). This prevents the END signal from forcing a VI_SUCCESS status prematurely during partial reads.
-
Roll Back NI-VISA:
Downgrade the NI-VISA driver installation on the system to NI-VISA 2024.5