Ejemplo n.º 1
0
        /// <summary>
        /// Connects to a PLC using the given plc connection string.
        /// </summary>
        /// <param name="url"> plc connection string. </param>
        /// <returns> PlcConnection object. </returns>
        public virtual IPlcConnection GetConnection(string url)
        {
            IPlcDriver     driver     = GetDriver(url);
            IPlcConnection connection = (IPlcConnection)driver.ConnectAsync(url);

            connection.ConnectAsync();
            return(connection);
        }
Ejemplo n.º 2
0
        private static void checkAlarm(IPlcDriver c, String variable)
        {
            bool presenza = (bool)c.readBool("RULLI_CENTRO_TAGLI.RD_Anticipo_Pz_Da_Hundegger");

            if (presenza)
            {
                throw new Exception(variable);
            }
        }
Ejemplo n.º 3
0
 public PLC(IPlcDriver driver)
 {
     this.driver = driver;
 }