예제 #1
0
        private void select_AIOutChannelForVoltageApply(BOX_AnalogOutChannelsEnum boxOut, double voltage)
        {
            currentChannelSelection = boxOut;

            var OutputNumber = (int)boxOut + 1;

            if ((OutputNumber <= 8) && (OutputNumber >= 1))
            {
                _channels[1].OutputNumber = boxOut;
                _channels[0].OutputNumber = _channels[0].OutputNumber;
                _channels[1].Enabled      = true;
                LatchEnable.Pulse();
                _channels[1].Voltage = voltage;
                _channels[1].OutputOFF();
            }
            else if ((OutputNumber <= 16) && (OutputNumber >= 9))
            {
                _channels[0].OutputNumber = boxOut;
                _channels[1].OutputNumber = _channels[1].OutputNumber;
                _channels[0].Enabled      = true;
                LatchEnable.Pulse();
                _channels[0].Voltage = voltage;
                _channels[0].OutputOFF();
            }
        }
예제 #2
0
        public void ApplyVoltageToChannel(BOX_AnalogOutChannelsEnum boxOutChannel, double voltage)
        {
            if (boxOutChannel != BOX_AnalogOutChannelsEnum.NotSet)
            {
                select_AIOutChannelForVoltageApply(boxOutChannel, voltage);

                var OutputNumber = (int)boxOutChannel + 1;

                if ((OutputNumber <= 8) && (OutputNumber >= 1))
                {
                    _channels[1].Enabled = true;
                    _channels[1].Voltage = voltage;
                    _channels[1].OutputOFF();
                }
                else if ((OutputNumber <= 16) && (OutputNumber >= 9))
                {
                    _channels[0].Enabled = true;
                    _channels[0].Voltage = voltage;
                    _channels[0].OutputOFF();
                }
            }
        }
        private void _Set_ActiveChennel(BOX_AnalogOutChannelsEnum Channel)
        {
            switch (Channel)
            {
                case BOX_AnalogOutChannelsEnum.BOX_AOut_01: { _Selector_A0.Reset(); _Selector_A1.Reset(); _Selector_A2.Reset(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_02: { _Selector_A0.Set(); _Selector_A1.Reset(); _Selector_A2.Reset(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_03: { _Selector_A0.Reset(); _Selector_A1.Set(); _Selector_A2.Reset(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_04: { _Selector_A0.Set(); _Selector_A1.Set(); _Selector_A2.Reset(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_05: { _Selector_A0.Reset(); _Selector_A1.Reset(); _Selector_A2.Set(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_06: { _Selector_A0.Set(); _Selector_A1.Reset(); _Selector_A2.Set(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_07: { _Selector_A0.Reset(); _Selector_A1.Set(); _Selector_A2.Set(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_08: { _Selector_A0.Set(); _Selector_A1.Set(); _Selector_A2.Set(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_09: { _Selector_A0.Reset(); _Selector_A1.Reset(); _Selector_A2.Reset(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_10: { _Selector_A0.Set(); _Selector_A1.Reset(); _Selector_A2.Reset(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_11: { _Selector_A0.Reset(); _Selector_A1.Set(); _Selector_A2.Reset(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_12: { _Selector_A0.Set(); _Selector_A1.Set(); _Selector_A2.Reset(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_13: { _Selector_A0.Reset(); _Selector_A1.Set(); _Selector_A2.Set(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_14: { _Selector_A0.Set(); _Selector_A1.Set(); _Selector_A2.Set(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_15: { _Selector_A0.Set(); _Selector_A1.Reset(); _Selector_A2.Set(); } break;
                case BOX_AnalogOutChannelsEnum.BOX_AOut_16: { _Selector_A0.Reset(); _Selector_A1.Reset(); _Selector_A2.Set(); } break;

                default:
                    throw new ArgumentException();
            }
        }
 public BS350_MotorPotentiometer(BoxController boxController, BOX_AnalogOutChannelsEnum controlChannel)
 {
     _boxController  = boxController;
     _controlChannel = controlChannel;
 }
        private void _Set_ActiveChennel(BOX_AnalogOutChannelsEnum Channel)
        {
            switch (Channel)
            {
            case BOX_AnalogOutChannelsEnum.BOX_AOut_01:
            {
                _Selector_A0.Reset();
                _Selector_A1.Reset();
                _Selector_A2.Reset();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_02:
            {
                _Selector_A0.Set();
                _Selector_A1.Reset();
                _Selector_A2.Reset();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_03:
            {
                _Selector_A0.Reset();
                _Selector_A1.Set();
                _Selector_A2.Reset();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_04:
            {
                _Selector_A0.Set();
                _Selector_A1.Set();
                _Selector_A2.Reset();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_05:
            {
                _Selector_A0.Reset();
                _Selector_A1.Reset();
                _Selector_A2.Set();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_06:
            {
                _Selector_A0.Set();
                _Selector_A1.Reset();
                _Selector_A2.Set();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_07:
            {
                _Selector_A0.Reset();
                _Selector_A1.Set();
                _Selector_A2.Set();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_08:
            {
                _Selector_A0.Set();
                _Selector_A1.Set();
                _Selector_A2.Set();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_09:
            {
                _Selector_A0.Reset();
                _Selector_A1.Reset();
                _Selector_A2.Reset();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_10:
            {
                _Selector_A0.Set();
                _Selector_A1.Reset();
                _Selector_A2.Reset();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_11:
            {
                _Selector_A0.Reset();
                _Selector_A1.Set();
                _Selector_A2.Reset();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_12:
            {
                _Selector_A0.Set();
                _Selector_A1.Set();
                _Selector_A2.Reset();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_13:
            {
                _Selector_A0.Reset();
                _Selector_A1.Set();
                _Selector_A2.Set();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_14:
            {
                _Selector_A0.Set();
                _Selector_A1.Set();
                _Selector_A2.Set();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_15:
            {
                _Selector_A0.Set();
                _Selector_A1.Reset();
                _Selector_A2.Set();
            } break;

            case BOX_AnalogOutChannelsEnum.BOX_AOut_16:
            {
                _Selector_A0.Reset();
                _Selector_A1.Reset();
                _Selector_A2.Set();
            } break;

            case BOX_AnalogOutChannelsEnum.NotSet:
            {
            } break;


            default:
                throw new ArgumentException();
            }
        }