/// <summary>
        /// Opportunity to do any ID referencing for this class object
        /// Occurs after Initialize
        /// </summary>
        public override void InitializeIDReferences()
        {
            base.InitializeIDReferences();

            //_millimeterInput = this.FilterByTypeSingle<MillimeterInput>();
            _dispSensor = this.FilterByTypeSingle <DispSensor>();

            if (_dispSensor == null)
            {
                U.LogPopup("Keyence LJ_V7001_Ctrl need millimeterInput");
            }
            else
            {
                OnChangeTriggerMode(_dispSensor.TriggerMode);
                U.RegisterOnChanged(() => _dispSensor.TriggerMode, OnChangeTriggerMode);
            }
        }
        //public void SetLimitSensor(string upperlimit, string lowerlimit, string programNo, string outputNo)
        //{

        //    // † There are three setting areas: a) the write settings area, b) the running area, and c) the save area.
        //    //   * Specify a) for the setting level when you want to change multiple settings. However, to reflect settings in the LJ-V operations, you have to call LJV7IF_ReflectSetting.
        //    //	 * Specify b) for the setting level when you want to change one setting but you don't mind if this setting is returned to its value prior to the change when the power is turned off.
        //    //	 * Specify c) for the setting level when you want to change one setting and you want this new value to be retained even when the power is turned off.

        //    // @Point
        //    //  As a usage example, we will show how to use SettingForm to configure settings such that sending a setting, with SettingForm using its initial values,
        //    //  will change the sampling period in the running area to "100 Hz."
        //    //  Also see the GetSetting function.


        //    // Set upper limit
        //    _depth = 0x01;						                        // Setting depth: Running settings area
        //    _targetSetting.byType = Convert.ToByte(programNo, 16);		// Setting type: Program number
        //    _targetSetting.byCategory = 0x06;	                        // Category: Output settings
        //    _targetSetting.byItem = 0x0E;		                        // Setting item: Upper limit
        //    _targetSetting.byTarget1 = Convert.ToByte(outputNo);		// Setting target 1: output number
        //    _targetSetting.byTarget2 = 0x0;		                        // Setting target 2: None
        //    _targetSetting.byTarget3 = 0x0;		                        // Setting target 3: None
        //    _targetSetting.byTarget4 = 0x0;		                        // Setting target 4: None
        //    SetLimit(Convert.ToInt16(upperlimit));

        //    uint dwError = 0;
        //    using (PinnedObject pin = new PinnedObject(_data))

        //    try
        //    {
        //        Rc rc = (Rc)NativeMethods.LJV7IF_SetSetting(_deviceID, _depth, _targetSetting, pin.Pointer, (uint)_data.Length, ref dwError);

        //        if (rc != Rc.Ok)
        //        {
        //            U.LogPopup("Cannot set upper limit on sensor");
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        U.LogPopup(ex, "Keyence_LJ_V7001_Ctrl.SetLimit error");
        //    }

        //}



        public override void SetLimit(DispSensor dispSensor, double upperLimit, double lowerLimit)
        {
            base.SetLimit(dispSensor, upperLimit, lowerLimit);

            // † There are three setting areas: a) the write settings area, b) the running area, and c) the save area.
            //   * Specify a) for the setting level when you want to change multiple settings. However, to reflect settings in the LJ-V operations, you have to call LJV7IF_ReflectSetting.
            //	 * Specify b) for the setting level when you want to change one setting but you don't mind if this setting is returned to its value prior to the change when the power is turned off.
            //	 * Specify c) for the setting level when you want to change one setting and you want this new value to be retained even when the power is turned off.

            // @Point
            //  As a usage example, we will show how to use SettingForm to configure settings such that sending a setting, with SettingForm using its initial values,
            //  will change the sampling period in the running area to "100 Hz."
            //  Also see the GetSetting function.


            // Set upper limit
            _depth = 0x01;                                              // Setting depth: Running settings area
            _targetSetting.byType     = (byte)(dispSensor.ProgramNo);   // Setting type: Program number
            _targetSetting.byCategory = 0x06;                           // Category: Output settings
            _targetSetting.byItem     = 0x0E;                           // Setting item: Upper limit
            _targetSetting.byTarget1  = (byte)(dispSensor.OutputNo);    // Setting target 1: output number
            _targetSetting.byTarget2  = 0x0;                            // Setting target 2: None
            _targetSetting.byTarget3  = 0x0;                            // Setting target 3: None
            _targetSetting.byTarget4  = 0x0;                            // Setting target 4: None
            SetLimit(upperLimit);

            uint dwError = 0;

            using (PinnedObject pin = new PinnedObject(_data))

                try
                {
                    Rc rc = (Rc)NativeMethods.LJV7IF_SetSetting(_deviceID, _depth, _targetSetting, pin.Pointer, (uint)_data.Length, ref dwError);

                    if (rc != Rc.Ok)
                    {
                        U.LogPopup("Cannot set upper limit on sensor");
                    }
                }
                catch (Exception ex)
                {
                    U.LogPopup(ex, "Keyence_LJ_V7001_Ctrl.SetLimit error");
                }



            // Set lower limit
            _depth = 0x01;                                              // Setting depth: Running settings area
            _targetSetting.byType     = (byte)(dispSensor.ProgramNo);   // Setting type: Program number
            _targetSetting.byCategory = 0x06;                           // Category: Output settings
            _targetSetting.byItem     = 0x0E;                           // Setting item: Upper limit
            _targetSetting.byTarget1  = (byte)(dispSensor.OutputNo);    // Setting target 1: output number
            _targetSetting.byTarget2  = 0x0;                            // Setting target 2: None
            _targetSetting.byTarget3  = 0x0;                            // Setting target 3: None
            _targetSetting.byTarget4  = 0x0;                            // Setting target 4: None
            SetLimit(lowerLimit);


            using (PinnedObject pin = new PinnedObject(_data))

                try
                {
                    Rc rc = (Rc)NativeMethods.LJV7IF_SetSetting(_deviceID, _depth, _targetSetting, pin.Pointer, (uint)_data.Length, ref dwError);

                    if (rc != Rc.Ok)
                    {
                        U.LogPopup("Cannot set upper limit on sensor");
                    }
                }
                catch (Exception ex)
                {
                    U.LogPopup(ex, "Keyence_LJ_V7001_Ctrl.SetLimit error");
                }
        }