Cicode Programming Reference > Cicode Function Categories > Device Functions Introduction > DevHistory

DevHistory

Renames a device file and any subsequent history files. The current device is closed and renamed as the first history file. For example, the device file 'Templog.txt' is renamed as 'Templog.001'. If a history file 'Templog.001' already exists, it is renamed as 'Templog.002', and so on. The next time data is written to the device, a new device file is created.

Note: If the device file has not been created (that is data has not been written to the device), only existing history files are renamed. Use this function for direct control of the device history process.

Syntax

DevHistory(hDev)

hDev:

The device handle, returned from the DevOpen() function. The device handle identifies the table where all data on the associated device is stored.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

DevOpen, DevControl

Example

! Create history file
DevHistory(hDev);

See Also

Device Functions