コード例 #1
0
ファイル: Class1.cs プロジェクト: judebabygeorge/Neuro
 public bool DisConnect()
 {
     if (Connected)
     {
         Port_1.Disconnect();
         Port_2.Disconnect();
         Connected = false;
     }
     return(true);
 }
コード例 #2
0
        private void stopDacq_Click(object sender, EventArgs e)
        {
            if (mea.GetDeviceId().IdProduct == ProductIdEnumNet.W2100)
            {
                CW2100_FunctionNet func = new CW2100_FunctionNet(mea);
                if (!w2100_hs_samling)
                {
                    func.SetHeadstageSamplingActive(false, other_receiver + 0);
                }
            }

            startDacq.Enabled = true;
            stopDacq.Enabled  = false;

            mea.StopDacq();
            mea.Disconnect();
        }
コード例 #3
0
        private void DigOutSignal_Click(object sender, EventArgs e)
        {
            CMeaUSBDeviceNet mea = new CMeaUSBDeviceNet(); // Create object of class CMcsUsbFactoryNet (provides firmware upgrade and register access capabilities)

            if (mea.Connect(DspPort, LockMask) == 0)
            {
                CDigOutStimulatorFunctionNet dig = new CDigOutStimulatorFunctionNet(mea);
                int[]   ampl = new int[] { 1, 0 };
                ulong[] dur  = new ulong[] { 200000, 1000000 };
                CStimulusFunctionNet.StimulusDeviceDataAndUnrolledData data = dig.PrepareChannelData(ampl, dur);
                dig.SendChannelData(0, data);
                dig.SetGlobalRepeat(0, true);
                mea.SetDigitalSource <SCUDigitalSourceEnumNet>(DigitalTargetEnumNet.DigOutStimulatorStartTrigger, 0, new DigitalSource <SCUDigitalSourceEnumNet>(SCUDigitalSourceEnumNet.DigitalData), 0);
                mea.SetDigitalSource <SCUDigitalSourceEnumNet>(DigitalTargetEnumNet.Digout, 3, new DigitalSource <SCUDigitalSourceEnumNet>(SCUDigitalSourceEnumNet.DigitalOutStimulator), 0);
                mea.MeaDigitalDataFunctionNet.SetDigitalData(0, false);
                mea.MeaDigitalDataFunctionNet.SetDigitalData(0, true);
                mea.Disconnect();
            }
        }