public void Connect() { // Open MultiCam driver MC.OpenDriver(); // Create a channel and associate it with the first connector on the first board MC.Create("CHANNEL", out channel); MC.SetParam(channel, "DriverIndex", 0); }
private void MainForm_Load(object sender, System.EventArgs e) { // + PicoloVideoTrigger Sample Program try { // Open MultiCam driver MC.OpenDriver(); // Enable error logging MC.SetParam(MC.CONFIGURATION, "ErrorLog", "error.log"); // Create a channel and associate it with the first connector on the first board MC.Create("CHANNEL", out channel); MC.SetParam(channel, "DriverIndex", 0); MC.SetParam(channel, "Connector", "VID1"); // Choose the video standard MC.SetParam(channel, "CamFile", "PAL"); // Choose the pixel color format MC.SetParam(channel, "ColorFormat", "RGB24"); // Choose the acquisition mode MC.SetParam(channel, "AcquisitionMode", "VIDEO"); // Choose the way the first acquisition is triggered MC.SetParam(channel, "TrigMode", "COMBINED"); // Choose the triggering mode for subsequent acquisitions MC.SetParam(channel, "NextTrigMode", "REPEAT"); // Choose the number of images to acquire MC.SetParam(channel, "SeqLength_Fr", 100); MC.SetParam(channel, "TrigLineIndex", 1); MC.SetParam(channel, "TrigEdge", "GOLOW"); // Register the callback function multiCamCallback = new MC.CALLBACK(MultiCamCallback); MC.RegisterCallback(channel, multiCamCallback, channel); // Enable the signals corresponding to the callback functions MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_ACQUISITION_FAILURE, "ON"); // Prepare the channel in order to minimize the acquisition sequence startup latency MC.SetParam(channel, "ChannelState", "READY"); } catch (Euresys.MultiCamException exc) { // An exception has occurred in the try {...} block. // Retrieve its description and display it in a message box. MessageBox.Show(exc.Message, "MultiCam Exception"); Close(); } // - PicoloVideoTrigger Sample Program }
public CEuresysIOTAManager(int _CamExposure = 1000) { try { // Open MultiCam driver MC.OpenDriver(); // Enable error logging MC.SetParam(MC.CONFIGURATION, "ErrorLog", "error.log"); MC.Create("CHANNEL", out channel); // Domino board 의 채널번호 MC.SetParam(channel, "DriverIndex", 0); // Domino Iota Board는 'X' channel만 존재. MC.SetParam(channel, "Connector", "X"); // camfile 을 불러온다 //MC.SetParam(channel, "CamFile", "STC-A33A_P60SA"); MC.SetParam(channel, "CamFile", "CV-A1_P16RA"); // Sequence를 무제한으로 설정해야 Frame을 지속적으로 받을 수 있음. MC.SetParam(channel, "SeqLength_Fr", MC.INDETERMINATE); MC.SetParam(channel, "TrigMode", "HARD"); MC.SetParam(channel, "TrigEdge", "GOLOW"); //MC.SetParam(channel, "StrobeLevel", "PLSLOW"); MC.SetParam(channel, "StrobeMode", "AUTO"); // CallBack 함수등록 multiCamCallback = new MC.CALLBACK(MultiCamCallback); MC.RegisterCallback(channel, multiCamCallback, channel); // 콜백 함수에 시크널 On 신호 MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_ACQUISITION_FAILURE, "ON"); } catch (Euresys.MultiCamException exc) { // An exception has occurred in the try {...} block. // Retrieve its description and display it in a message box. CLogManager.AddInspectionLog(CLogManager.LOG_TYPE.ERR, "cEuresysIOTAManager() Exception!!", CLogManager.LOG_LEVEL.LOW); } }
public EuresysFrameGrabber() { source = Observable.Create <IplImage>((observer, cancellationToken) => { return(Task.Factory.StartNew(() => { lock (captureLock) { //string camFilePath = CamFile; string camFile = System.IO.Path.GetFileNameWithoutExtension(CamFile); var boardTypology = BoardTypology; global_observer = observer; MC.OpenDriver(); MC.SetParam(MC.BOARD + 0, "BoardTopology", boardTypology.ToString()); MC.Create("CHANNEL", out channel); MC.SetParam(channel, "DriverIndex", 0); MC.SetParam(channel, "Connector", "M"); MC.SetParam(channel, "CamFile", camFile); multiCamCallback = new MC.CALLBACK(multiCamProcessingCallback); MC.RegisterCallback(channel, multiCamCallback, channel); try { MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "ON"); MC.SetParam(channel, "ChannelState", "ACTIVE"); while (!cancellationToken.IsCancellationRequested) { // Do nothing } MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "FREE"); } finally { MC.Delete(channel); MC.CloseDriver(); } } }, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Default)); }) .PublishReconnectable() .RefCount(); }
public CEuresysManager(string _CamInfo = "VCC-G20S20_P15RA", int _CamExposure = 1000) { try { // Open MultiCam driver MC.OpenDriver(); // Enable error logging MC.SetParam(MC.CONFIGURATION, "ErrorLog", "error.log"); // Create a channel and associate it with the first connector on the first board MC.Create("CHANNEL", out channel); MC.SetParam(channel, "DriverIndex", 0); // For all Domino boards except Domino Symphony MC.SetParam(channel, "Connector", "X"); // For Domino Symphony //MC.SetParam(channel, "Connector", "A"); // Choose the CAM file //MC.SetParam(channel, "CamFile", "XC-HR50_P60RA"); //MC.SetParam(channel, "CamFile", "VCC-G20S20_P15RA"); //MC.SetParam(channel, "CamFile", "CV-A1_P16RA"); if (_CamInfo == "") { _CamInfo = "VCC-G20S20_P15RA"; } MC.SetParam(channel, "CamFile", _CamInfo); // Choose the camera expose duration MC.SetParam(channel, "Expose_us", _CamExposure); // Choose the pixel color format MC.SetParam(channel, "ColorFormat", "Y8"); // Choose the way the first acquisition is triggered //MC.SetParam(channel, "TrigMode", "IMMEDIATE"); MC.SetParam(channel, "TrigMode", "HARD"); // Choose the triggering mode for subsequent acquisitions //MC.SetParam(channel, "NextTrigMode", "REPEAT"); MC.SetParam(channel, "NextTrigMode", "SAME"); // Choose the number of images to acquire //MC.SetParam(channel, "TrigLine", "NOM"); //MC.SetParam(channel, "TrigEdge", "GOHIGH"); //MC.SetParam(channel, "TrigFilter", "ON"); //MC.SetParam(channel, "TrigCtl", "LVDS"); MC.SetParam(channel, "TrigCtl", "TTL"); MC.SetParam(channel, "TrigLine", "NOM"); MC.SetParam(channel, "TrigEdge", "GOLOW"); MC.SetParam(channel, "TrigFilter", "ON"); MC.SetParam(channel, "StrobeCtl", "OPTO"); //MC.SetParam(channel, "StrobeCtl", "TTL"); MC.SetParam(channel, "StrobeMode", "AUTO"); MC.SetParam(channel, "StrobeLevel", "PLSLOW"); //MC.SetParam(channel, "SeqLength_Fr", MC.INDETERMINATE); MC.SetParam(channel, "SeqLength_Fr", -1); // Register the callback function multiCamCallback = new MC.CALLBACK(MultiCamCallback); MC.RegisterCallback(channel, multiCamCallback, channel); // Enable the signals corresponding to the callback functions MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_ACQUISITION_FAILURE, "ON"); // Prepare the channel in order to minimize the acquisition sequence startup latency MC.SetParam(channel, "ChannelState", "READY"); MC.SetParam(channel, "ChannelState", "ACTIVE"); } catch (Euresys.MultiCamException ex) { CLogManager.AddInspectionLog(CLogManager.LOG_TYPE.ERR, "cEuresysManager() Exception!!", CLogManager.LOG_LEVEL.LOW); } }
private void MainForm_Load(object sender, System.EventArgs e) { // + DominoSnapshotTrigger Sample Program try { // Open MultiCam driver MC.OpenDriver(); // Enable error logging MC.SetParam(MC.CONFIGURATION, "ErrorLog", "error.log"); // Create a channel and associate it with the first connector on the first board MC.Create("CHANNEL", out channel); MC.SetParam(channel, "DriverIndex", 0); MC.SetParam(channel, "Connector", "X"); // Choose the video standard MC.SetParam(channel, "CamFile", "XC-HR50_P60RA"); // Choose the camera expose duration MC.SetParam(channel, "Expose_us", 20000); // Choose the pixel color format MC.SetParam(channel, "ColorFormat", "Y8"); // Choose the way the first acquisition is triggered MC.SetParam(channel, "TrigMode", "COMBINED"); // Choose the triggering mode for subsequent acquisitions MC.SetParam(channel, "NextTrigMode", "COMBINED"); // Configure triggering line // A rising edge on the triggering line generates a trigger. // See the TrigLine Parameter and the board documentation for more details. MC.SetParam(channel, "TrigLine", "NOM"); MC.SetParam(channel, "TrigEdge", "GOHIGH"); MC.SetParam(channel, "TrigFilter", "ON"); MC.SetParam(channel, "TrigCtl", "TTL"); // Choose the number of images to acquire MC.SetParam(channel, "SeqLength_Fr", MC.INDETERMINATE); // Register the callback function multiCamCallback = new MC.CALLBACK(MultiCamCallback); MC.RegisterCallback(channel, multiCamCallback, channel); // Enable the signals corresponding to the callback functions MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_ACQUISITION_FAILURE, "ON"); // Prepare the channel in order to minimize the acquisition sequence startup latency MC.SetParam(channel, "ChannelState", "READY"); } catch (Euresys.MultiCamException exc) { // An exception has occurred in the try {...} block. // Retrieve its description and display it in a message box. MessageBox.Show(exc.Message, "MultiCam Exception"); Close(); } // - DominoSnapshotTrigger Sample Program }
private void MainForm_Load(object sender, System.EventArgs e) { // + GrablinkSnapshot Sample Program try { // Open MultiCam driver MC.OpenDriver(); // Enable error logging MC.SetParam(MC.CONFIGURATION, "ErrorLog", "error.log"); // In order to support a 10-tap camera on Grablink Full // BoardTopology need to be set to MONO_DECA // In order to support 2 cameras on Grablink Expert 2 // BoardTopology need to be set to DUO // In all other case the default value will work properly // and the parameter don't need to be set // Set the board topology to support 2 cameras (only with a Grablink Expert 2) // MC.SetParam(MC.BOARD + 0, "BoardTopology", "DUO"); // Set the board topology to support 10 taps mode (only with a Grablink Full) // MC.SetParam(MC.BOARD + 0, "BoardTopology", "MONO_DECA"); // Create a channel and associate it with the first connector on the first board MC.Create("CHANNEL", out channel); MC.SetParam(channel, "DriverIndex", 0); // In order to use single camera on connector A // MC_Connector need to be set to A for Grablink Expert 2 and Grablink DualBase // For all the other Grablink boards the parameter has to be set to M // For all GrabLink boards exect Grablink Expert 2 and Dualbase MC.SetParam(channel, "Connector", "M"); // For Grablink Expert 2 and Dualbase //MC.SetParam(channel, "Connector", "A"); // Choose the video standard MC.SetParam(channel, "CamFile", "1000m_P50RG"); // Choose the camera expose duration MC.SetParam(channel, "Expose_us", 20000); // Choose the pixel color format MC.SetParam(channel, "ColorFormat", "Y8"); //Set the acquisition mode to Snapshot MC.SetParam(channel, "AcquisitionMode", "SNAPSHOT"); // Choose the way the first acquisition is triggered MC.SetParam(channel, "TrigMode", "IMMEDIATE"); // Choose the triggering mode for subsequent acquisitions MC.SetParam(channel, "NextTrigMode", "REPEAT"); // Choose the number of images to acquire MC.SetParam(channel, "SeqLength_Fr", MC.INDETERMINATE); // Register the callback function multiCamCallback = new MC.CALLBACK(MultiCamCallback); MC.RegisterCallback(channel, multiCamCallback, channel); // Enable the signals corresponding to the callback functions MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_ACQUISITION_FAILURE, "ON"); // Prepare the channel in order to minimize the acquisition sequence startup latency MC.SetParam(channel, "ChannelState", "READY"); } catch (Euresys.MultiCamException exc) { // An exception has occurred in the try {...} block. // Retrieve its description and display it in a message box. MessageBox.Show(exc.Message, "MultiCam Exception"); Close(); } // - GrablinkSnapshot Sample Program }
public static LineScanE2VCamera MakeCamera( uint timeOut_ms, Func <bool> IsCameraTriggerOn) { try { LicenseManager.CheckLicense(); MC.OpenDriver(); MC.SetParam(MC.CONFIGURATION, "ErrorLog", "error.log"); #region Grabber Conifguration MC.Create("CHANNEL", out channel); MC.SetParam(channel, "DriverIndex", 0); MC.SetParam(MC.BOARD + 0, "BoardTopology", "MONO_DECA"); MC.SetParam(channel, "Connector", "M"); #endregion Grabber Configuration #region Camera Specification MC.SetParam(channel, "CamConfig", "LxxxxRG"); string camFile = @"C:\Users\Public\Documents\Euresys\MultiCam\Cameras\ELIIXAp-16kCL\ELIIXAp-16kCL_L16384RG_new.cam"; MC.SetParam(channel, "CamFile", camFile); #endregion Camera Specification #region Camera Features MC.SetParam(channel, "TapConfiguration", "DECA_10T8"); #endregion Camera Features #region Acquisition Control MC.SetParam(channel, "AcquisitionMode", "PAGE"); MC.SetParam(channel, "ActivityLength", 1); MC.SetParam(channel, "BreakEffect", "FINISH"); MC.SetParam(channel, "PageLength_Ln", 16380); MC.SetParam(channel, "SeqLength_Pg", -1); MC.SetParam(channel, "SeqLength_Ln", -1); MC.SetParam(channel, "TrigMode", "COMBINED"); MC.SetParam(channel, "NextTrigMode", "SAME"); MC.SetParam(channel, "TrigRepeatCount", 0); MC.SetParam(channel, "TrigCtl", "ISO"); MC.SetParam(channel, "TrigLine", "IIN1"); MC.SetParam(channel, "TrigEdge", "GOHIGH"); MC.SetParam(channel, "TrigFilter", "MEDIUM"); #endregion Acquisition Control #region Exposure Control MC.SetParam(channel, "Expose_us", 200); #endregion Exposure Control #region Strobe Control MC.SetParam(channel, "StrobeMode", "NONE"); #endregion Strobe Control #region Encoder Control MC.SetParam(channel, "EncoderPitch", 125); MC.SetParam(channel, "ForwardDirection", "A_LEADS_B"); MC.SetParam(channel, "LineCaptureMode", "ALL"); MC.SetParam(channel, "LinePitch", 2400); MC.SetParam(channel, "LineRateMode", "CONVERT"); MC.SetParam(channel, "LineTrigCtl", "DIFF_PAIRED"); MC.SetParam(channel, "LineTrigEdge", "ALL_A_B"); MC.SetParam(channel, "LineTrigFilter", "MEDIUM"); #endregion Encoder Control #region Grabber Timing MC.SetParam(channel, "GrabWindow", "NOBLACK"); #endregion Grabber Timing #region Cluster MC.SetParam(channel, "ColorFormat", "Y8"); #endregion Clutser #region Call Back // Register the callback function multiCamCallback = new MC.CALLBACK(MultiCamCallback); MC.RegisterCallback(channel, multiCamCallback, channel); // Enable the signals corresponding to the callback functions MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_ACQUISITION_FAILURE, "ON"); // Prepare the channel in order to minimize the acquisition sequence startup latency MC.SetParam(channel, "ChannelState", "READY"); #endregion Call Back #region Camera Trigger IsCameraTriggerOn_ = IsCameraTriggerOn; #endregion Camera Trigger return(new LineScanE2VCamera(timeOut_ms)); } catch (Euresys.MultiCamException exc) { throw exc; } }
/// <summary> /// 相机参数加载 /// </summary> /// <param name="CamID"></param> public void OpenCam(int CamID) { try { lock (lockerOpenCam) { if (CamID == 0)//左相机 { MC.OpenDriver(); MC.SetParam(MC.CONFIGURATION, "ErrorLog", "error.log"); MC.Create("CHANNEL", out channel); MC.SetParam(channel, "DriverIndex", CamID); MC.SetParam(channel, "Connector", "M"); MC.SetParam(channel, "CamFile", Application.StartupPath + "//CameraSet.cam"); //"//" + cameraFilePath); MC.SetParam(channel, "ColorFormat", "RGB24"); MC.SetParam(channel, "AcquisitionMode", "LONGPAGE"); MC.SetParam(channel, "TrigMode", "HARD"); MC.SetParam(channel, "TrigLine", "IIN1"); MC.SetParam(channel, "TrigEdge", "GOHIGH"); MC.SetParam(channel, "TrigFilter", "STRONG"); MC.SetParam(channel, "EndPageDelay_Ln", FrmMain.cameraP.endPageDelay_Ln.ToString()); MC.SetParam(channel, "PageDelay_Ln", FrmMain.cameraP.pageDelay_Ln.ToString()); MC.SetParam(channel, "SeqLength_Ln", FrmMain.cameraP.seqLength_Ln.ToString()); MC.SetParam(channel, "PageLength_Ln", FrmMain.cameraP.pageLength_Ln.ToString()); MC.SetParam(channel, "SeqLength_Fr", MC.INDETERMINATE); multiCamCallback = new MC.CALLBACK(MultiCamCallback); MC.RegisterCallback(channel, multiCamCallback, channel); MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_ACQUISITION_FAILURE, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_SURFACE_FILLED, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_START_ACQUISITION_SEQUENCE, "ON"); MC.SetParam(channel, MC.SignalEnable + MC.SIG_END_ACQUISITION_SEQUENCE, "ON"); MC.SetParam(channel, "ChannelState", "READY"); } else { MC.OpenDriver(); MC.SetParam(MC.CONFIGURATION, "ErrorLog", "error.log"); MC.Create("CHANNEL", out channelR); MC.SetParam(channelR, "DriverIndex", CamID); MC.SetParam(channelR, "Connector", "M"); MC.SetParam(channelR, "CamFile", Application.StartupPath + "//CameraSet.cam"); //"//" + cameraFilePath); MC.SetParam(channelR, "ColorFormat", "RGB24"); MC.SetParam(channelR, "AcquisitionMode", "LONGPAGE"); MC.SetParam(channelR, "TrigMode", "HARD"); MC.SetParam(channelR, "TrigLine", "IIN1"); MC.SetParam(channelR, "TrigEdge", "GOHIGH"); MC.SetParam(channelR, "TrigFilter", "STRONG"); MC.SetParam(channelR, "EndPageDelay_Ln", FrmMain.cameraP.endPageDelay_Ln.ToString()); MC.SetParam(channelR, "PageDelay_Ln", FrmMain.cameraP.pageDelay_Ln.ToString()); MC.SetParam(channelR, "SeqLength_Ln", FrmMain.cameraP.seqLength_Ln.ToString()); MC.SetParam(channelR, "PageLength_Ln", FrmMain.cameraP.pageLength_Ln.ToString()); MC.SetParam(channelR, "SeqLength_Fr", MC.INDETERMINATE); multiCamRCallback = new MC.CALLBACK(MultiCamCallback); MC.RegisterCallback(channelR, multiCamRCallback, channelR); MC.SetParam(channelR, MC.SignalEnable + MC.SIG_SURFACE_PROCESSING, "ON"); MC.SetParam(channelR, MC.SignalEnable + MC.SIG_ACQUISITION_FAILURE, "ON"); MC.SetParam(channelR, MC.SignalEnable + MC.SIG_SURFACE_FILLED, "ON"); MC.SetParam(channelR, MC.SignalEnable + MC.SIG_START_ACQUISITION_SEQUENCE, "ON"); MC.SetParam(channelR, MC.SignalEnable + MC.SIG_END_ACQUISITION_SEQUENCE, "ON"); MC.SetParam(channelR, "ChannelState", "READY"); } } } catch (DefectDetection.MultiCamException exc) { FrmMain.T.queueIn(DateTime.Now.ToString("yy-MM-dd HH:mm:ss fff-") + exc.Message + "OpenCam"); } }