From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Undefined symbol '_Ivi_GetErrorInfo

I have a PXI system with PXIe-8101 controller. I am running a realtime operating system. I am developing my code with LabWindows\CVI. One of the things I am doing is communicationg to a Agilent 3458A multi-meter on GPIB. There is a fp file and source code (hp3458a.c) with nice function calls for this meter. The functions in the make a lot of calls to the IVI:  Ivi_GetInfoFromResourceName(), Ivi_GetAttributeFlags(), Ivi_SetAttributeViString, etc. I get a bunch of link errors for these functions such as "Undefined symbol '_Ivi_GetErrorInfo".

 

I thought it might need IVI libraries so I tried to make it import an IVI library which was actually a random guess on my part. So I clicked on Build->Target Settings->Import Library Choices and checked the "Use IVI subdirectories" checkbox. Like I said it was a random guess on my part but it did not help anyway.

 

I wrote a CVI application that communicated with this device that ran on Windows operating system. I never had these linker errors with this. My guess is the projects to run on Windows OS automatically use this IVI jazz. Maybe there is a difference because on the Windows operating system I create a executable and on the real-time system the executable is in a DLL. I noticed the project for the realtime systen the Target Settings dialog looked different; it had more buttons.

 

I have two questions:

1.) How do I make these link errors go away?

2.) Will these work on my realtime system?

 

0 Kudos
Message 1 of 9
(5,354 Views)

DPearce,
The following article may help you with installing IVI support on your real-time target: Installing IVI Support for Real-Time Targets


In order to use the IVI library, you must first install IVI support on the RT target. This can be done by installing any Modular Instruments driver.

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(5,345 Views)

I have installed lots of things on my RT target but why am I getting the link errors. I didn't get them on the Windows applications but the RT application has them. Are there some libraries linked to the project in the Windows applications the the RT applications do not have? My problem is not the RT executable (yet) ; My problem is I cannot create the DLL.

0 Kudos
Message 3 of 9
(5,339 Views)

DPearce,

Here is the process that I followed to test this functionality on my machine. I was able to successfully build an RT dll.

 

Create a new folder and copy the example from \Program Files\IVI Foundation\IVI\Drivers\hp3458a\hp3458a_example.c to this new directory.


Create a new project in CVI and add the following files to the project:
- hp3458a_example.c
- hp3458a.fp (Use Instrument > Load... to navigate to \Program Files\IVI Foundation\IVI\Drivers\hp3458a\hp3458a.fp. Then drag this library from the Library Tree up to your Project Tree to add it to your proeject.)

 

Change the Target Type to .dll (since this is for an RT target)

Build > Target Type > Dynamic Link Library


Comment out both MessagePopup lines (61 and 69) in hp3458a_example.c, as these are Windows functions that aren't supported in the real-time environment.


Change the main function declaration (line 37) to the following: void myFunction ()


This is so we can add myFunction as an external function that can be called from the .dll that we are going to export. Eventually you will write all the functions that you need to call externally from your RT application in this manner.


Generate a header (.h) file that will include the functions that we wish to make public externally in our .dll.


/************** Static Function Declarations **************/

void myFunction ();

/************** Global Variable Declarations **************/

/************** Global Function Declarations **************/


Save the .h file and add it to our project. Your environment should look like below:

 

hp3458a_example.h.PNG

 

And the hp3458a_example.c file will look like below:


hp3458a_example.c.PNG


Change the Export settings to include this .h file:

  • Build > Target Settings... > Change >
  • Change the Export what: dropdown to Include file and marked symbols.
  • Check the hp3458a_example.h file.
  • Click OK to close the DLL Export Options Window
  • Click OK to close the Target Settings Window

DLLExportOptions.PNG

 

Lastly, we can build the project into a .dll that can be called on our RT target.

  • Build > Create Debuggable Dynamic Link Library

 

Then we will see the following successful build prompt:

 

BuildSuccess2.PNG

 

Can you please go through this process and see if you are also able to successfully build from this example?

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 9
(5,329 Views)

I don't have these files on my computer. I have the fp file because I archived it with my old CVI app. Do I need to install something on my computer? Maybe that is why I have the linker errors?

 

0 Kudos
Message 5 of 9
(5,315 Views)

DPearce,
Yes, this may be the issue. I was able to download and install these files from National Instruments' Instrument Driver Network at the following page:

 

Agilent Technologies hp3458a Meter

 

I chose the first download, LabWindows/CVI 8.5.

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 9
(5,306 Views)

It did not help. First I downloaded the exe and tried to run to a directory and ran the executable manuallly. Got an error message that it was not a valid Win32 executable. Wish I would have written down the whole message now. I exited the installation.

 

Next I clicked on download and let it run the installation automatically. Did not see an error message. But I still get the linker error messages when I try and build the dll.

 

What I think is a hint is when I build a project for a Windows application I do not have a problem. But when I build the DLL for my realtime OS on the PXI system I get these linker errors. Makes me think I have something in my project for the Windows application that allows some sort of IVI library. But in the project for RT it does not link in this IVI stuff.

 

A real puzzler.

0 Kudos
Message 7 of 9
(5,300 Views)

DPearce,

Are these errors appearing on your own project?

 

Did you try stepping through the example I posted? Do you still receive the errors when building this project from scratch?

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 9
(5,295 Views)

Your method worked.

The only diffference I see is when I created my project I created a project from a template. The template I chose was "Real-time Target Application." Intuitively I would think that is the right one.

It automatically makes selects the target as a DLL. And it makes my main function call:

void CVIFUNC_C RTmain (void)

 

Which is what I thought you are suppose to do.

 

I am using a document I found on the NI website "GettingStartedCVIRT.pdf" (374686D-01). It says you can create a project using these templates.

 

thanks,

Dazed and Confused

0 Kudos
Message 9 of 9
(5,289 Views)