{
if (device == null || property == null || dataSize < 1 || recordIndex < 0) return TErrorList.invalid_parameter;
if (isHstRecordInLst(device,property,dataSize,dataFormat)) return 0;
if (arrayType == TArrayType.AT_UNKNOWN)
{
TExportProperty p = propertyList.getFirstProperty(property);
if (p == null) return TErrorList.illegal_property;
TPropertyDescription pd = p.getDescription();
arrayType = pd == null ? TArrayType.AT_UNKNOWN : pd.getArrayType();
}
THistoryRecord hst = new THistoryRecord(this,device,property,dataSize,dataFormat,arrayType,recordIndex,histSpec);
if (useMinimalStorage) hst.setUseMinimalStorage(true);
if (useMonthlyHistoryFiles) hst.setUseMonthlyHistoryFiles(true);