Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anyone know of an issue with NI VISA 3.6 and long command strings?

I have a LabWindowsCVI application which was created on a Windows 2000 system and has CVI 7.1, CVI-Runtime 7.1.1.314, and NI VISA 3.3.1.  This application communicates with an GPIB AC Power Supply through an Ethernet to ENET-100/GPIB connection.

 

I am having an issue running this application on a WindowsXP system which has CVI 7.1, CVI-Runtime 9.0.0.348, and NI VISA 3.6.  The issue is with sending a waveform command to the mentioned ACPS.  The actual command contains roughly 6600 characters.  The reason the command is so long is it contains 1024 waveform data elements required by the Power Supply in one command.

 

The application runs fine on the original Windows 2000 system, but I get a command error when trying to run it on the WindowsXP system.  I found, using NI-Spy, the long command string is no longer being terminated at the end of the command string and many more characters of garbage have been squeezed in before the termination character.  Considering the string is sent to the instrument using a viPrintf VISA function in the code, I believe I have an issue the VISA.  Here’s the actual function call:

 

viPrintf (vi, "%s\n", sCommand);

 

where sCommand is a string approximately 6652 characters long.

 

Does anyone know of an issue with NI VISA 3.6 and long command strings?  Or could the issue be running code, compiled on a Windows 2000 system, on a Windows XP system?

0 Kudos
Message 1 of 5
(3,215 Views)

Since you think it is a NI-VISA problem, just uninstall the current and install 3.3.1 which is XP-compatible.

Easy enough to do, isn't it?

0 Kudos
Message 2 of 5
(3,211 Views)

I'm not certain but, that DOES sound like the string may be longer than the default buffer size and, of course, the buffer flushes when filled.   Try viSetBuf() with 8192 size.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 5
(3,195 Views)

Thanks for the idea.  Once I was able to get admin rights to the PC, I uninstalled NI Visa 3.6 and installed NI Visa 3.3.1.  I then ran the code and the problem was no longer there.  The long command string looked good in NISpy (no extra garbage added) and the ACPS it was sent to did not choke on it.

This tells me there is an issue with version 3.6 but going backwards to version 3.3.1 isn't a good solution to our problem since there are many newer versions out there.  I will try the latest NI Visa version next and see what happens.

0 Kudos
Message 4 of 5
(3,136 Views)

I tried the viSetBuf() command but it was unsuccessful in curing our problem.  I did notice that NISpy did show the larger buffer size as a result.  So the default must have been 4k. Thanks for the suggestion anyway.

0 Kudos
Message 5 of 5
(3,135 Views)