public Profinet(Instance instanceIndustrialNetwork, FieldBus fieldBus) : base(instanceIndustrialNetwork, fieldBus)
        {
            this.Connection          = (string)instanceIndustrialNetwork.GetAttribute("Connection");
            this.ConfigurationFile   = (string)instanceIndustrialNetwork.GetAttribute("CfgPath");
            this.ProfinetStationName = (string)instanceIndustrialNetwork.GetAttribute("StationName");
            this.NestedDiagnosis     = (bool)instanceIndustrialNetwork.GetAttribute("Nesteddiagnosis");

            //If the option is "888-3 PROFINET Device", there will be no section called "PROFINET_DEVICE"
            if (instanceIndustrialNetwork.Type.Domain.Types.IndexOf("PROFINET_DEVICE") >= 0)
            {
                foreach (Instance instanceProfinetDevice in instanceIndustrialNetwork.Type.Domain["PROFINET_DEVICE"].GetInstances())
                {
                    profinetDevices.Add(instanceProfinetDevice.Name, new ProfinetDevice(instanceProfinetDevice, this));
                }
            }
            profinetInternalDevice = new ProfinetInternalDevice(instanceIndustrialNetwork.Type.Domain["PROFINET_INTERNAL_DEVICE"].GetInstance("PN_Internal_Device"), this);

            foreach (ProfinetDevice device in this.profinetDevices.Values)
            {
                if (!device.HostDevice.Equals(""))
                {
                    if (this.profinetDevices.ContainsKey(device.HostDevice))
                    {
                        device.Host = this.profinetDevices[device.HostDevice];
                        this.profinetDevices[device.HostDevice].Slots.Add(device);
                        this.profinetDevices[device.HostDevice].Slots.Sort((a, b) =>
                        {
                            return(a.SlotIndex - b.SlotIndex);
                        });
                    }
                }
            }
        }
 public IndustrialNetwork(Instance instanceIndustrialNetwork, FieldBus fieldBus)
 {
     this.Name = (string)instanceIndustrialNetwork.GetAttribute("Name");
     this.IdentificationLabel = (string)instanceIndustrialNetwork.GetAttribute("Label");
     this.Simulated           = (bool)instanceIndustrialNetwork.GetAttribute("Simulated");
     this.fieldBus            = fieldBus;
 }
Exemple #3
0
 public CrossConnection(Instance instanceSystemOutput, FieldBus fieldBus)
 {
     this.fieldBus     = fieldBus;
     this.Name         = (string)instanceSystemOutput.GetAttribute("Name");
     this.Resultant    = (string)instanceSystemOutput.GetAttribute("Res");
     this.Actor1       = instanceSystemOutput.GetAttribute("Act1").ToString();
     this.InvertActor1 = (bool)instanceSystemOutput.GetAttribute("Act1_invert");
     this.Operator1    = instanceSystemOutput.GetAttribute("Oper1").ToString();
     if (!string.IsNullOrWhiteSpace(this.Operator1))
     {
         this.Actor2       = instanceSystemOutput.GetAttribute("Act2").ToString();
         this.InvertActor2 = (bool)instanceSystemOutput.GetAttribute("Act2_invert");
         this.Operator2    = instanceSystemOutput.GetAttribute("Oper2").ToString();
         if (!string.IsNullOrWhiteSpace(this.Operator2))
         {
             this.Actor3       = instanceSystemOutput.GetAttribute("Act3").ToString();
             this.InvertActor3 = (bool)instanceSystemOutput.GetAttribute("Act3_invert");
             this.Operator3    = instanceSystemOutput.GetAttribute("Oper3").ToString();
         }
         if (!string.IsNullOrWhiteSpace(this.Operator3))
         {
             this.Actor4       = instanceSystemOutput.GetAttribute("Act4").ToString();
             this.InvertActor4 = (bool)instanceSystemOutput.GetAttribute("Act4_invert");
             this.Operator4    = instanceSystemOutput.GetAttribute("Oper4").ToString();
             if (!string.IsNullOrWhiteSpace(this.Operator4))
             {
                 this.Actor5       = instanceSystemOutput.GetAttribute("Act5").ToString();
                 this.InvertActor5 = (bool)instanceSystemOutput.GetAttribute("Act5_invert");
             }
         }
     }
     //log.Debug(this.Name);
 }
Exemple #4
0
 public AccessLevel(Instance instanceIndustrialNetwork, FieldBus fieldBus)
 {
     this.fieldBus = fieldBus;
     this.Name     = (string)instanceIndustrialNetwork.GetAttribute("Name");
     this.Rapid    = (bool)instanceIndustrialNetwork.GetAttribute("Rapid");
     this.LocalClientinManualMode  = (bool)instanceIndustrialNetwork.GetAttribute("LocalManual");
     this.LocalClientinAutoMode    = (bool)instanceIndustrialNetwork.GetAttribute("LocalAuto");
     this.RemoteClientinManualMode = (bool)instanceIndustrialNetwork.GetAttribute("RemoteManual");
     this.RemoteClientinAutoMode   = (bool)instanceIndustrialNetwork.GetAttribute("RemoteAuto");
 }
        public DeviceNet(Instance instanceIndustrialNetwork, FieldBus fieldBus) : base(instanceIndustrialNetwork, fieldBus)
        {
            this.Address = int.Parse((string)instanceIndustrialNetwork.GetAttribute("Address"));
            this.DeviceNetCommunicationSpeed = (DeviceNetCommunicationSpeed)instanceIndustrialNetwork.GetAttribute("BaudRate");

            foreach (Instance instanceDeviceNetDevice in instanceIndustrialNetwork.Type.Domain["DEVICENET_DEVICE"].GetInstances())
            {
                DeviceNetDevices.Add(instanceDeviceNetDevice.Name, new DeviceNetDevice(instanceDeviceNetDevice, this));
            }
            deviceNetInternalDevice = new DeviceNetInternalDevice(instanceIndustrialNetwork.Type.Domain["DEVICENET_INTERNAL_DEVICE"].GetInstance("DN_Internal_Device"), this);
        }
Exemple #6
0
 public SystemOutput(Instance instanceSystemOutput, FieldBus fieldBus)
 {
     this.fieldBus   = fieldBus;
     this.Status     = (string)instanceSystemOutput.GetAttribute("Status");
     this.SignalName = (string)instanceSystemOutput.GetAttribute("Signal");
     this.Arg1       = instanceSystemOutput.GetAttribute("Arg1").ToString();
     this.Arg2       = instanceSystemOutput.GetAttribute("Arg2").ToString();
     this.Arg3       = instanceSystemOutput.GetAttribute("Arg3").ToString();
     this.Arg4       = instanceSystemOutput.GetAttribute("Arg4").ToString();
     //this.Arg5 = instanceSystemOutput.GetAttribute("Arg5").ToString();
     //this.Arg6 = instanceSystemOutput.GetAttribute("Arg6").ToString();
 }
 public SystemInput(Instance instanceSystemOutput, FieldBus fieldBus)
 {
     this.fieldBus   = fieldBus;
     this.Action     = (string)instanceSystemOutput.GetAttribute("Action");
     this.SignalName = (string)instanceSystemOutput.GetAttribute("Signal");
     this.Arg1       = instanceSystemOutput.GetAttribute("Arg1").ToString();
     this.Arg2       = instanceSystemOutput.GetAttribute("Arg2").ToString();
     this.Arg3       = instanceSystemOutput.GetAttribute("Arg3").ToString();
     this.Arg4       = instanceSystemOutput.GetAttribute("Arg4").ToString();
     this.Arg5       = instanceSystemOutput.GetAttribute("Arg5").ToString();
     this.Arg6       = instanceSystemOutput.GetAttribute("Arg6").ToString();
     this.TaskName   = instanceSystemOutput.GetAttribute("Arg7").ToString();
     //this.Arg8 = instanceSystemOutput.GetAttribute("Arg8").ToString();
 }
Exemple #8
0
        public EtherNetIP(Instance instanceIndustrialNetwork, FieldBus fieldBus) : base(instanceIndustrialNetwork, fieldBus)
        {
            this.Connection = (string)instanceIndustrialNetwork.GetAttribute("Connection");

            foreach (Instance instanceEtherNetIPDevice in instanceIndustrialNetwork.Type.Domain["ETHERNETIP_DEVICE"].GetInstances())
            {
                etherNetIPDevices.Add(instanceEtherNetIPDevice.Name, new EtherNetIPDevice(instanceEtherNetIPDevice, this));
            }
            //If there is no option of "ETHERNETIP"
            if (instanceIndustrialNetwork.Type.Domain.Types.IndexOf("ETHERNETIP_INTERNAL_DEVICE") >= 0)
            {
                etherNetIPInternalDevice = new EtherNetIPInternalDevice(instanceIndustrialNetwork.Type.Domain["ETHERNETIP_INTERNAL_DEVICE"].GetInstance("EN_Internal_Device"), this);
            }
        }
Exemple #9
0
        public Local(Instance instanceIndustrialNetwork, FieldBus fieldBus) : base(instanceIndustrialNetwork, fieldBus)
        {
            if (instanceIndustrialNetwork.Type.Domain.Types.IndexOf("LOCAL_DEVICE") >= 0)
            {
                foreach (Instance instanceProfinetDevice in instanceIndustrialNetwork.Type.Domain["LOCAL_DEVICE"].GetInstances())
                {
                    LocalDevices.Add(instanceProfinetDevice.Name, new LocalDevice(instanceProfinetDevice, this));
                }
            }

            //this.panelDevice = new Device(null, "PANEL", this);
            //this.drv_1Device = new Device(null, "DRV_1", this);
            //this.drv_2Device = new Device(null, "DRV_2", this);
            //this.drv_3Device = new Device(null, "DRV_3", this);
            //this.drv_4Device = new Device(null, "DRV_4", this);
        }
 public Virtual1(Instance instanceIndustrialNetwork, FieldBus fieldBus) : base(instanceIndustrialNetwork, fieldBus)
 {
     this.virtual1Device = new Virtual1Device(null, this);
 }