public TriggerInfo( StandardDriverStatusCode status, ulong segmentIndex, ulong triggerIndex, double triggerTime, PicoTimeUnits timeUnits, ulong missedTriggers, ulong timeStampCounter) { Status = status; SegmentIndex = segmentIndex; TriggerIndex = triggerIndex; TriggerTime = triggerTime; TimeUnits = timeUnits; MissedTriggers = missedTriggers; TimeStampCounter = timeStampCounter; }
/// <summary> /// Callback event for when a device has been connected or disconnected to a digital port. /// </summary> private void DigitalPortCallback(short handle, StandardDriverStatusCode status, IntPtr ports, uint nPorts) { IntPtr ptr = ports; _callbackStatus = status; List <DigitalPortInteractions> portInteractions = new List <DigitalPortInteractions>(); for (int port = 0; port < nPorts; port++) { var portInteraction = (DigitalPortInteractions)Marshal.PtrToStructure(ptr, typeof(DigitalPortInteractions)); portInteractions.Add(portInteraction); ptr += Marshal.SizeOf(typeof(DigitalPortInteractions)); } foreach (var portInteraction in portInteractions) { string connected = (portInteraction.Connected > 0) ? "connected" : "disconnected"; Console.WriteLine("Port: " + portInteraction.Channel + " has " + connected + ": " + portInteraction.DigitalPort); } }
/// <summary> /// Callback event for when data has been fully captured. /// </summary> private void BlockReadyCallback(short handle, StandardDriverStatusCode status, IntPtr pVoid) { _callbackStatus = status; _callbackEvent.Set(); }