Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Does NiVisa fix the Ethernet read buffer allocation bug?

NiVisa 3.01 does not properly allocate memory for the read buffer and gives resource allocation error messages.
0 Kudos
Message 1 of 5
(3,519 Views)
Steve,

I'm not familiar with this problem in NI-VISA 3.0.1. Could you post error messages and possibly some sample code for reproducing this condition? What exactly happens? What kind of resource are you calling viRead on (VXI-11 or Raw TCP)? Have you observed this behavior in VISA 3.1 as well?

If you do not have VISA 3.1, you can download it here: http://digital.ni.com/softlib.nsf/websearch/8E7D54CA3A1FDECF86256E4D007ED2E0?opendocument&node=132070_US

Note that it does not support Windows 95, 98, or Me.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,519 Views)
Thanks you Scott for answering me.
The problem showed up when trying to read back the instrument state of a Tektronixs TDS3014 oscilloscope.
Shown below is the most significant code:

status = viOpen(viDefaultSession, TCPIP::12::INSTR, VI_NULL, VI_NULL, &viESA);

strTemp = "*LRN?";
status = viWrite (viESA, (ViBuf)strTemp.GetBuffer(strTemp.GetLength()), strTemp.GetLength(), &nRetCount);

// Then to retrieve the data:
status = viRead(viESA, (ViBuf)cResult, sizeof(cResult), &nRetCount);

The viRead command will generate an error to the effect that there is insufficient memory. Sorry, I no longer have the oscilloscope on site and can't get the exact error. Attempts to set the read buffer don't help.

Thanks,
Steve
0 Kudos
Message 3 of 5
(3,519 Views)
Steve,

Interesting; I'm assuming that you malloc'd for cResult elswhere in the code. VISA 3.1 was rigorously tested in-house and there are no known issues of this sort, but if you are able to replicate this problem again then post here and we'll work through it.

Scott B.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 5
(3,519 Views)
Thanks again, Scott. Its Visa 3.01, not 3.1. Also, I believe a NI engineer was able to find some mention of it in the NI trouble reports database searching for for TDS3000 series oscilloscope.
0 Kudos
Message 5 of 5
(3,519 Views)