04-13-2018 06:36 AM
What a problem could it be (See subject)?
Variable "DC_DeviceName" == DC (logical name I created in MAX)
Message of exception is:
"IviSessionFactory: An instance of the specific driver referenced by the driver session name could not be created, or did not support the specified type.\r\nSpecific driver (software module): NationalInstruments.ModularInstruments.NIDCPower 14.1.0 Fx45\r\nClass name: NationalInstruments.ModularInstruments.NIDCPower.NIDCPower, NationalInstruments.ModularInstruments.NIDCPower.Fx45, Version=14.1.45.49153, Culture=neutral, PublicKeyToken=4FEBD62461BF11A4"
InnerException of exception above is:
{"Unable to cast object of type \"NationalInstruments.ModularInstruments.NIDCPower.NIDCPower\" to type \"Ivi.Driver.IIviDriver\"."}
Logical name and driver session in MAX are properly (as it seems to me) configured.
Images of Max-settings and exception are attached as well.
Please, help.
04-16-2018 05:06 PM
PeterSevos,
Thank you for posting on our forums.
In order to better assist you could you please provide me with more information as to your overall goal of this application? What are you trying to accomplish in your code when you get this error?
Also, have you double checked to make sure you have all the appropriate drivers installed as well as the IVI Shared Components?
04-17-2018 12:55 PM
Hello! I have been briefly looking into this issue. Hopefully I can help.
Following those steps, I was able to successfully get an NIDCPower session. I went ahead and validated that I could create it using the IVI Factory, and cast it to an IIviDriver and an NIDCpower object. The following code ran successfully for me.
IIviDCPwr iIviDCPower = IviDCPwr.Create("DC", true, true); IIviDriver iIviDriver = (IIviDriver)iIviDCPower; NIDCPower dcPower = (NIDCPower)iIviDriver;
Thank you!