Beispiel #1
0
 public static void InitPLCS()
 {
     docPlc     = PLCDriverDoc.LoadObj();
     dicDrivers = new Dictionary <string, PLCBaseClass>();
     foreach (KeyValuePair <string, PLCDriverInfo> posInfoPair in docPlc.dicPlcInfo)
     {
         if (posInfoPair.Value.plcType == PLCType.Panasonic)
         {
             dicDrivers.Add(posInfoPair.Key, new PLCPanasonicClass());
             dicDrivers[posInfoPair.Key].Init(posInfoPair.Value.PortName, posInfoPair.Value.BaudRate,
                                              posInfoPair.Value.Parity, posInfoPair.Value.DataBits, posInfoPair.Value.StopBits);
         }
         if (posInfoPair.Value.plcType == PLCType.Omron)
         {
             dicDrivers.Add(posInfoPair.Key, new PLCOmronClass());
             dicDrivers[posInfoPair.Key].Init(posInfoPair.Value.PortName, posInfoPair.Value.BaudRate,
                                              posInfoPair.Value.Parity, posInfoPair.Value.DataBits, posInfoPair.Value.StopBits);
         }
     }
     PLCControlManageClass.StartScan();
 }
Beispiel #2
0
 public static void LoadData()
 {
     docPlc = PLCDriverDoc.LoadObj();
 }