LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem calling IviDCPwr_init()

I got a problem calling this function. The error message is:
===============================================================
NON-FATAL RUN-TIME ERROR: "ividcpwu.c", line 73, col 13, thread id 0x00000AEC: Function IviDCPwr_init: (return value == -1074134949 [0xbffa005b]). (0xbffa005b) File not found.
===============================================================

I'm using Agilent N5768A Power Supply. In MAX, I added a Logical Name for it as "P48V", and tried to initialize it in this way:
IviDCPwr_init ("P48V", VI_TRUE, VI_TRUE, &instrumentHandle);

SW environment:
NI IVI Compliance Package 2.2
LabWindows/CVI 7.1

I also tried the IVI Soft Front Panels, and got the same error.

Could somebody tell me what file it's looking for? Thanks a lot.

JasonJ
0 Kudos
Message 1 of 14
(5,243 Views)
Hi Jason,

I've never used this IVI driver, but I'm looking into this issue to see what is going on. So I can try to recreate it, what version of NI-VISA do you have on this computer?

john m
Applications Engineer
0 Kudos
Message 2 of 14
(5,211 Views)
The NI-VISA on my PC is ver 3.2.

Thanks for the response. I'm looking forward to your help. My current work is stuck on this.

Jason
0 Kudos
Message 3 of 14
(5,208 Views)
Hi Jason,

Well, it looks like you have a recent enough version of VISA that you should be able to run the driver, at least according to the minimum requirements that Agilent specified. In my searching, I have not been able to discover what file it is that is missing... we may need to contact Agilent on this, since this driver was created by, downloaded from, and is maintained by them. Or perhaps someone else has used the driver and has run into this before. Anyone else have any ideas?

john m
0 Kudos
Message 4 of 14
(5,200 Views)
Jason,
As I know, there is no IVI-C driver for Agilent N5700 found at NI or Agilent download site. What I could find are IVI-COM (Agilent site) and Plug & Play (NI site) driver. Is the driver really IVI-C?
0 Kudos
Message 5 of 14
(5,191 Views)
Jason,

I could see the same error return (File not found) from the IVI DCPwr example at the same line,
(ProgramFiles/IVI/Drivers/ividcpwr/Exampless/CVI/ividcpwr.prj.)

As I see, this error seems like generated when the IVI driver configuration is set up incorrectly such as selecting an IVI-COM driver.

Normally you would create a Logical Name, Driver Session, and Hardware Asset entries and configure the link each other, in the NI-MAX tool. Plus, the Software Module selection in the Driver Session's "Software" tab must point a valid IVI-C driver.

As I know the Agilent N5700 driver provided from Agilent is an IVI-COM driver only (not a IVI-C), and selecting such IVI-COM driver as Software Module does generate the "File not found" error. This is because the driver DLL does not export prefix_init() function.

I recommend you to check if the "Software" tab for your Driver Session setting does display the "Module Path" selection such as prefix.dll or prefix_32.dll and does not display any Prog-ID name.

Message Edited by Makoto on 05-30-2005 06:20 PM

0 Kudos
Message 6 of 14
(5,182 Views)
Thank Makoto for working on this over the weekend.

Seems you're right. I checked Driver Seesions->Software->Module Path. It's empty and read-only. So the next question will be how to configure it.

Thanks again.

Jason
0 Kudos
Message 7 of 14
(5,160 Views)
I'm now trying to create the interface by using GPIB driver directly. I included ni488.h, built, and LabWindows/CVI complained about PVOID not defined. So I included WINNT.H, then got INT32 redeclaration error. How can I get the right header files?

Thanks.
Jason
0 Kudos
Message 8 of 14
(5,153 Views)
Try to include GPIB.H if you use NI-488.2M API directly. But my recommendation is use VISA library instead, because this is the same approach as most of IVI and VXIpnp instrument drivers.
0 Kudos
Message 9 of 14
(5,152 Views)
GPIB.H is working. Thanks.

Then I moved on to try VISA library. It's quite straight forward and easy to use. But again I got one problem. For some commands, I can issue through NI488.2 Communicator, but not in my code. They are:
1) *RST
2) OUTP ON
3) MEAS:VOLT?
4) *OPC?

Could you explain why? Here's my code in a simple way:
=================================================
status = viOpenDefaultRM (&defaultRM);
status = viOpen (defaultRM, "GPIB::4::INSTR", VI_NULL, VI_NULL, &inst);

status = viPrintf(inst, "*RST");

status = viPrintf(inst, "*IDN?\n");
status += viRead (inst, data, sizeof(data), &rcount);

status = viPrintf(inst, "VOLT:PROT:LEV %d\n", 55.0);
status += viPrintf(inst, "CURR:PROT:STAT %d\n", 1);
status += viPrintf(inst, "CURR %f\n", 2.0);
status += viPrintf(inst, "VOLT %f\n", 10.0);
status += viPrintf(inst, "OUTP ON");

status = viPrintf(inst, "MEAS:VOLT?");
status += viRead (inst, data, sizeof(data), &rcount);

status = viClose(inst);
status += viClose(defaultRM);

=================================================

Thanks a lot.
Jason
0 Kudos
Message 10 of 14
(5,139 Views)