Knowledge Base

Installation und Konfiguration des MPE IVI-Treibers

Wichtige Ressourcen:

Voraussetzungen:

  1. Entwicklungsumgebung wie Visual Studio Express 2008
  2. IVI Foundation Shared Components
  3. VISA-COM Global Resource Manager (nur einen auswählen)
    1. National Instruments NI-VISA: Übernehmen Sie bei der Installation alle Standardeinstellungen, oder
      1. Agilent IO Libraries Suite: Als primäres VISA installieren und alle Standardeinstellungen übernehmen
  4. Magna-Power Electronics (MPE) IVI-Treiber. Siehe Support-Downloads.

Hinweis: Die Installation des MPE-IVI-Treibers schlägt fehl, wenn die IVI Foundation Shared Components nicht zuerst installiert wurden. Der MPE-IVI-Treiber gibt eine Warnung aus (Abbildung 1), wenn kein VISA-COM Global Resource Manager installiert ist. VISA-COM kann vor oder nach dem MPE-IVI-Treiber installiert werden.

Abbildung 1. Fehlermeldung des MPE-IVI-Treibers, wenn die IVI Foundation Components nicht installiert sind.
Abbildung 1. Fehlermeldung des MPE-IVI-Treibers, wenn die IVI Foundation Components nicht installiert sind.

Using the IVI Driver

Reference the IVI Drivers

Before you can utilize the IVI Driver, you must add a reference to it. In Solution Explorer, right click on your Visual Studio project and click Add Reference… Select the COM tab (Figure 2) and then select the IVI MPEIVI 1.5 Type Library and click OK. Note: This will automatically add a reference to IviDCPwrLib and IviDriverLib (Figure 3).

Abbildung 2. Fenster „Verweis hinzufügen" im Projektmappen-Explorer.
Abbildung 2. Fenster „Verweis hinzufügen" im Projektmappen-Explorer.
Abbildung 3. Verweisliste im Projektmappen-Explorer.
Abbildung 3. Verweisliste im Projektmappen-Explorer.

Ensure the target platform is 32-bit (x86)

Since the IVI driver is a 32-bit COM driver, it can only be accessed from a 32-bit executable. By default, .NET programs will run in the native architecture of the operating system. However, a 64-bit program cannot access a 32-bit COM driver, so the target platform must be changed to force the program to run in 32-bit (x86) mode if your application will be used on a 64-bit version of Windows.

Special Instructions for Visual Studio Express Users

By default, Visual Studio Express hides the configuration options that allow you to select the target platform. To enable these configuration options (Figure 4):

  • Check the box labeled Show advanced build configurations
  • Select Projects and Solutions in the left panel
  • Check the box labeled Show all settings in the bottom left
  • Select Tools -> Options from the menu
Abbildung 4. Optionenfenster von Visual Studio Express.
Abbildung 4. Optionenfenster von Visual Studio Express.

Der Konfigurations-Manager ist nun über das Menü „Erstellen" auswählbar (Abbildung 5).

Abbildung 5. Konfigurations-Manager ist nun über das Menü auswählbar.
Abbildung 5. Konfigurations-Manager ist nun über das Menü auswählbar.

Wählen Sie im Konfigurations-Manager aus dem Dropdown-Menü „Aktive Projektmappenplattform" (Abbildung 6).

Abbildung 6. Optionen des Konfigurations-Managers für aktive Projektmappenplattformen.
Abbildung 6. Optionen des Konfigurations-Managers für aktive Projektmappenplattformen.

Wählen Sie x86 aus dem Plattform-Dropdown und klicken Sie auf OK (Abbildung 7).

Abbildung 7. Fenster „Neue Projektmappenplattform" des Konfigurations-Managers.
Abbildung 7. Fenster „Neue Projektmappenplattform" des Konfigurations-Managers.

Klicken Sie auf „Schließen". Ihre ausführbare Datei wird nun auch auf einer 64-Bit-Version von Windows als 32-Bit-Anwendung ausgeführt.

Common Errors

Problem: Exception "Could not create instance of VISA-COM Global Resource Manager Component. Make sure it is installed properly."
Solution: Install either National Instruments NI-VISA or Agilent IO Libraries Suite.

Problem: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {AD29F3FC-CAA9-4E18-A89F-010DEBAE7590} failed due to the following error: 80040154.
Solution: Make sure the MPE IVI driver is installed. If this error occurs on 64-bit Windows, make sure the application has been set to run as 32-bit (x86).

Problem: COMException (0x80047060) MPEIVI: Unknown resource.
Solution: Make sure the resource descriptor is correct and the power supply is on and accessible. Several example resource descriptors can be found in the IVI Driver Example source code.

Originally published Februar 3, 2018

Stay connected and informed.

Subscribe to receive emails—no more than once per month—with new technical articles, product releases and factory updates from Magna-Power.

Have any questions or feedback?
We'd love to hear from you.
Contact us