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.
lj_plc/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/EngineeringDebuggingMode/PlcCommunicationUtil.cs

40 lines
981 B
C#

using Mesnac.Action.ChemicalWeighing.Entity;
using Mesnac.PlcUtils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
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);
}
}
}