LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

"Server Busy" error when I use CVI as ActiveX Automation Server in my VC++ project.

When I call CVI_AppBuildProject() for the first time,before completion,it will pop up a warning message "Server Busy":
"This action cannot be completed because the "LabWindows/CVI" program is not responding.Click the appropriate button on the task bar to activate the program and correct the problem."
My CVI project includes about 30 *.c files.It takes a long time to build.Is this the reason of "Server Busy"?
The error doesn't affect the running of my program at all.But I don't know why it occurs,what does it mean,and how to make it disappear.

Belows are part of my source code:

CVI_AppSetProjectTargetType (Handle, NULL,
CVIConst_CVI_TARGET_TYPE_EXECUTAB
LE,
NULL);

str = m_ProjectDir + "\\main.obj";
strcpy(path,str);
CVI_AppRemoveFileFromProject (Handle, NULL,path , NULL);
str = m_ProjectDir + "\\main.c";
strcpy(path,str);
CVI_AppAddFileToProject (Handle, NULL,path, NULL);
str = m_ProjectDir;
strcpy(path,str);
CVI_AppCreateObjectFile (Handle, NULL, path, 0, NULL);
//remove main.c from project
str = m_ProjectDir + "\\main.c";
strcpy(path,str);
CVI_AppRemoveFileFromProject (Handle, NULL, path, NULL);

//add main.obj to project
str = m_ProjectDir + "\\main.obj";
strcpy(path,str);
CVI_AppAddFileToProject (Handle, NULL, path, NULL);

CVI_AppBuildProject (Handle, NULL, NULL);
0 Kudos
Message 1 of 5
(3,282 Views)
There is an answer regarding a duplicate post of yours that you can view at

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000C52C0000&UCATEGORY_0=_46_%24_7_&UCATEGORY_S=0

Basically, Azucena responded asking if you had tried using the CVI_AppSetWarningBoxes server method to disable the warning boxes that pop-up due to server methods being called. Most of all we would like to know if the project was actually built after calling the CVI_AppBuildProject method, was it? If you are not certain if it completed correctly, after the call to CVI_AppBuildProject, can you call the CVI_AppGetCVIState method to see if it thinks that the project was successfully compiled and linked? This information would make it easier for us to
assess whether or not you are running into any real dysfunction. Thanks!

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 5
(3,282 Views)
Hi Lily,

I received the email and attachments that you sent to one of our web groups, but unfortunately your email was accidentally edited to the point that your email address was lost. Therefore, I have decided to respond to you here. If you prefer to contact our tech support team via email you can go to www.ni.com/ask and submit a technical support request directly to us.

When I tried running your VC++ automation controller project it built and executed successfully, but when I selected the cvi project you sent as the project to load/build inside of your PFT8801.exe app, it informed me that the following files were missing (an2000.fp, anEthd.fp, anTrc.fp, PCTest.fp, and PFT8801.fp). As you can guess without all of the files required for CVI to successfully build your CVI project I wasn't able to get far enough to reproduce the problem you are seeing. In short, I will need all of the files required to build ever piece of both projects in order to witness the same behavior you are witnessing, so could you please submit them to me again?

I do appreciate the elaboration you gave me in terms of trying the solutions we suggested, but I was wondering about a couple of more things as well. Did you receive an automation error when setting the warning boxes to off with CVI_AppSetWarningBoxes, because really this is supposed to suppress them? It might be possible that the server is busy when this function is invoked as well, so you might try executing it as soon as you invoke the environment to load instead of the problem area you have encountered with the invoking of a build.

Other than that, since you have determined that the project does successfully build even though you have received this error, how vital is it that this does not show up? One possible workaround I can think of to remedy this is trying to use the CVI_AppGetCVIState function to see if anything unusual is reported before you try to invoke a build, because if CVI stays in this "busy" state for a limited amount of time you may be able to wait in a deterministic loop until it returns to a normal state to invoke the build method. Just an idea, but worth a try. I cannot find any instances of someone receiving this warning due to calling the build method so we may have to find a new workaround to suppress this warning, if it is vital that it is not shown.

Anyway, please re-submit your files to me as well as providing the additional info I requested. Thanks!

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 3 of 5
(3,282 Views)
Hi Jason F.!

Sorry I forgot to transfer that files last time.I send them now.Please place the folder PFT8801 & subfolders under C root directory.("c:\\PFT8801\\...")
If still cannot wok,please copy all the DLLs to windows system directory.

I've tried CVI_AppSetWarningBoxes as soon as I load CVI,but still of no use.
When I call CVI_AppGetCVIState() before CVI_AppBuildProject(),projectExecutionState & intWinExecutionState report CVIConst_CVI_EXECUTION_NONE,others 0.

It's not a serious problem to my project indeed.I just want to make my project as perfect as I can.Curiosity to know why is another reason.So if it is difficult to find out,don't waste your time,just forget it.

Thanks again for your help!
Lily
0 Kudos
Message 4 of 5
(3,282 Views)
Sorry for the delay in my reply, and thank you for posting the missing files I needed.

Well, I have some news but it may be good or bad depending on how you look at it. I'm not sure what version of LabWidows/CVI you are using, but I tried your VC++ client project again (in VC++6sp5) with all of the required files and it successfully launched CVI 6.0 and built the project as you described WITHOUT showing any warning boxes at all. So even though this might be a different version than the one you are using, if there was any problem, we will have to summise that it has been fixed (if there really was a problem with the environment itself, it may only happen on a few select machines such as yours).

CVI 6.0 is the only version that National Instr
uments is currently developing on and will be viewed as the "patch or update" that fixes problems found in previous versions.

Again, sorry about the delayed response, but I hope this gives you some hope that the problem can be worked around. If you would like information on ordering the latest version of CVI (which is now a part of Measurement Studio) you can go to the online catalog at http://sine.ni.com/apps/we/nioc.vp?lang=US&pc=bypsc&cid=3769 for ordering information.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 5 of 5
(3,282 Views)