Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

error in calling the DLL function

Hi everyone,

I hope someone could help me.

Well, I have a problem when calling the dll. Every time I launch my program I am geeting this error: 1097

It is the first time I am using a dll in a VI.

I have attached to this message, the dll file and the header .h

 

Thans in advance,

Feriel

Download All
0 Kudos
Message 1 of 5
(4,015 Views)

Hello,

 

I have seen in the header file the mention "_stdcall" which refers to a specific calling convention , you can select it in the function tab of the clf block.

 

Could you confirm me that the dll has been written in C ? ( Or C++ ? )

 

I suggest you to consult this page if the problem is not resolved by changing the calling convention :

 

http://forums.ni.com/t5/LabVIEW/Error-Code-1097-Coming-in-DLL-Calling/td-p/1847055

 

Cordially

 

Arnaud

GENEBRIER

 

 

Ingénieur d'Application | (NI France)
Message 2 of 5
(3,976 Views)

Hello, 

I selected stdcall. I am not sur if the dlls were written in C++.  How can I know it?

          ------

I succeded in resolving the problem. 

I was getting this error because I didn't respect the calling order of the functions. I started with OpenInstr() while I should have been calling 3 other functions before. 

Now I respected the order, I have zero errors.

 

Thanks for you help, 

Regards, 

F

 

0 Kudos
Message 3 of 5
(3,903 Views)

Hello,

 

Thank for the feedback.

 

Could you precise me which calling convention have you used ?

 

Cordially

 

Ingénieur d'Application | (NI France)
0 Kudos
Message 4 of 5
(3,889 Views)

Well,

In the vi I sent you, I was calling directly CommSetupPort. I had to call ConstructInstrDriver then SelectInstrDriver before. This was written in the SDK manuel of the instrument.

And since the DLLs was using the software privided with the instrument, I had to construct the instrument driver and register before doing any other thing.

PS: ConstructInstrDriver & SelectInstrDriver  are two functions allowing to creat the instrument driver in memory and verify registration.

 

Regards,

F

 

 

 

0 Kudos
Message 5 of 5
(3,883 Views)