/// <summary>
        /// This function initialize the digital port callback and reports any disconnections and connections on the digital port.
        /// </summary>
        public StandardDriverStatusCode RunDigitalPortCallbackExample(short handle)
        {
            _callback = DigitalPortCallback;
            var status = DriverImports.PS6000a.SetDigitalPortInteractionCallback(handle, _callback);

            if (status != StandardDriverStatusCode.Ok)
            {
                return(status);
            }

            bool exit = false;

            Console.WriteLine("PRESS ANY KEY TO EXIT LOOP.");
            Thread cancelWaitForCapture = new Thread(() => ps6000aDevice.CancelDataCapture(ref exit));

            cancelWaitForCapture.Start();

            while (_callbackStatus == StandardDriverStatusCode.Ok && !exit)
            {
                Thread.Sleep(100);
            }

            return(_callbackStatus);
        }
Beispiel #2
0
 public static extern StandardDriverStatusCode SetDigitalPortInteractionCallback(
     short handle,
     DigitalPortCallback callback
     );