public void Check_ItemBuilder()
        {
            Int32PlcItem item = new PlcItemBuilder()
                                .ConstructInt32PlcItem("Int32")
                                .AtDatablock(0)
                                .AtPosition(4)
                                .WithoutInitialValue()
                                .Build()
            ;

            Assert.That(((IPlcItem)item).Value.ByteLength, Is.EqualTo(sizeof(Int32)));

            System.Diagnostics.Debug.WriteLine(item.ToString());
        }
Beispiel #2
0
        public void Check_ItemBuilder()
        {
            Utf8PlcItem item = new PlcItemBuilder()
                               .ConstructUtf8PlcItem("UTF-8")
                               .AtDatablock(0)
                               .AtPosition(4)
                               .WithLength(10)
                               .Build()
            ;

            Assert.AreEqual((uint)10, ((IPlcItem)item).Value.ByteLength);

            System.Diagnostics.Debug.WriteLine(item.ToString());
        }
Beispiel #3
0
        public void Check_ItemBuilder()
        {
            BytesPlcItem item = new PlcItemBuilder()
                                .ConstructBytesPlcItem("Bytes")
                                .ForData()
                                .AtDatablock(0)
                                .AtPosition(4)
                                .ForByteAmount(10)
                                .Build()
            ;

            Assert.AreEqual((uint)10, ((IPlcItem)item).Value.ByteLength);

            System.Diagnostics.Debug.WriteLine(item.ToString());
        }
Beispiel #4
0
        public void Check_ItemBuilder()
        {
            BitsPlcItem item = new PlcItemBuilder()
                               .ConstructBitsPlcItem("Bits")
                               .ForData()
                               .AtDatablock(0)
                               .AtPosition(1, BitPosition.X2)
                               .WithInitialValue(new BitCollection(false, true, true, true))
                               .Build()
            ;

            Assert.AreEqual(new BitCollection(false, true, true, true), item.Value);
            Assert.AreEqual((uint)3, ((IPlcItem)item).Value.Length);

            System.Diagnostics.Debug.WriteLine(item.ToString());
        }
Beispiel #5
0
        public void Check_ItemBuilder()
        {
            BitPlcItem item = new PlcItemBuilder()
                              .ConstructBitPlcItem("Bit")
                              .ForData()
                              .AtDatablock(0)
                              .AtPosition(4)
                              .AsSet()
                              .Build()
            ;

            Assert.AreEqual(true, item.Value);
            Assert.AreEqual((uint)1, ((IPlcItem)item).Value.Length);

            System.Diagnostics.Debug.WriteLine(item.ToString());
        }