监控点值写入
/// <summary>
/// 监控点写值
/// </summary>
/// <param name="requet"></param>
public void WriteDmonValue(WriteDmonRequest requet)
{
_fbox.WriteValue(new DataMonitorWriteValueArgsV2()
{
BoxNo = requet.BoxNo, //盒子号
DataMonitorGroupName = requet.DmonGrpName,//监控点组名称
DataMonitorName = requet.DmonName, //监控点条目名称
Value = requet.Value, //条目的值
Type = WriteValueType.AutoParse //条目值类型,0:和监控点值类型一致,1:十进制,2:字符串,
}).Wait();
}
public class WriteDmonRequest
{
public string BoxNo { get; set; }
public string DmonGrpName { get; set; }
public string DmonName { get; set; }
public object Value { get; set; }
}
//在Program,Main函数中调用
class Program
{
static void Main(string[] args)
{
using (var fbox = new FBoxDemo())
{
fbox.Start(); //启动
fbox.StartAllDMonData();//开启FBox所有监控点
fbox.WriteDmonValue();//调用此方法
}
}
}