Loading/Unloading Instrument Drivers
You can load and unload instrument drivers manually using the Instruments Folder in the Library Tree or using the Instrument menu. Instrument drivers loaded through the Instruments folder or Instrument menu do not have to be listed in the project, and you can load or unload them at any time except during program execution. You also can load instrument drivers by dropping .fp files onto the Library Tree directly.
To incorporate instrument drivers into the project, select File»Add to Project in a Function Panel window or the Function Tree Editor or select Edit»Add Files to Project in the Workspace window. If you drop the .fp file onto a project in the Project Tree, LabWindows/CVI adds the file to the project and loads the instrument driver if the project is the active project. If you drop the .fp file onto a non-active project, LabWindows/CVI adds the .fp to that project, but does not load the .fp. If you drop the .fp file onto the Library Tree, LabWindows/CVI loads the instrument driver but does not add it to any project. The .fp file represents the instrument driver in the project. If the .fp file is in the project when you open the project, LabWindows/CVI automatically loads the instrument driver and removes it when you unload or deactivate the project.
If you open an instrument driver using the File»Open option, the instrument driver opens in the Function Tree Editor but LabWindows/CVI does not load the program file attached to the instrument driver.
Precedence Rules for Loading the Instrument Driver Program File
When you load a .fp file, LabWindows/CVI loads the instrument driver program file. In some cases, you might have an instrument driver program file in more than one format. For instance, you might have fl8840a.obj and fl8840a.c in the same directory, which can occur when you obtain the source code for the instrument driver and then compile it. LabWindows/CVI chooses which file to load according to the following rules:
- If an instrument driver program file is in the project, LabWindows/CVI loads it. There can be at most one unexcluded program file with the same base name as the .fp file in the project list. Thus, x.obj and x.c cannot be in the project list at the same time unless you exclude one or both of them.
- If both of the following conditions apply with VXIplug&play instrument drivers, the .lib file is associated with the .fp file.
- The .fp file is under the VXIplug&play framework directory.
- A .lib file is in the lib\msc folder of the VXIplug&play framework subdirectory
- If both of the following conditions apply with IVI instrument drivers, the .lib file is associated with the .fp file:
- The .fp file is under the IVI Standard Root directory.
- A .lib file is in the Lib\msc folder of the IVI Standard Root directory.
- If an instrument driver program file is on disk in the same directory as the .fp file, LabWindows/CVI loads it with the following precedence:
- .lib
- .obj
- .c
Loading an Instrument without an Instrument Program
You can load a .fp file as an instrument, even if no program file exists for it. In this case, LabWindows/CVI does not associate a program with the .fp file. Nevertheless, the .fp file appears in the Instruments folder and the Instrument menu.
Loading a .fp file without a program is useful if you want to use .fp files to document functions in your project. When you do not provide a program file for the .fp file, you cannot execute the function panels, but you can insert code into Source windows from them.
If you try to execute an instrument driver function panel without an associated program, LabWindows/CVI reports a run-time error. You can attach a .c file to a .fp file after you load the .fp file or run the program file search algorithm in the Edit Instrument dialog box by selecting Attach and Edit Source.