ZhongJiwei
Member
Hello
i want to append a record to a text format device of Citect, but seems that it overwrite the record every time when open the device, i think it comes from the function DevAppend Use wrongly, any one can correct me, many thanks.
FUNCTION HeaterWrite(STRING TagName)
INT hSysLog;
INT nError;
INT ivar;
INT iResult;
INT iRecord;
hSysLog = DevOpen("SysLog",0);
DevAppend(hSysLog);
DevWriteLn(hSysLog,TagName);
ErrSet(1);
//iResult = ivar/0;
DevWriteLn(hSysLog,"data to write");
nError = IsError();
ErrSet(0);
IF nError <>0 THEN
Message("Error", "Failed to write to device.Error" +IntToStr(nError),16);
END
DevClose(hSysLog);
END
i want to append a record to a text format device of Citect, but seems that it overwrite the record every time when open the device, i think it comes from the function DevAppend Use wrongly, any one can correct me, many thanks.
FUNCTION HeaterWrite(STRING TagName)
INT hSysLog;
INT nError;
INT ivar;
INT iResult;
INT iRecord;
hSysLog = DevOpen("SysLog",0);
DevAppend(hSysLog);
DevWriteLn(hSysLog,TagName);
ErrSet(1);
//iResult = ivar/0;
DevWriteLn(hSysLog,"data to write");
nError = IsError();
ErrSet(0);
IF nError <>0 THEN
Message("Error", "Failed to write to device.Error" +IntToStr(nError),16);
END
DevClose(hSysLog);
END