/// <summary> /// write one DM /// </summary> /// <param name="position"></param> /// <param name="value"></param> /// <returns></returns> public bool WriteDM(UInt16 position, Int16 value) { // get the array // Byte[] cmd = BTool.Int16toBytes(value); // fins command // return(finsMemoryAreadWrite(MemoryArea.DM, position, 0, 1, cmd)); }
/// <summary> /// write one CIO /// </summary> /// <param name="position"></param> /// <param name="value"></param> /// <returns></returns> public bool WriteCIO(UInt16 position, UInt16 value) { // get the array // Byte[] cmd = BTool.Uint16toBytes(value); // fins command // return(finsMemoryAreadWrite(MemoryArea.CIO, position, 1, cmd)); }
/// <summary> /// read one DM using signed values /// </summary> /// <param name="position"></param> /// <param name="value"></param> /// <returns></returns> public bool ReadDM(UInt16 position, ref Int16 value) { // FINS command // if (!finsMemoryAreadRead(MemoryArea.DM, position, 0, 1)) { return(false); } // value // value = BTool.BytesToInt16(this._finsCmd.Response[0], this._finsCmd.Response[1]); return(true); }
/// <summary> /// read various DM /// </summary> /// <param name="position"></param> /// <param name="data"></param> /// <param name="count"></param> /// <returns></returns> public bool ReadDMs(UInt16 position, ref UInt16[] data, UInt16 count) { // FINS command // if (!finsMemoryAreadRead(MemoryArea.DM, position, 0, count)) { return(false); } // fills the array // for (int x = 0; x < count; x++) { data[x] = BTool.BytesToUInt16(this._finsCmd.Response[(x * 2)], this._finsCmd.Response[(x * 2) + 1]); } return(true); }