Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

C# IVI logical names list?

Hello,

I am using C# with Measurement Studio and Visual Studio. I want to read a list of the IVI logical names defined by MAX, but I can not find any class/method to do this within the Measurement Studio .net classes.

Thank you in advance
Roland Gesche
0 Kudos
Message 1 of 3
(3,902 Views)
Hello Roland,
We do not currently offer .NET API's for IVI drivers in Measurement Studio. However, you should be able to use the IviConfigServer COM component through .NET interop in your application. You can add a reference to the component by selecting "Ivi Configuration Server 1.0 Type Library" from the COM tab of the "Add Reference..." dialog.

Here is an example of how you might use the COM component in .NET. In this code, I populate a comboBox on my user interface with a list of all the Logical names in the system:

using Ivi.ConfigServer.Interop;

private void PopulateComboBox()
{
IviConfigStoreClass configStore = new IviConfigStoreClass();
string masterLocation = configStore.MasterLocation;

configStore.Deserialize(masterLocation);

foreach (IviLogicalName logicalName in configStore.LogicalNames)
{
comboBox1.Items.Add(logicalName.Name);
Console.WriteLine(logicalName.Name);
}
}
0 Kudos
Message 2 of 3
(3,901 Views)
Thank you very much, it works.

Roland Gesche
0 Kudos
Message 3 of 3
(3,896 Views)