34 lines
904 B
C#
34 lines
904 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using SystemX.PLC.Interface;
|
|
using SystemX.PLC.Interface.McProtocol;
|
|
using SystemX.PLC.Interface.MxComponent;
|
|
|
|
namespace SystemX.PLC
|
|
{
|
|
public enum ConnectionType
|
|
{
|
|
Mitsubishi_McProtocol = 0,
|
|
Mitsubishi_MxComponent
|
|
}
|
|
|
|
public static class PLCInstanciation
|
|
{
|
|
public static PLCCommManager CreatePLCCommManager(ConnectionType type, string strConfigFilePath)
|
|
{
|
|
switch(type)
|
|
{
|
|
case ConnectionType.Mitsubishi_McProtocol:
|
|
return new PLCCommMcPMgr(strConfigFilePath);
|
|
case ConnectionType.Mitsubishi_MxComponent:
|
|
return new PLCCommMxCMgr(strConfigFilePath);
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|