Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

IVI Software Module

Hi guys.
 
I have a question.
 
I want to develop a sotfware, which will be able to comunicate with any DMM by LXI.
 
I'm using IVI-COM
 
I think that i have to configure in my software the configuration store.
 
My problem is the IVI software module. I don'y know what is exactly what i have to configure.
 
Anyone can show my an simply example please or a explanation
 
i cant find nothing 😞
 
Thank you, you are the boss 😉
0 Kudos
Message 1 of 9
(4,787 Views)
Hello Geodo,
          Which DMM do you want to communicate with?  What development environment will you be using?  Who developed the IVI-COM driver that you will be using?  If you were using NI software, you can configure the instrument through Measurement and Automation Explorer (MAX).  You can also programmatically access and modify the Config Store, for more information look at this KB.

Cheers,

NathanT
0 Kudos
Message 2 of 9
(4,765 Views)

Hello Nathan. Thank you

I want to make a software that was able to communicate with any DMM that use LXI.

 

Im usin Visual C++ .NET and the IVI COm driver are by Agilent.

 

I think that the problem is that i would know the ProgID.

 

For Example the next code give me an error that says that the CLASS ID its not registred, how can i discover the PRog ID??

#include

"stdafx.h"

#import

"IviDriverTypeLib.dll" no_namespace named_guids

#import

"IviDmmTypeLib.dll" no_namespace named_guids

#import

"GlobMgr.dll" no_namespace named_guids

#import

"IviSessionFactory.dll" no_namespace named_guids

#import

"IviConfigServer.dll" no_namespace named_guids

//using namespace IVICONFIGSERVERLib;

int

main(int argc, char* argv[])

{

HRESULT hr;

char

nombre[56];

 

hr = CoInitialize(NULL);

if

(FAILED(hr))

exit(1);

printf("introduzca el nombre del nuevo hardware: \n");

scanf("%s",nombre);

getchar();

{

IIviConfigStorePtr cs(

__uuidof(IviConfigStore));

//cs.Detach;

try

{

// Deserialize the master configuration store.

cs->Deserialize(cs->MasterLocation);

try

{

// Create an empty Hardware Asset

IIviHardwareAssetPtr ha(

__uuidof(IviHardwareAsset));

//Set its properties

ha->Name = _bstr_t(nombre);

ha->Description = _bstr_t("Multimeter connected to the switch");

ha->IOResourceDescriptor = _bstr_t("GPIB::22::INSTR");

// Add it to the global hardware asset collection

printf("hasta aqui");

IIviSoftwareModulePtr sm(

__uuidof(IviSoftwareModule));

sm->Name =_bstr_t(nombre);

sm->ProgID=bstr_t("Jolin");

 

cs->SoftwareModules->Add(sm);

cs->HardwareAssets->Add(ha);

}

catch (_com_error e) {

printf("Add HardwareAsset failed.\n");

printf("Error description is: %s\n",(

char*)e.Description());

//printf("%s");

getchar();

}

try

{

// Create an empty DriverSession

IIviDriverSessionPtr ds(

__uuidof(IviDriverSession));

// Set its properties

ds->Name = _bstr_t(nombre);

ds->Description = _bstr_t("DriverSession for the system multimeter");

ds->Cache =

true;

ds->InterchangeCheck =

false;

ds->QueryInstrStatus =

false;

ds->RangeCheck =

true;

ds->RecordCoercions =

false;

ds->Simulate =

false;

ds->DriverSetup = _bstr_t("");

// Add the HardwareAsset reference to the Session

ds->HardwareAsset = cs->HardwareAssets->Item[nombre];

// Add the SoftwareModule reference to the Session.

printf("hasta aqui");

ds->SoftwareModule = cs->SoftwareModules->Item[nombre];

// Add it to the global driver session collection

printf("hasta aqui");

cs->DriverSessions->Add(ds);

}

catch (_com_error e) {

printf("Add DriverSession failed.\n");

printf("Error description is: %s\n",(

char*)e.Description());

getchar();

}

try

{

// Create the Logical Name

IIviLogicalNamePtr ln(

__uuidof(IviLogicalName));

// Set its properties

ln->Name = _bstr_t(nombre);

ln->Description = _bstr_t("The name used in the test program");

ln->Session = cs->Sessions->Item[nombre];

// Add it to the global logical name collection

cs->LogicalNames->Add(ln);

}

catch (_com_error e) {

printf("Add LogicalName failed.\n");

printf("Error description is: %s\n",(

char*)e.Description());

getchar();

}

// Overwrite the master with the modified configuration store

try

{

cs->Serialize(cs->MasterLocation);

IIviSessionFactoryPtr spSF(

__uuidof(IviSessionFactory));

IIviDmmPtr spDmm = spSF->CreateSession(nombre);

}

catch (_com_error e) {

printf("Serialize failed.\n");

printf("Error description is: %s\n",(

char*)e.Description());

getchar();

}

}

catch (_com_error e) {

printf("Deserialize failed.\n");

printf("Error description is: %s\n",(

char*)e.Description());

getchar();

}

}

 

 

//getchar();

CoUninitialize();

return

0;

}

 

And other question: its possible make a software that can discover what class of intrument have you linked at network??

 

 

Excuse me by my english, and thank you for your help

0 Kudos
Message 3 of 9
(4,757 Views)
Hello Geodo,
       I am much more familiar with using IVI-C with LabVIEW and CVI.  I recommend that you contact Agilent technical support and see what they have to say.  They are probably some examples on their website also.  Do you have the instrument recognized and configured with the Agilent configuration program?  The easiest way that I could think of to programmatically determine which class of instrument was connected is to do an ID Query and they compare the results to all of the possible instruments you might be using.  Other than that, I don't know of any way to programmatically determine the class of a new instrument randomly placed on your network.

Cheers,

NathanT
0 Kudos
Message 4 of 9
(4,755 Views)
thank you Nathan.
 
I'm going to look for more information.
 
If anyone can said me some information, i agree him
 
i have other question ¿its really possible to make a software that speak with a LXI intruments within add anything dependent of the intrument?
 
Let me explain:

You can make a program with IVI-COM not need to know beforehand that instrument will always connect using VISA (IVI) drivers?
 
Thanks
 
 
0 Kudos
Message 5 of 9
(4,747 Views)
Hello Geodo,
          By using VISA, you can treat the instrument as a VISA resource.  As long as it is configured correctly, the application using VISA does not have know much about  the communication bus protocol (other than serial port settings).  Both IVI and Plug and Play Instrument drivers use VISA, so it is not IVI specific.

I think what you are looking for is called a Hardware Abstraction Layer(HAL) and it requires some effort to adequately define and implement the HAL level API that your top level application could call into.  The HAL layer would be between the top level application and your IVI-COM drivers, so it does not address your exact question.

If you are using IVI class drivers and IVI specific drivers, it is possible to interchange instruments without changing your application.

Please explain your overall end goal so we can better give you suggestions on how to get there.

Cheers,

NathanT
0 Kudos
Message 6 of 9
(4,710 Views)

Hi Nathan.

 

I have a source code which try to start communication with a instrument that i connect at network. I don't wnat to know what is the specific instrument. I use IVI-COM.

My code use IviConfigurationServer to configurate the ConfigurationServer. I configure the Hardware Asset (IOResourceDescriptor), Driver Session and SoftwareModule. And i add a logical name. I use the logical name to create a session:

IIviSessionFactoryPtr spSF(

__uuidof(IviSessionFactory));

IIviDmmPtr spDmm = spSF->CreateSession(nombre);

 

The problem is the Software Module. With IVI-COM i have to configurate a ProgID that the application will use to identifies what is the "driver" to use.

I don't know if it ProgID is somthing that the vendor have to pass to me or if there is a Prog ID by class instruments.

 

i have used an invented ProgID and the results its a exception:

Error description is: IIviSessionFactory: Session CLSID (NI_IDEA) not registered

 

Forgive my English

 

0 Kudos
Message 7 of 9
(4,706 Views)
How are you detecting the instrument when it is plugged in?  Do you already have the VISA resource configured?  You could possibly just have multiple logical names pointing to different driver sessions and then select the logical name based on the ID Query response from the VISA resource.  What is the end use-case of this application?

-NathanT
0 Kudos
Message 8 of 9
(4,679 Views)
The goal of my question is to know how to do a application which be able to communicate with any intruments using IVI-COM
 
i can'1 know what speccific intrument i will connect. it is because i need to know what i exactly need to communicate with a general instrument. non a speccfic model of aspecific intrument of a speciffic vendor..
 
i want a general IVI-COM client....
 
Thanks
0 Kudos
Message 9 of 9
(4,670 Views)