public static MODBUSMaster_HoldingRegister Parse(SqlString stringToParse) { if (stringToParse.IsNull) { return(Null); } var parsedHoldingRegisterData = stringToParse.Value.Split(",".ToCharArray()); var parsedHoldingRegister = new MODBUSMaster_HoldingRegister() { Address = MODBUSMaster_MODBUSAddress.Parse(parsedHoldingRegisterData[0]), ByteSwap = bool.Parse(parsedHoldingRegisterData[1]), Value = UInt16.Parse(parsedHoldingRegisterData[2]) }; return(parsedHoldingRegister); }
public static MODBUSMaster_StringRegister Parse(SqlString stringToParse) { if (stringToParse.IsNull) { return(Null); } var parsedStringRegisterData = stringToParse.Value.Split(",".ToCharArray()); var parsedStringRegister = new MODBUSMaster_StringRegister() { Address = MODBUSMaster_MODBUSAddress.Parse(parsedStringRegisterData[0]), Length = byte.Parse(parsedStringRegisterData[1]), Value = parsedStringRegisterData[2] }; return(parsedStringRegister); }
public static MODBUSMaster_MODBUSAddress Parse(SqlString stringToParse) { if (stringToParse.IsNull) { return(Null); } var parsedMODBUSAddressData = stringToParse.Value.Split(";".ToCharArray()); var parsedMODBUSAddress = new MODBUSMaster_MODBUSAddress() { IsZeroBased = bool.Parse(parsedMODBUSAddressData[0]), RelativeAddress = int.Parse(parsedMODBUSAddressData[1]) }; return(parsedMODBUSAddress); }
public static MODBUSMaster_DiscreteInputRegister Parse(SqlString stringToParse) { if (stringToParse.IsNull) { return(Null); } var parsedDiscreteInputRegisterData = stringToParse.Value.Split(",".ToCharArray()); var parsedDiscreteInputRegister = new MODBUSMaster_DiscreteInputRegister() { Address = MODBUSMaster_MODBUSAddress.Parse(parsedDiscreteInputRegisterData[0]), Value = bool.Parse(parsedDiscreteInputRegisterData[1]) }; return(parsedDiscreteInputRegister); }