LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get rid of the error-"CVI has detected inconsistency in runtime stack.This may be due to calling convention mismatch in last function call."

Hi,
 
I am getting the following error when i am trying to debug my Labwindows/CVI code.The strange thing is earlier it worked fine without giving any error.Now it is giving this error.We are using Labwindows/CVI 8.1 Version.
 
The error is CVI has detected inconsistency in runtime stack.This may be due to calling convention mismatch in last function call.
 
I have also tried by verifying that Build options->Default Calling Convention.
 
Please provide some solution for this.Waiting for ur reply.
 
Regards,
Harika.
Honeywell Technology Solutions Lab(HTSL),
Bangalore.
0 Kudos
Message 1 of 15
(5,851 Views)
Hi Harika,

Several days ago I responded to another customer receiving that same error at this post. Read my response and see if that helps.  If not, let me know.

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 2 of 15
(5,844 Views)

Hi jonathan,

Thanks for your reply.

But i tried like that also.i.e., in options->Build Options->Default calling convention.

Here Default calling convention is _cdecl,I declared my functions in header file like that only but then also it is not working.

Please provide some solution for this.

Eagerly waiting for ur reply.

Regards,

Harika,

Honeywell technology Solutions Lab(HTSL),

Bangalore.

 

0 Kudos
Message 3 of 15
(5,834 Views)
Hi Harika,
 
In that case it doesn't make a lot sense to me why you would be receiving that error. Can you post some simple code that demonstrates the problem?
 
Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 4 of 15
(5,829 Views)
Hi,
 
I am attatching the snapshot of my code where i am getting this error.
In this code,using Load Library and GetProcaddress i am able to get the address of the function.
But while calling the function i am getting this error.
In this ,the default calling convention is _cdecl.So i have declared my functions like that only.
 
Can u give me any (local)contact number related to NI which could help me in solving this issue as soon as possible.Because solving this is very urgent issue.
 
Please provide solution for this.
 
Regards,
Harika,
Honeywell Technology Solutions Lab(HTSL),
Bangalore
0 Kudos
Message 5 of 15
(5,811 Views)
How is MYPROC1 defined? That appears to be the key to your problem.
--
Martin
Certified CVI Developer
0 Kudos
Message 6 of 15
(5,810 Views)
Hi,
 
MYPROC1 is a pointer to the function of the given prototype. It holds the address of the function of that type.
It is not defined anywhere.It is just like temperory pointer variable.
 
Regards,
Harika,
HTSL,
Bangalore
0 Kudos
Message 7 of 15
(5,807 Views)

Hi,

I am attatching the snapshot related to that MYPROC1.

It may give you idea about that MYPROC1 function pointer.

Regards,

Harika,

HTSL,

Bangalore 

0 Kudos
Message 8 of 15
(5,805 Views)

I don't think you need to upload a 4.7MB picture to convey one line of code! Can you not just cut and paste text?

The function prototype for MPROC1 should be declared _stdcall, not _cdecl. I don't currently have NI-SWITCH installed so cannot check myself: you should also check that the parameter definitions in MYPROC1 are correct for the function being called.

 

--
Martin
Certified CVI Developer
0 Kudos
Message 9 of 15
(5,801 Views)
Hi Harika,

Depending upon what type of support your company has, you could either phone or email your local NI support engineers. This link takes you to our technical support page where you can choose which option you would like.
Of course, you may have already solved the issue by now. If you would like to continue troubleshooting on the web, the next step I would suggest is to post some small sample code that demonstrates the behavior.

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 10 of 15
(5,772 Views)