Пример #1
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));
            }
        }
Пример #2
0
 internal static extern int LJV7IF_GetSetting(int lDeviceId, SettingDepth byDepth, LJV7IF_TARGET_SETTING TargetSetting,
                                              IntPtr pData, uint dwDataSize);