|
|
|
@ -270,6 +270,33 @@ namespace Aucma.Core.PLc
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 读取Double
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 读取double
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="address"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public double ReadDouble(string address)
|
|
|
|
|
{
|
|
|
|
|
double flag = 0;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
OperateResult<double> read = siemensS7Net.ReadDouble(address);
|
|
|
|
|
if (read.IsSuccess)
|
|
|
|
|
{
|
|
|
|
|
flag = read.Content;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
log.Error("ReadString方法异常" + ex.ToString());
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 写入int16
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 写入int16
|
|
|
|
@ -277,7 +304,7 @@ namespace Aucma.Core.PLc
|
|
|
|
|
/// <param name="address"></param>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public bool WriteInt16(string address, string value)
|
|
|
|
|
public bool WriteInt16(string address, string value)
|
|
|
|
|
{
|
|
|
|
|
bool iflag = false;
|
|
|
|
|
try
|
|
|
|
|