VisionPro 关闭程序断开相机连接
作者:互联网
退出程序或发生异常需要断开相机连接时,可调用此方法
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,cameras,关闭程序,相机,ex,CogFrameGrabberGigEs,using 来源: https://www.cnblogs.com/passtime/p/14543775.html