LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error 1097 in call library function

Hi all

 

I have made my own dll in visual C++ which calls another dll named mpusbapi.dll . When i run the labview program

 

Error 1097 occured, exception in the external code "Possible reason(s):

LabVIEW:  An exception occurred within the external code called by a Call Library Function Node. The exception may have corrupted the LabVIEW memory. Save any work to a new location and restart LabVIEW."

 

 

0 Kudos
Message 1 of 34
(6,934 Views)
It seems that your DLL or the way you pass parameters between LabVIEW and the DLL causes the problem.
Tip: Search the support page for this error code (just type in 1097). You will get lots of matches as you are not the first who faces this situation.
It that doesn't help: Try to be more specific and let us know more details about the function call that causes the crash.
Hope this helps, Guenter
Message 2 of 34
(6,921 Views)

Hi

 

Thanks for your reply 

 

Actually i am trying to communicate with a usb daq card.In the folder mhs VI , there are two dll files one is mpusbapi.dll and the other one which i created is mhs.dll . The coding of mhs.dll is also attached . It is in mhsdll folder. In the coding mpusbapi.dll is called and the functions which i want to export are with the keyword __declspec(dllexport).

 

In my VI , i have used two features of DAQ card that are digital outputs and pwm outputs and used the functions salidasDigitalesByteTAD() and SalidasAnalogicasTAD() respectively. Every time i run my application , the error 1097occurs.

 

The data types are also matched.  In the coding of mhs.cpp ,the argument of both the above mentioned functions

are DWORD . I used usigned 32 bit integer in labview. I would also like to mention that the VID and PID of my usb daq card is also defined in the coding mhs.cpp. Please Check it. 

 

Any help greatly appreciated.

 

Regards

mhs100 

Download All
0 Kudos
Message 3 of 34
(6,914 Views)

This seems to be the same as this message and this message and this message and this message and this message.

 

I don't know what more information you expect to get that you haven't already gotten by posting the same question over and over again.

Message 4 of 34
(6,908 Views)

Hi smercurio_fc

 

I am not fond of posting same question again and again. If I am doing this , it means that my problem is still

unsolved. All the time you have gathered my posts instead of answering.

 

 

I am not expecting this reply. 

0 Kudos
Message 5 of 34
(6,900 Views)
Simon, maybe your VI crashes because it never calls the function "LoadDLL()" to load the mpusbapi.DLL. The global variables myOutPipe and myInPipe never get initialised, either...
How about debugging this DLL by using Build >> Start Debug >> Go in Visual Studio and then selecting LabVIEW.EXE as the caller of the DLL. This should help in finding the function call that produces the error code.
It seems, that your function prototypes in the .cpp match to the Call Library Function Nodes in LabVIEW. So I do not expect any trouble here.
Guenter

Message 6 of 34
(6,899 Views)
Yes, Steve. You are right. All the messages seem to deal with the same issue. Thanks for pointing it out.
And, Simon: Setting up one (!) post for one and the same issue and let people see the status quo is better practice. If your thread seems to starve, add a new message and tell us, that the problem still exists.
I am sure, that almost nobody wants to waste his time for answering an issue that has been posted by the same contributor before.
So, please: Start making it better and use this thread as long as your issue is "living".
Guenter
Message 7 of 34
(6,896 Views)

mhs100 wrote:

Hi smercurio_fc

 

I am not fond of posting same question again and again. If I am doing this , it means that my problem is still

unsolved.


Then what you should be doing is posting more information in your original thread saying "This didn't work, what else can I do?" instead of starting a new thread.  For people who may not have seen your original post (and any of the later ones), you're just forcing them to start at square one when trying to help you instead of picking up at square 4 which is where you have gotten to.

Message 8 of 34
(6,892 Views)

Ok.

 

The function loaddll () has no return type nor any argument. If i want to call this in VI then i have to select it from the list and thats all.

 

There will be no inputs and outputs of this call library function. 

0 Kudos
Message 9 of 34
(6,891 Views)

Right you are, Simon.
This is an issue that you can improve: This function call loads the mpusbapi.DLL and retrieves the function pointers from the DLL. If anything goes wrong (e.g. DLL not found) it simple uses "exit(1)" without good reason. Better: Use a return value to indicate the result of the function call.

Guenter

Message 10 of 34
(6,884 Views)