Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

VBAU Engine sometimes can't open vbai file

Hello,

 

I've written a C# program as user interface. The program runs VBAI Engine. Sometiimes Engine can't open the vbai file. After restarting Windows 10 programs work fine again. Has anyone ID?

 

 

0 Kudos
Message 1 of 3
(939 Views)

After failing in loading that inspection file, did you try loading it from the VBAI interface instead ?

And by the way , did you check that the file wasn't already loaded (in another vbai instance) ?

 

Sami

0 Kudos
Message 2 of 3
(905 Views)

No, I did not try to open the inspection in Vision Builder after fail. But I always check if inspection is open in engine before I try to open. My program enters into catch thread: Another interesting thing. Sometimes I could not close. So, I have to kill every process named Vision Builder when my program starts. 🙂  

 

private int SetInspection(string VBAIEnginePath) //Beállítjuk az inspection-t
{
InspectionInfo ActualInspectionInfo;

try
{
WriteLocalLog("Checking current loaded inspection path. " + VBAIEnginePath + " VBStatus=" + VBStatus.ToString(), false);
ActualInspectionInfo = engine.GetInspectionInfo();
}
catch
{
WriteLocalLog("Checking current loaded inspection path is fail. " + VBAIEnginePath + " VBStatus=" + VBStatus.ToString(), true);
return 1;
}

if (VBAIEnginePath != ActualInspectionInfo.path)
{
WriteLocalLog("Actual opened path is different or no opened inspection. " + "VBStatus=" + VBStatus.ToString(), false);
if (System.IO.File.Exists(VBAIEnginePath))
{
try
{
WriteLocalLog("Setting rider's combo box to last selected item... " + "VBStatus=" + VBStatus.ToString(), false);
engine.OpenInspection(VBAIEnginePath);
return 0;
}
catch
{
WriteLocalLog("Can't open the inspection, named: " + VBAIEnginePath + " VBStatus=" + VBStatus.ToString(), true);
return 2;
}
}
else
{
WriteLocalLog("Inspection does not exists. " + "VBStatus=" + VBStatus.ToString(), true);
return 9;
}
}
return 0;
}

0 Kudos
Message 3 of 3
(891 Views)