|
|
@ -33,7 +33,7 @@ namespace Mesnac.PlcUtils
|
|
|
|
string str = System.Environment.CurrentDirectory;
|
|
|
|
string str = System.Environment.CurrentDirectory;
|
|
|
|
str = str + "\\Mesnac.PlcUtils.dll";
|
|
|
|
str = str + "\\Mesnac.PlcUtils.dll";
|
|
|
|
Assembly assembly = Assembly.LoadFile(str); // 加载程序集(EXE 或 DLL)
|
|
|
|
Assembly assembly = Assembly.LoadFile(str); // 加载程序集(EXE 或 DLL)
|
|
|
|
string AssemName = "JSSD.PolarBind.Plc.Impl." + plcType.GetDescription();
|
|
|
|
string AssemName = "Mesnac.PlcUtils.Impl." + plcType.GetDescription();
|
|
|
|
var obj = assembly.CreateInstance(AssemName, true);
|
|
|
|
var obj = assembly.CreateInstance(AssemName, true);
|
|
|
|
plcInstance = obj as IPlc;
|
|
|
|
plcInstance = obj as IPlc;
|
|
|
|
if (plcInstance == null)
|
|
|
|
if (plcInstance == null)
|
|
|
@ -70,9 +70,16 @@ namespace Mesnac.PlcUtils
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public bool readBoolValue(string address)
|
|
|
|
public bool readBoolValue(string address)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(plcInstance != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return plcInstance.readBoolByAddress(address);
|
|
|
|
return plcInstance.readBoolByAddress(address);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|