From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-02-2013 11:45 AM
I am using the CviServer function CVI_AppGetCVIState and find that if I get the state of a 2013 project it takes 500 times longer than getting the state of a 2012 or less project. As my software calls this function repeatedly it is completly messing things up for me. Can you help.
Gus
Solved! Go to Solution.
12-03-2013 09:41 AM
Hello gusscott!
The symptom you are seeing with CVI 2013 is a known issue in CVI 2013. The issue has been fixed in the last CVI 2013 Patch f1, so we highly recommend you to perform this update. You should also consider using the improved version of this function, called GetCVIStateEx, which is intended to address this slowdown. You can track this bug fix with ID 425248, in the following KB document: http://digital.ni.com/public.nsf/allkb/B632593DECA1F0C986257BF600766F03 related to the CVI 2013 Patch f1.
Hope this helps!
12-03-2013 10:57 AM
Hi jay_tee,
Thank you for your response. Recompiling the code in 2013 with the patch and using GetCVIStateEx certinly makes things faster but that is not the problem. The problem is that when the active app is a 2013 project (CVI_ActiveApp) the CVI_AppGetCVIState function call takes longer.
my code is compiled in 2012 and I really do not want to recompile my code in 2013 as i only have the demo version.
here is my test code.
int __stdcall WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, int nCmdShow)
{
int CviAppHnd;
enum CVIEnum_CVIExecutionState ExState,IntExState;
long WaitingOnUserResponse=0;
long CompiledLinked,IntCompiledLinked,RetVal;
int t;
HRESULT s;
CA_InitActiveXThreadStyleForCurrentThread (0, COINIT_APARTMENTTHREADED);
CVI_ActiveApp (NULL, 1, LOCALE_NEUTRAL, 0, &CviAppHnd);
/*******************************************************************/
/* call CVI_AppGetCVIState and display the time it takes to call */
/*******************************************************************/
t= clock();
s=CVI_AppGetCVIState (CviAppHnd, NULL, &CompiledLinked, &ExState, &IntCompiledLinked, &IntExState,
&WaitingOnUserResponse, &RetVal);
FmtOut("time taken = %i status = %x\n", clock()-t),(int)s;
CA_DiscardObjHandle(CviAppHnd);
/********************************************/
/* display results until user presses a key */
/********************************************/
do{ProcessSystemEvents();}while(!KeyHit());
return 0;
}
when the above code is compiled to an executable and run when a 2012 project is active and when a 2013 project is active, the difference can clearly be seen.
Gus
12-04-2013 06:26 AM
Hello gusscott!
In order to automate your CVI 2013 (Patch f1) through an application built with CVI 2012 (SP1), you have to use an ActiveX Controller from CVI 2013 into your CVI 2012 program and use GetCVIStateEx to improve your application's performance.
For example you can try the following:
Please let me know if this works for you!
Best regards!
12-04-2013 04:06 PM
Hello Jay_tee
Thank you
Copying the CviSrv library from CVI 2013 and including it in my 2012 project worked just fine when I recompiled my code.
Although this would suggest that that all programs created with previous versions of CVI and using the CviSrv library will need to be recompiled for use with CVI 2013. However your help has been invaluable and I am now up and running again.
Regards Gus
12-05-2013 02:06 AM
Wow, scott! I'm am very glad that it eventually worked out for you!
Best regards!