private void buttonPWM_Click(object sender, EventArgs e) { try { m_maiDevice.StopMeasure(); FormOutput_PWM_FM outpwm = new FormOutput_PWM_FM(this); outpwm.ShowDialog(); m_maiDevice.PWMChannels.StopOutput(); m_maiDevice.ClearAllChannelLists(); } catch (Exception x) { m_maiDevice.PWMChannels.StopOutput(); m_maiDevice.StopMeasure(); m_maiDevice.ClearAllChannelLists(); MessageBox.Show(x.Message); } }