public void TestInitialize() { int totalcount = 30600; int boolcoilcount = 0; int boolinputcount = 0; int ushortholdingcount = 0; int ushortinputcount = 0; int floatholdingcount = 0; int floatinputcount = 0; for (int i = 0; i < totalcount; i++) { string name = ""; Tag newTag; if (i < (totalcount / 6)) { //bool tag - coil status boolcoilcount++; name = "boolcoil"; newTag = new Tag(name + boolcoilcount.ToString()); newTag.DefineBoolTag(StatusFunction.CoilStatus); } else if (i >= (totalcount / 6) && i < (totalcount * 2 / 6)) { //bool tag - input status boolinputcount++; name = "boolinput"; newTag = new Tag(name + boolinputcount.ToString()); newTag.DefineBoolTag(StatusFunction.InputStatus); } else if (i >= (totalcount * 2 / 6) && i < (totalcount * 3 / 6)) { //ushort tag - holding register ushortholdingcount++; name = "ushortholding"; newTag = new Tag(name + ushortholdingcount.ToString()); newTag.DefineUshortTag(RegisterFunction.HoldingRegister); } else if (i >= (totalcount * 3 / 6) && i < (totalcount * 4 / 6)) { //ushort tag - input register ushortinputcount++; name = "ushortinput"; newTag = new Tag(name + ushortinputcount.ToString()); newTag.DefineUshortTag(RegisterFunction.InputRegister); } else if (i >= (totalcount * 4 / 6) && i < (totalcount * 5 / 6)) { //float tag - holding register floatholdingcount++; name = "floatholding"; newTag = new Tag(name + floatholdingcount.ToString()); newTag.DefineFloatTag(RegisterFunction.HoldingRegister, new Converters.LSRFFloatConverter()); } else { //float tag - input register floatinputcount++; name = "floatinput"; newTag = new Tag(name + floatinputcount.ToString()); newTag.DefineFloatTag(RegisterFunction.InputRegister, new Converters.LSRFFloatConverter()); } newTag.InnerTag.AddAddress((ushort)i); myCollection.AddTag(newTag); } myCollection.CalculateParseAddresses(); }