Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DCPower Examples for DotNET 4.5 fail on IviDCPwr.Create()

In NI-DCPower Examples for DotNET 4.5 "DCPower Generate Voltage.sln"

 

The IviDCPwr.Create({logical name}) method CORRECTLY throws exception:

IviSessionFactory: The specific driver's main class (assembly qualified class name) is not specified in the configuration store.
Driver session: niDCPower
Specific driver (software module): NI-DCPower 

 

It is true--in Ni-Max where the logical name is configured to a driver session, the read-only field for Assembly Qualified Class Name is blank/missing. I know what the name is, but I can't supply it (read-only and all). SEEMS LIKE SOMETHING THAT SHOULD BE SIMPLE/AUTOMATIC but isn't. Any idea how to fix?

 

Ni-Max ScreenshotNi-Max Screenshot

Thx,

Tom

0 Kudos
Message 1 of 10
(4,951 Views)

Hi TGregor,

 

I was able to find the forum post below that talks about reasons this error occurs and possible solutions.

 

Class driver constructor ambiguity: https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Class-driver-constructor-ambiguity/m-p/21081...

 

Maybe there was something wrong with the driver install?

0 Kudos
Message 2 of 10
(4,899 Views)

I found that if I click the Go To button to go to the software module page, I can enter the class name there.  Unfortunately, I have not been able to figure out which class name to enter in the Assembly Qualified Class Name box.  No matter what I enter, I get the same exception, except that the class name I enter is also listed in the exception message.

 

I am assuming that the module paths are correct, but I'm not sure if that is the case.

 

Any help to fix this problem will help me as well.

0 Kudos
Message 3 of 10
(4,822 Views)

Is this happening with all of the examples for NIDCPower, can you see if this is happening with any particular calls to the driver, or if it happens if it happens in any case?

0 Kudos
Message 4 of 10
(4,812 Views)

I actually have not been able to find any examples for NI DC Power control using .NET.  I've spent a lot of time looking all over the place, but I have not been able to find one working example.

 

Through trial and error, I am figuring that it does not make sense to enter an IVI class for the Assembly Qualified Class Name for the module.  There are module path entries which by default are nidcpower_32.dll and nidcpower_64.dll.  But these do not appear in my debug directory, for some reason.

 

Is there anywhere where there are step by step instructions for getting a simple power switch application to work for the NI PXIe-4112 using either C# or Visual Basic?  Not just the code, but also setting up the IVI Configuration using NI-MAX (or some other means) so that the code can all find itself?

0 Kudos
Message 5 of 10
(4,795 Views)

Here you go David. My pain can be your gain. Things started to work out for me when I was able to locate the .NET APIs. Here's a consolidation of the links you may need. Hope this is helpful. - Tom

 

.NET Support

https://www.ni.com/en/support/documentation/supplemental/13/national-instruments--net-support.html

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

NI-DCPower .NET Resources

https://www.ni.com/en/support/documentation/supplemental/15/ni-dcpower--net-resources.html

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

DOWNLOAD NI-DCPower .NET Driver

https://www.ni.com/en/support/downloads/drivers/download.ni-dcpower--net-class-libraries.html#324061

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

Ni-Switch .NET Resources

https://www.ni.com/en/support/documentation/supplemental/15/ni-switch--net-resources.html // NI-Switch .NET Driver

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

DOWNLOAD NI-Switch .NET Driver

https://www.ni.com/en/support/downloads/drivers/download.ni-switch--net-class-libraries.html

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

Ni-DMM .NET Resources

https://www.ni.com/en/support/documentation/supplemental/15/ni-dmm--net-resources.html

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

DOWNLOAD NI-DMM .NET Driver

https://www.ni.com/en/support/downloads/drivers/download.ni-dmm--net-class-libraries.html

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

 

0 Kudos
Message 6 of 10
(4,789 Views)

Also: 1000 apologies to those who replied earlier, and THANK YOU. I don't know why I didn't receive (or somehow missed) notifications that there were responses to the post. We have been undergoing a massive network reconfiguration as Linear Technology gets assimilated into Analog Devices (our new owner). That's my lame excuse. Thanks again.

0 Kudos
Message 7 of 10
(4,785 Views)

One last thing concerning my original complaint that the field I needed was read-only in NI-MAX. What I didn't know is that NI-MAX is just a front end for the xml file that holds the VISA configuration. Now, you may want to have a backup before you monkey with it, and discovering this certainly de-mystified things. My own experience is that it was trivial to add the tag that was needed, circumventing the read-only issue.

 

On Windows 10 it's found here (your mileage may vary):

C:\ProgramData\IVI Foundation\IVI\IviConfigurationStore.xml

 

But as far as I'm concerned this is a moot point because if one can stumble across the actual APIs then the sessions can easily be opened using the VISA resource without the IMO convoluted process of making logical names.

 

 

0 Kudos
Message 8 of 10
(4,775 Views)

So, does anybody know what the text is that needs to go into this field?

 

I tried putting in "Fred", but just got the exception message saying that "Fred" did not work.  I just need to know what keys to type to get this to work.  Does anybody know?

0 Kudos
Message 9 of 10
(4,490 Views)

What kind of exception message are you getting? From reading through this forum post, it sounds like it could be a software configuration issue. I'd recommend checking out this discussion as well to see what might be going wrong:

https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Class-driver-constructor-ambiguity/m-p/21081...

Francine P.
Applications Engineering
National Instruments
0 Kudos
Message 10 of 10
(4,471 Views)