Installation et configuration du pilote IVI MPE
Ressources importantes :
- Guide de démarrage IVI de l'IVI Foundation
- Projets d'exemples de programmation IVI MagnaDC de Magna-Power Electronics (C# et Visual Basic)
- Projets d'exemples de programmation IVI MagnaLOAD de Magna-Power Electronics (C# et C)
Prérequis :
- Environnement de développement tel que Visual Studio Express 2008
- Composants partagés de l'IVI Foundation
- Gestionnaire de ressources global VISA-COM (choisir un seul)
- National Instruments NI-VISA : Accepter tous les paramètres par défaut lors de l'installation, ou
- Agilent IO Libraries Suite : Installer en tant que VISA principal et accepter tous les paramètres par défaut
- National Instruments NI-VISA : Accepter tous les paramètres par défaut lors de l'installation, ou
- Pilote IVI Magna-Power Electronics (MPE). Voir Téléchargements du support.
Remarque : L'installation du pilote MPE-IVI échouera si les composants partagés de l'IVI Foundation ne sont pas installés au préalable. Le pilote MPE-IVI affichera un avertissement, Figure 1, si un gestionnaire de ressources global VISA-COM n'est pas installé. Le VISA-COM peut être installé avant ou après le pilote MPE-IVI.
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).
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
Le Gestionnaire de configurations est maintenant sélectionnable depuis le menu Build (Figure 5).
Dans le Gestionnaire de configurations, sélectionnez dans le menu déroulant Plateforme de solution active (Figure 6).
Sélectionnez x86 dans le menu déroulant de la plateforme et cliquez sur OK (Figure 7).
Cliquez sur Fermer. Votre exécutable fonctionnera désormais en tant qu'application 32 bits, même sur une version 64 bits de Windows.
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.