相机硬触发

硬触发后,相机回调会自动触发,监听回调事件就可以了
HOperatorSet.SetFramegrabberParam(AcqHandle,"FrameStartTriggerMode","On");
HOperatorSet.SetFramegrabberParam(AcqHandle,"grab_timeout",100);
HOperatorSet.SetFramegrabberParam(AcqHandle,"LineSelector","Line1");
HOperatorSet.SetFramegrabberParam(AcqHandle,"LineFormat","TTL");

HOperatorSet.SetFramegrabberParam(hv_AcqHandle, "grab_timeout", -1); 

HFramegrabberCallback delegateCallback; 

delegateCallback = MyCallbackFunction;

还没验证

                                delegateCallback = MyCallbackFunction;
                                HalconDotNet.HOperatorSet.SetFramegrabberParam(camera.AcqHandle, "AcquisitionMode", "Continuous");
                                HalconDotNet.HOperatorSet.SetFramegrabberParam(camera.AcqHandle, "TriggerSelector", "FrameStart");
                                HalconDotNet.HOperatorSet.SetFramegrabberParam(camera.AcqHandle, "TriggerActivation", "RisingEdge");
                                HalconDotNet.HOperatorSet.SetFramegrabberParam(camera.AcqHandle, "ExposureMode", "Timed");
                                HalconDotNet.HOperatorSet.SetFramegrabberParam(camera.AcqHandle, "ExposureTime", 80000.0);
                                HalconDotNet.HOperatorSet.SetFramegrabberParam(camera.AcqHandle, "grab_timeout", -1);
                                IntPtr ptr = Marshal.GetFunctionPointerForDelegate(delegateCallback);
                                IntPtr ptr1 = GCHandle.Alloc(test, GCHandleType.Pinned).AddrOfPinnedObject();
                                HalconDotNet.HOperatorSet.SetFramegrabberCallback(camera.AcqHandle, "transfer_end", ptr, ptr1);

你可能感兴趣的:(笔记,数码相机)