Beispiel #1
0
        // IP-uri PLC: "172.16.4.104" "10.0.0.11" "10.0.0.13" "172.16.4.70"
        //Functie creare Plc
        public void CreatePlc(string plcName, S7.Net.CpuType cpuType, string ip, short rack, short slot)
        {
            // Verificare daca daca exista plc Creat in lista
            if (IsCreatedPlcByIp(ip) || IsCreatedPlcByName(plcName))
            {
                return;
            }
            PlcObjectModel plc = new PlcObjectModel(plcName, cpuType, ip, rack, slot);

            // Creaza plc nou in lista
            ListaPlc.Add(plc);
            // Set Adresa variabila citire index in functie de nume
            switch (plc.PlcName)
            {
            case "PlcCuptor":
                plc.AdresaIndexGaz = "MD130";
                break;

            case "PlcGaddaF2":
                plc.AdresaIndexGaz = "DB10.DBD46";     //Dint
                break;

            case "PlcGaddaF4":
                plc.AdresaIndexGaz = "DB10.DBD46";     //Dint
                break;

            case "PlcElti":
                plc.AdresaIndexGaz = "MD34";     //Dint
                break;

            default:
                break;
            }
        }
Beispiel #2
0
 public PLC(S7.Net.CpuType cpuType, IPAddress iPAddress, short rack, short slot)
 {
     string ip = iPAddress.ToString();
     _plc = new S7.Net.Plc(cpuType, ip, rack, slot);
 }