public SlaveVariable(SlavePdo parent, string name, ushort index, byte subIndex, DataDirection dataDirection, OneDasDataType dataType, byte bitLength = 0) : base(name, dataType, dataDirection, Endianness.LittleEndian) { Contract.Requires(parent != null); this.Parent = parent; this.Index = index; this.SubIndex = subIndex; if (bitLength == 0) { this.BitLength = OneDasUtilities.GetBitLength(dataType, false); } else { this.BitLength = bitLength; } }
public SlaveVariable(SlavePdo parent, string name, ushort index, byte subIndex, DataDirection dataDirection, EthercatDataType dataType, byte bitLength = 0) { this.Parent = parent; this.Name = name; this.Index = index; this.SubIndex = subIndex; this.DataDirection = dataDirection; this.DataType = dataType; if (bitLength == 0) { this.BitLength = EcUtilities.GetBitLength(dataType); } else { this.BitLength = bitLength; } }