1 using Cognex.VisionPro.FGGigE; 2 using Cognex.VisionPro.FGGigE.Implementation.Internal;
3 //关闭相机连接,防止程序报错 4 CogFrameGrabberGigEs cameras = new CogFrameGrabberGigEs(); 5 6 try 7 { 8 foreach (CogFrameGrabberGigE item in cameras) 9 { 10 item.Disconnect(false); 11 } 12 } 13 catch (Exception ex) 14 { 15 //Log.WriteTxt(ex.Message); 16 }
VisionPro 关闭程序断开相机连接
退出程序或发生异常需要断开相机连接时,可调用此方法