Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically find IVI software module path? - or dynamically instantiate class from module name?

i thought that i could make an application that configurate the Configuration Store, configuring the I/O Resource Descriptor at Hardware Asset, the ProgID at SoftwareModule and adding a LogicalName
 then with IviSessionFActory to open a new Session using LogicalName and refers it to a class instruments (for example:

IIviDmmPtr spDmm = spSF->CreateDriver(nombre)

)

 

Now i could use the instruments class functions..

 

It's not possible? Would i install any specific intruments driver that i could use??

 

Thanks MAkoto

0 Kudos
Message 11 of 17
(2,814 Views)

> It's not possible? Would i install any specific intruments driver that i could use??

Yes, it is possible.  You can write an app that configures IVI Configuration Store.  I think you already know how to do it as there are some example codes (written in VB6) in IVI-3.5 Configuration Server spec.  In fact, many IVI drivers or their installer scripts contain such codes that will be invoked when it is being installed/registered. Also NI-MAX contains such codes.

When you write such app, probably what you must write is what configures the Logical Name(s) and its associated links to Driver Session, Software Module, Hardware Asset, and default operational behaviours (such as range check, state cache settings).  But as for Software Module entry, it will already be configured when the driver was installed by its own SETUP program, therefore normally you don't have to configure Software Module contents for any instruments (though it is still possible to write it).

Message 12 of 17
(2,766 Views)

Hi Makoto

I have a Agilent RfSigGen code.

I have downloaded the driver  and its runs correctly. In the programa i call agrfsiggen.lib using #include "agrfsiggen.h"

i want to get interchangeable code using ICP of NI. I have downlioaded it and i have make some changess in my code.

I change the functions Ag.... by Ivi.... and costants AG... by IVI...

I change #include "agrfsiggen.h" by "ivirfsiggen"

and i changed the librarý in my linker options: agrfsiggen.lib by ivirfsiggen.lib.

 

I try to compile it but i have a lot oferror LNK2019:

Example1 error LNK2019: símbolo externo _IviRfSigGen_GetAttributeViString sin resolver al que se hace referencia en la función _main

an error for Ivi function.

Can you help me? I need something more in my software??

 

Thanks

0 Kudos
Message 13 of 17
(2,729 Views)
I believe you are using IVI-C approach. 
 
I checked if the function really existed in DLL by using dependency walker and it really existed. But... the correct function name was IviRFSigGen_GetAttributeViString.  Mind that the correct spell is "RF" and not "Rf".  I believe "Rf" function call might have "no prototype" function error when compling your app code.
0 Kudos
Message 14 of 17
(2,721 Views)

Thanks Makoto

I'm stupid :(. The problem was that:   Rf no   RF yes

The program now compiles

 

Now i have a problem with the logical name,

the logical name is the same that the alias VISA????

Can i change the logica name using Agilent I/O conection expert???

i use a alias visa but the program don't take it

 

ant thank you very much by your help

0 Kudos
Message 15 of 17
(2,717 Views)

I'm working on the same topic for weeks now and I'm still struggling with the interchanability part.

 

Following code will always fail on createDriver if I use Ividrivers from HP or Keithley since they haven't any ProgID set in Ni Max.

 

            IIviSessionFactory factory = new IviSessionFactory();
            IIviDmm dmm = (IIviDmm)factory.CreateDriver(resourceString);
            dmm.Initialize(resourceString, true, false, "simulate=false");

If I set something, the code will fail cause there's  no CLSID.

 

I was searching the registry and figured out those drivers aren't registered. Thus no CLSID and ProgID exist. So in conclusion the interchangeability function can't be used here. Or is there any other way?

 

appreciate any help.

 

Greetings

 

 

Edit: Ok while pressing Post I realized those Drivers are Ivi-C... how stupid...

0 Kudos
Message 16 of 17
(1,950 Views)

Hi Drehstromakku,

 

Thanks for posting on the NI Discussion Forums to get help with your IVI driver issue. To get the best support possible, I recommend posting a new thread with a more specific description to your problem there. Becuase this thread is 8 years old, it may not receive the same visibility as a new post. Additionally, you can give details specific to the errors you're seeing because this post may be tangentially related. You can always post a link to this post if it is relevant to your issue. 

 

In your new popst, I would suggest you give some background on your project- what you're trying to build and how. You can also post your full code to see if other users can reproduce this issue.

 

Hope this is helpful!

Austin H.
Chief Product Manager
Test Software
0 Kudos
Message 17 of 17
(1,936 Views)