void m_Coord_OnDeviceFocus(VsDevice objDevice) { // Get handle to the Device m_Dev = objDevice; // Connect the IO control to the device. Only do this once. m_IO.Connect(m_Dev); // Create an event so that we see when IO on camera changes // m_IO.IOTransition += new EventHandler<IOConnectionEventArgs>(m_IO_IOTransition); // Initialize all IO to low, in this case Virtual 1 m_IO.PointWrite(VsIoType.Virtual, 0, false); // Load our job from disk m_Job.Load("C:\\Microscan\\Vscape\\Jobs\\test.avp"); // Get the first VisionSystemStep in the job vs = m_Job.VisionSystemStep(); // Connect the VisionSystemStep to our device vs.SelectSystem(m_Dev.Name); //Now we can download to the device(vision system) and run the job on that device m_Dev.Download(vs, true); // Connect reports to the inspection on the device m_RepCon1.Connect(DEVICENAME, 1, ReportConnection.ConnectOptions.DEFAULT); // Make images part of the report m_RepCon1.AddSnapBuffers((Visionscape.Steps.InspectionStep)m_Job.FindBySymName("Insp1")); // Now start the device m_Dev.StartAll(); }
public void ConnectReport() { try { if (allReport == null) { allReport = new ReportConnection(); allReport.NewReport += receivedReport_NewReport; } allReport.Connect(vsDevice); allReport.DropWhenBusy = false; allReport.FreezeMode = ReportConnection.FreezeModeOptions.SHOW_ALL; allReport.DataRecordAdd("Snapshot1.BufOut"); if (ConnectionEventCallback != null) { ConnectionEventCallback.Invoke(Enum_ConnectionEvent.CONNECTED_REPORT, allReport); } } catch (Exception ex) { throw new NotImplementedException(ex.Message); } }