本文整理汇总了C#中Opc.Ua.NodeId.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# NodeId.ToString方法的具体用法?C# NodeId.ToString怎么用?C# NodeId.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Opc.Ua.NodeId
的用法示例。
在下文中一共展示了NodeId.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteNodeId
/// <summary>
/// Writes an NodeId to the stream.
/// </summary>
public void WriteNodeId(string fieldName, NodeId value)
{
if (NodeId.IsNull(value))
{
WriteSimpleField(fieldName, null, false);
return;
}
PushStructure(fieldName);
if (UseReversibleEncoding)
{
WriteSimpleField("Id", value.ToString(), true);
}
else
{
WriteSimpleField("Id", new NodeId(value.Identifier, 0).ToString(), true);
WriteNamespaceIndex(value.NamespaceIndex);
}
PopStructure();
}
示例2: ReadHistory
private void ReadHistory(DateTime StartTime, DateTime EndTime, NodeId node, uint HCount, String DriverName)
{
ReadRawModifiedDetails details = new ReadRawModifiedDetails();
details.StartTime = DateTime.MinValue;
details.EndTime = DateTime.MinValue;
details.IsReadModified = false;
details.NumValuesPerNode = HCount;
details.ReturnBounds = true;
details.StartTime = StartTime.ToUniversalTime();
details.EndTime = EndTime.ToUniversalTime();
HistoryReadValueId nodeToRead = new HistoryReadValueId();
nodeToRead.NodeId = node;
HistoryReadValueIdCollection nodesToRead = new HistoryReadValueIdCollection();
nodesToRead.Add(nodeToRead);
HistoryReadResultCollection results = null;
DiagnosticInfoCollection diagnosticInfos = null;
m_session.HistoryRead(
null,
new ExtensionObject(details),
TimestampsToReturn.Source,
false,
nodesToRead,
out results,
out diagnosticInfos);
for (int i = 0; i < results.Count; i++)
{
HistoryData hd_results = ExtensionObject.ToEncodeable(results[i].HistoryData) as HistoryData;
if (hd_results != null)
{
for (int ii = 0; ii < hd_results.DataValues.Count; ii++)
{
StatusCode status = hd_results.DataValues[ii].StatusCode;
string timestamp = hd_results.DataValues[ii].SourceTimestamp.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
string value = Utils.Format("{0}", hd_results.DataValues[ii].WrappedValue);
string quality = Utils.Format("{0}", (StatusCode)status.CodeBits);
string historyInfo = Utils.Format("{0:X2}", (int)status.AggregateBits);
Log("UID:" + S80(node.ToString()) + " \tTime: " + timestamp + "\tValue: " + value); // + ", Q:" + quality + ", histInfo:" + historyInfo);
dr = dt.NewRow();
dr["UID"] = node.ToString();
dr["SourceTime"] = timestamp;
dr["Value"] = value;
dr["Name"] = DriverName;
dt.Rows.Add(dr);
}
}
}
}