You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Mesnac.Action.ChemicalWeighing.Entity;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public class PlcCommunicationUtil
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 从PLC中读取值
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dmValue">要读取的属性</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static string GetDataToString(string dmValue)
|
|
|
|
|
{
|
|
|
|
|
return new DataKeyValue(dmValue).NowValue.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 从PLC中读取值
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dmValue">要读取的属性</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static string GetDataToString(string dmName, string dmValue)
|
|
|
|
|
{
|
|
|
|
|
return GetDataToString(dmName + dmValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|