Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic SCPI and VISA question

Solved!
Go to solution

Hi Greg,

 

It seems you have done everything correctly to me. Are you trying to run the sample code in CVI? If you wouldnt mind could you describe your setup and the steps you take to run the code. If you are not using CVI, try adding the code there and see if that works for you.

 

 

Patrick H | National Instruments | Software Engineer
0 Kudos
Message 11 of 17
(4,908 Views)

Hi Patrick,

 

All i'm doing to run the code is opening it on dev-c++ and executing from there. I've tried it with both the visa header file in the same folder as the example code and also by including the pathway to the visa header file in the IVI foundation folder. Power was knocked out here so i'll try to run it on cvi and get back to you.

 

Greg

0 Kudos
Message 12 of 17
(4,895 Views)

Ran it on the CVI and received this error

 

 

NON-FATAL RUN-TIME ERROR:   "InstrumentExample.c", line 81, col 13, thread id 0x00001558:   Function viOpen: (return value == -1073807202 [0xbfff009e]). A code library required by VISA could not be located or loaded.

 

visa32.dll in system32 exists and i checked that the visa 5.2 runtime driver is being included in the installer. 

0 Kudos
Message 13 of 17
(4,891 Views)

Hi Greg,

 

From everything you have told me so far this seems like it should be working. Are you able to open VISA test panels in Measurement and Automation Explorer? From there you should be able to Query the device with *IDN?. If you can do that we can at least remove the drivers and visa32.dll from the reasons causing this problem.

Patrick H | National Instruments | Software Engineer
0 Kudos
Message 14 of 17
(4,879 Views)
Solution
Accepted by topic author Greg823

Hi Greg,

 

I don’t know how I didn’t notice this before but you will also need the GPIB drivers (488.2). This was a remedy for a customer on the forum listed below. Searching 488.2 from ni.com/drivers should give you the list of all the versions to download.

 

http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Remedies-for-quot-A-code-library-required-by-...

 

Patrick H | National Instruments | Software Engineer
0 Kudos
Message 15 of 17
(4,877 Views)

Hi Patrick,

 

Thanks, that did it.

0 Kudos
Message 16 of 17
(4,868 Views)

Hello! I had the same problem, but the solutions presented on this forum didn't help. Here is my solution.

I checked my code with code generated by Keysight Command Expert. The problem was that I installed 2 version of VISA, one from the Keysight one from the National Instruments. I used the library from NI that is located here C:\Program Files (x86)\IVI Foundation\VISA\WinNT, but I had to use this C:\Program Files (x86)\IVI Foundation\VISA\WinNT\ktvisa.

0 Kudos
Message 17 of 17
(1,930 Views)