Beispiel #1
0
        private void InitializationClient()
        {
            Device m_device;

            BaseStation.ItemDescriber.XMLManagement xml_desc = new BaseStation.ItemDescriber.XMLManagement();
            Main.m_ds_dsc = new BaseStation.ItemDescriber.ItemDecriberDataSet();
            xml_desc.readXMLFile(Main.m_ds_dsc, CAS.DataPorter.Properties.Settings.Default.ItemDscConfigurationFile);
            //Device initialization:
            m_device = new CAS.Lib.DeviceSimulator.Device();
            HTTPSoapServer.SetDevice(m_device);
            //initialization from xml file
            //servers/groups/tags initialization
            using (ConfigurationManagement cm = new ConfigurationManagement())
            {
                cm.ReadConfiguration(AppConfigManagement.filename);
                foreach (OPCCliConfiguration.ServersRow srvdsc in cm.Configuartion.Servers)
                {
                    //server initialization
                    OPCDataQueue.CrateServer(srvdsc, ref m_VolumeConstrain);
                }
                foreach (OPCCliConfiguration.TransactionsRow transdsc in cm.Configuartion.Transactions)
                {
                    OPCDataQueue.CreateTransaction(transdsc);
                }
            }
            OPCDataQueue.SwitchOnScanning();
            MonitorInterface.Start(cProductName, cProductVersion);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes the specified OPC DA Clent.
 /// </summary>
 /// <param name="fileName">Name of the file containing the configuration of the client.</param>
 private void Initialize(string fileName)
 {
     if (string.IsNullOrEmpty(fileName))
     {
         return;
     }
     using (ConfigurationManagement cm = new ConfigurationManagement())
     {
         cm.ReadConfiguration(fileName);
         foreach (OPCCliConfiguration.ServersRow srvdsc in cm.Configuartion.Servers)
         {
             try
             {
                 //server initialization
                 CrateServer(srvdsc, ref m_VolumeConstrain);
             }
             catch (Exception ex)
             {
                 TraceEvent.Tracer.TraceWarning(51, this.GetType().Name + ".Initialize",
                                                "Unable to create OPC interface server: " + ex.Message);
             }
         }
     }
 }