Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

labview to C++

When I used the labview program to convert to C++, I called lvanlys.dll and used the BWCoefs90 function, but there was a problem when calling lvanlys.dll. The error message: "labview.lib was not called from a LabVIEW process. ". How can I solve this? The code is as follows.
2. In addition, the data of type "InstanceDataPtr" appears in the function prototype of Hilbert transform. Is this the data of int32_t? Can I have a header file of this type?

 

#include<iostream>
#include<Windows.h>
#include<time.h>
#include<extcode.h>
#include<hosttype.h>
#include<dos.h>

typedef int(*Dllfun)(void *, void *, void *, void *, void *, const int32_t , void *, void *, int32_t *);

using namespace std;
int main()
{

Dllfun maopao1;
HINSTANCE hdll;

hdll = LoadLibrary("C:\\Users\\fs\\Desktop\\玻璃\\new\\USS9804 SDK光盘\\vs01\\DSP_BW\\lvanlys.dll");
if (hdll == NULL)
{

FreeLibrary(hdll);
}

maopao1 = (Dllfun)GetProcAddress(hdll, "BWCoefs90");
if (maopao1 == NULL)
{
FreeLibrary(hdll);
}
double fs[1] = { 500000 };
double fl[1] = { 480000 };
double fh[1] = { 520000 };
int order[1] = { 4 };
int type[1] = { 2 };
int32_t structure = 0;
int aH[20] = { 0 };
int bH[20] = { 0 };
int32_t dsperr[1] = { 0 };
int stass;

stass=maopao1(fs, fl, fh, order, type, structure, aH, bH, dsperr);
FreeLibrary(hdll);
getchar();

}

 

 

0 Kudos
Message 1 of 3
(2,974 Views)

Hi hhammer,

 

Can you describe what you used to convert from LabVIEW to C++?

 

Best,

Claire C.
AppSW Staff Product Support Engineer
National Instruments
CLD|CTD
0 Kudos
Message 2 of 3
(2,862 Views)

lvanlys.dll is specifically meant to be called from LabVIEW. Its parameters are LabVIEW handles and trying to call it from a non-LabVIEW process (or non LabVIEW build application) will almost always give you a runtime error that it could not link to labview.lib routines. There is no simple way to solve that as your non-LabVIEW process does not provide the necessary functions to implement LabVIEW array handle creation, resizing and destroying that this DLL wants to link too.

 

What is so magical about this function that you absolutely need to call it?

Much of the lvanlys.dll is simply a LabVIEW friendly wrapper around the actual Intel Math Kernel Library (MKL) and won't work without that library installed on the computer anyhow, so you might just as well simply install that and call it directly from your C/C++ program.

 

Didn't you see my reply in your previous thread about this issue?

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(2,813 Views)