string PropertyOPCToString(ePropertyTypes propcdeT, object prop) { if (propcdeT == ePropertyTypes.TBinary) { if (prop == null) { return("(null)"); } StringBuilder buffer = new StringBuilder(); byte[] bytes = (byte[])prop; for (int ii = 0; ii < bytes.Length; ii++) { buffer.AppendFormat(null, "{0:X2}", bytes[ii]); } return(buffer.ToString()); } else { if (prop == null) { return(null); } } return(TheCommonUtils.CStr(prop)); }
public cdeP DeclareSensorProperty(string propertyName, ePropertyTypes propertyType, cdeP.TheSensorMeta sensorMeta) { cdeP tProp = GetProperty(propertyName, true); if (tProp.cdeO != cdeMID) { tProp.cdeO = cdeMID; } tProp.cdeE |= 0x04; // cdeCTIM should be updated with changetime tProp.SetSensorMeta(sensorMeta); return(tProp); }