Ejemplo n.º 1
0
        public LJV7IF_TARGET_SETTING GetTargetSetting(byte category, byte item, byte type, byte[] targets)
        {
            LJV7IF_TARGET_SETTING target_setting = new LJV7IF_TARGET_SETTING();

            target_setting.byCategory = category;
            target_setting.byItem     = item;
            target_setting.byType     = type;
            if (targets != null)
            {
                if (targets.Length > 0)
                {
                    target_setting.byTarget1 = targets[0];
                }
                if (targets.Length > 1)
                {
                    target_setting.byTarget2 = targets[1];
                }
                if (targets.Length > 2)
                {
                    target_setting.byTarget3 = targets[2];
                }
                if (targets.Length > 3)
                {
                    target_setting.byTarget4 = targets[3];
                }
            }
            return(target_setting);
        }
Ejemplo n.º 2
0
        public bool GetSetting(byte category, byte item, byte type, byte[] targets, int datasize)
        {
            LJV7IF_TARGET_SETTING target_setting = GetTargetSetting(category, item, type, targets);

            //0: Write settings area,
            //1: Running settings area,
            //2: Save area
            SettingDepth _depth = SettingDepth.Running;

            if (datasize <= 0)
            {
                datasize = 1;
            }
            byte[] data = new byte[datasize];
            using (PinnedObject pin = new PinnedObject(data))
            {
                int rc = NativeMethods.LJV7IF_GetSetting(DEVICE_ID, _depth, target_setting, pin.Pointer, (uint)data.Length);
                // @Point
                // † 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.
                return(CheckReturnCode((Rc)rc));
            }
        }
Ejemplo n.º 3
0
 internal static extern int LJV7IF_GetSetting(int lDeviceId, SettingDepth byDepth, LJV7IF_TARGET_SETTING TargetSetting,
                                              IntPtr pData, uint dwDataSize);