Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

GetVBAIEngineStatus does not return when compiled in CVI

Solved!
Go to solution

This project uses Visual Builder AI 2019 (64 bit) managed by the main application written in Labwindows/CVI 2019.  I'm unable to get the VBAI Engine status in CVI when the application is compiled.  When in debug, the status function works as expected returning a value associated with the current status of VBAI.  Once the CVI program is compiled (in 64 bit), the Get VBAI Engine Status function returns junk; the variable appears to be uninitialized.

 

//Check VBAI engine is running
vbaiGetVBAIEngineStatus (VBhandle, &VBstat, ctextBuffer, sizeof ctextBuffer);
if (VBstat < 1 || VBstat > 3){
	char 	cErrorbuffer[100] = {""};
	switch (VBstat){
		case 0:
			strcpy (cErrorbuffer, "Offline");
			break;
		case 4:
			strcpy (cErrorbuffer, "Inspecting");
			break;
		default:
			strcpy (cErrorbuffer, "Unknown");
			break;
	}
	sprintf (ctextBuffer, "%s%s%s", "There is a problem with Vision Builder AI.\nVBAI reports \"",
				 cErrorbuffer, "\".\nContact Test Engineering for support");
	MessagePopup ("VBAI Error", ctextBuffer);
	return -30;
}

 

The debug directory is the same as the compiled directory.  What am I missing?

0 Kudos
Message 1 of 2
(1,760 Views)
Solution
Accepted by topic author Pinball4Me

Answering my own question; if the VBAIStatus variable is initialized to 0 when it is declared, the status function updates this variable correctly.  The Engine Status is now correctly reported.

0 Kudos
Message 2 of 2
(1,707 Views)