LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error 1097 in call library function

Hi Guenter Mueller

 

Now i have exported all the main functions relating to loading of mpusbapi.dll file . I have  exported  the  Load Dll () ,

 

AbrirTAD () function which is for opening operation and CerrarTAD () function which is for closing operation. Now i am calling all these three functions from my VI.

 

Now as i run my program again error 1097 occurs , when i press continue, this error again occurs and when i again press continue , a new error occurs which is in the attached doc file. 

0 Kudos
Message 11 of 34
(2,083 Views)
h
Message Edited by mhs100 on 10-18-2009 12:35 PM
0 Kudos
Message 12 of 34
(2,083 Views)
The Visual Studio Debugger is quite clever. If it says, you are using the wrong calling convention, you can trust. If I remember correctly, you have configured the Call Library Function Nodess to use cdecl. Try stdcall instead. Or make sure that all of your exported function have the same calling convention, e.g. by specifying
__declspec(dllexport) __stdcall FunctionName (/*parms*/)
Guenter
Message 13 of 34
(2,075 Views)

Hi

 

Now when i am exporting all functions by using Std Call , the compiler gives 3 errors . I am now using  module definition .def method for exporting functions to avoid name mangling but i cant understand why there are errors while compiling.

0 Kudos
Message 14 of 34
(2,058 Views)
I am sorry i forgot to attach the file.
0 Kudos
Message 15 of 34
(2,055 Views)
The 3 errors come from your insertion of the definitions in .CPP. This is expected to be in a .DEF file. See the attached stuff.
Hope this helps, Guenter
Message 16 of 34
(2,047 Views)

Hi

 

Thanks for the sent file , now the 3 errors are removed and dll is made successfully. In labview , i am using std calling convention but still the same errors occur which i sent you before in the doc file . First error 1097 occurs , when i continue again error 1097 occurs . If i again press continue the visual studio compiler gives the errors. 

 

Now all the functions in my dll code have the same calling convention that is std calling convention then why the visual studio compiler gives the error of wrong calling convention?

 

One more thing that please check the function Invalid error handle () and  send receive packet ().

 

Do i have to export these functions also?

 

I can't understand where the problem is. Why the daq is not communicating with labview. On the other hand the code in the pic controller of daq card is correct .Ihave checked .

 

The attached file mhsdll +def  contains the correct code and i am also sending the VI. The errors are the same as in the above doc file. 

 

Download All
0 Kudos
Message 17 of 34
(2,022 Views)

You may want to consider looking at the return types in the dll calling parameters. Are you sure they should be return by value rather than Pointer to Value ?

 

Also, make sure that the variable being used to store the returning value has been initialized.

 

Additionally, I believe that a return value for each of the parameters being passed must be declared in the call to the dll.

0 Kudos
Message 18 of 34
(2,014 Views)

Hi

 

I dont think that the error is arising because of any of the incorrect data types. Please reply to my last post . 

0 Kudos
Message 19 of 34
(2,009 Views)

I have a question to ask that  the code of my dll which is mhsdlldef.zip . In this code ,  i have exported all the main functions such as   salidasdigitalesByteTAD() for digital outputs, salidasanalogicasTAD() for pwm output etc.

 

Almost all of the functions use sendReceivePacket()  functions in them , but i did not export sendReceivePacket() function .

 

The Question is 

 

1) Do i need to export SendReceivePacket() function ? This function is used in every other functions body.

 

If i have to export this function also then the second question is

 

2) What values will i give to its parameters in the labview VI ? Because this function has six arguments and a return value , whose values are continuouly changing depending on the  function in which this function is called.

 

Regards

mhs100 

  

0 Kudos
Message 20 of 34
(1,997 Views)