private void AddChangingNodes(FolderState dataFolder)
 {
     if (PlcSimulation.GenerateData)
     {
         StepUpNode             = new SimulatedVariableNode <uint>(SystemContext, CreateBaseVariable(dataFolder, "StepUp", "StepUp", new NodeId((uint)BuiltInType.UInt32), ValueRanks.Scalar, AccessLevels.CurrentReadOrWrite, "Constantly increasing value", NamespaceType.OpcPlcApplications));
         AlternatingBooleanNode = new SimulatedVariableNode <bool>(SystemContext, CreateBaseVariable(dataFolder, "AlternatingBoolean", "AlternatingBoolean", new NodeId((uint)BuiltInType.Boolean), ValueRanks.Scalar, AccessLevels.CurrentRead, "Alternating boolean value", NamespaceType.OpcPlcApplications));
         RandomSignedInt32      = new SimulatedVariableNode <int>(SystemContext, CreateBaseVariable(dataFolder, "RandomSignedInt32", "RandomSignedInt32", new NodeId((uint)BuiltInType.Int32), ValueRanks.Scalar, AccessLevels.CurrentRead, "Random signed 32 bit integer value", NamespaceType.OpcPlcApplications));
         RandomUnsignedInt32    = new SimulatedVariableNode <uint>(SystemContext, CreateBaseVariable(dataFolder, "RandomUnsignedInt32", "RandomUnsignedInt32", new NodeId((uint)BuiltInType.UInt32), ValueRanks.Scalar, AccessLevels.CurrentRead, "Random unsigned 32 bit integer value", NamespaceType.OpcPlcApplications));
     }
     if (PlcSimulation.GenerateSpikes)
     {
         SpikeNode = new SimulatedVariableNode <double>(SystemContext, CreateBaseVariable(dataFolder, "SpikeData", "SpikeData", new NodeId((uint)BuiltInType.Double), ValueRanks.Scalar, AccessLevels.CurrentRead, "Value which generates randomly spikes", NamespaceType.OpcPlcApplications));
     }
     if (PlcSimulation.GenerateDips)
     {
         DipNode = new SimulatedVariableNode <double>(SystemContext, CreateBaseVariable(dataFolder, "DipData", "DipData", new NodeId((uint)BuiltInType.Double), ValueRanks.Scalar, AccessLevels.CurrentRead, "Value which generates randomly dips", NamespaceType.OpcPlcApplications));
     }
     if (PlcSimulation.GeneratePosTrend)
     {
         PosTrendNode = new SimulatedVariableNode <double>(SystemContext, CreateBaseVariable(dataFolder, "PositiveTrendData", "PositiveTrendData", new NodeId((uint)BuiltInType.Double), ValueRanks.Scalar, AccessLevels.CurrentRead, "Value with a slow positive trend", NamespaceType.OpcPlcApplications));
     }
     if (PlcSimulation.GenerateNegTrend)
     {
         NegTrendNode = new SimulatedVariableNode <double>(SystemContext, CreateBaseVariable(dataFolder, "NegativeTrendData", "NegativeTrendData", new NodeId((uint)BuiltInType.Double), ValueRanks.Scalar, AccessLevels.CurrentRead, "Value with a slow negative trend", NamespaceType.OpcPlcApplications));
     }
 }
        private void AddSpecialNodes(FolderState dataFolder)
        {
            if (PlcSimulation.AddSpecialCharName)
            {
                const string SpecialChars = "\"!§$%&/()=?`´\\+~*'#_-:.;,<>|@^°€µ{[]}";

                SpecialCharNameNode = new SimulatedVariableNode <uint>(SystemContext,
                                                                       CreateBaseVariable(dataFolder, "Special_" + SpecialChars, SpecialChars, new NodeId((uint)BuiltInType.UInt32), ValueRanks.Scalar, AccessLevels.CurrentReadOrWrite, "Constantly increasing value", NamespaceType.OpcPlcApplications, defaultValue: (uint)0));
            }

            if (PlcSimulation.AddLongId)
            {
                // Repeat A-Z until 3950 chars are collected.
                var sb = new StringBuilder(4000);
                for (int i = 0; i < 3950; i++)
                {
                    sb.Append((char)(65 + (i % 26)));
                }

                LongIdNode = new SimulatedVariableNode <uint>(SystemContext,
                                                              CreateBaseVariable(dataFolder, sb.ToString(), "LongId3950", new NodeId((uint)BuiltInType.UInt32), ValueRanks.Scalar, AccessLevels.CurrentReadOrWrite, "Constantly increasing value", NamespaceType.OpcPlcApplications, defaultValue: (uint)0));
            }

            if (PlcSimulation.AddLongStringNodes)
            {
                // 10 kB.
                string initialString = new string('A', 10 * 1024);
                LongStringIdNode10 = new SimulatedVariableNode <string>(SystemContext,
                                                                        CreateBaseVariable(dataFolder, "LongString10kB", "LongString10kB", new NodeId((uint)BuiltInType.String), ValueRanks.Scalar, AccessLevels.CurrentReadOrWrite, "Long string", NamespaceType.OpcPlcApplications, initialString));

                // 50 kB.
                initialString      = new string('A', 50 * 1024);
                LongStringIdNode50 = new SimulatedVariableNode <string>(SystemContext,
                                                                        CreateBaseVariable(dataFolder, "LongString50kB", "LongString50kB", new NodeId((uint)BuiltInType.String), ValueRanks.Scalar, AccessLevels.CurrentReadOrWrite, "Long string", NamespaceType.OpcPlcApplications, initialString));

                // 100 kB.
                var initialByteArray = Encoding.UTF8.GetBytes(new string('A', 100 * 1024));
                LongStringIdNode100 = new SimulatedVariableNode <byte[]>(SystemContext,
                                                                         CreateBaseVariable(dataFolder, "LongString100kB", "LongString100kB", new NodeId((uint)BuiltInType.ByteString), ValueRanks.Scalar, AccessLevels.CurrentReadOrWrite, "Long string", NamespaceType.OpcPlcApplications, initialByteArray));

                // 200 kB.
                initialByteArray    = Encoding.UTF8.GetBytes(new string('A', 200 * 1024));
                LongStringIdNode200 = new SimulatedVariableNode <byte[]>(SystemContext,
                                                                         CreateBaseVariable(dataFolder, "LongString200kB", "LongString200kB", new NodeId((uint)BuiltInType.Byte), ValueRanks.OneDimension, AccessLevels.CurrentReadOrWrite, "Long string", NamespaceType.OpcPlcApplications, initialByteArray));
            }
        }