我使用 IHUAPI 做了很多事情,例如将数据从一个历史学家迁移到另一个历史学家、将数据查询到客户端等。现在我正在尝试创建一个标签,但似乎无法弄清楚。 我在 IHUAPI 中看到的唯一内容如下:
[DllImport(DLLNAME, CallingConvention = CallingConvention.StdCall, EntryPoint = "ihuTagAdd@4")]
public static extern ihuErrorCode ihuTagAdd(int serverhandle);
当 serverhandle 是唯一参数时,如何使用它来添加标签? 我确信有办法做到这一点,但我一直在努力弄清楚。
我想出了如何做到这一点:
//create a new tag
IHUAPI.ihuTagClearProperties();
IHUAPI.ihuTagSetNumericProperty(ihuTagProperties.DataType, (double)type);
IHUAPI.ihuTagSetStringProperty(ihuTagProperties.Tagname, TagName);
IHUAPI.ihuTagSetStringProperty(ihuTagProperties.Description, "iHUAPI Generated Tag");
ihuErrorCode result = IHUAPI.ihuTagAdd(handle);
这是一种奇怪的方法,但确实有效。