Esempio n. 1
0
        private void ModifyOptions()
        {
            _log.FunctionEntryMessage("modify options");

            _driverContext.SetSignedProperty("DrvConfig.Options.Serial", 0, Int32.MinValue, Int32.MaxValue, false);
            _driverContext.SetStringProperty("DrvConfig.Options.NetworkAdapter", "STRINGPROP", true);
            _driverContext.SetBooleanProperty("DrvConfig.Options.EnableUDP");
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.LocalUDPPort", 0, 65535);
            _driverContext.SetStringProperty("DrvConfig.Options.BroadcastAddress", "STRINGPROP", true);
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.BroadcastPort", 0, 65535);
            _driverContext.SetBooleanProperty("DrvConfig.Options.EnableDualEndpoint");
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.TCPListenerPort", 0, 65535);
            _driverContext.SetSignedProperty("DrvConfig.Options.DoublePointMapping", 0, Int32.MinValue, Int32.MaxValue, false);
            _driverContext.SetBooleanProperty("DrvConfig.Options.UTCTime");
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.RCVTimeout", 0, 4294967296);
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.SendTimeout", 0, 4294967296);
            _driverContext.SetBooleanProperty("DrvConfig.Options.HalfDuplex");
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.NULOnTime", 0, 9999);
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.NULOffTime", 0, 9999);
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.TripOnTime", 0, 9999);
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.TripOffTime", 0, 9999);
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.CloseOnTime", 0, 9999);
            _driverContext.IncreaseUnsignedProperty("DrvConfig.Options.CloseOffTime", 0, 9999);

            _log.FunctionExitMessage();
        }
        private void ModifyConnection(uint connIndex)
        {
            string connNamePrefix;

            connNamePrefix = "DrvConfig.Connections[" + connIndex.ToString() + "].";

            connIndex = connIndex + 1;

            _log.FunctionEntryMessage($"modify {connIndex}. connection");

            _driverContext.SetUnsignedProperty(connNamePrefix + "NetAddress", connIndex, 0, 65535, true);
            _driverContext.SetStringProperty(connNamePrefix + "ConnectionName", "connection #" + connIndex.ToString(), true);
            _driverContext.SetSignedProperty(connNamePrefix + "KnownID", (Int32)(connIndex), 0, 65535, false);
            _driverContext.SetStringProperty(connNamePrefix + "IPAddress", $"{connIndex}.{connIndex}.{connIndex}.{connIndex}", false);
            _driverContext.SetUnsignedProperty(connNamePrefix + "IPPort", connIndex * 1000, 1, 65535, false);

            _log.FunctionExitMessage();
        }