The DataDiSaveToCsv2 function saves the basic data of the DI tag in CSV format from the start time at the specified data intervals.
int @DataDiSaveToCsv2(string tag, int timeType, int year, int month, int day, int hour, int minute, string path, int count, int dataGap, string noDataString);
Parameters
tag : name of DI tag
timeType : 0 - minute data, 1 - hour data
year
month
day
hour
minute
path : csv filePath
count : data count to save
dataGap
noDataString : No data alternative string
return value
If the return value is 1, it is saved successfully; if it is -1, there is an error.
Example
@DataDiSaveToCsv2("DI_0000",0, 2025,11,11,0,0,"C:\\CATDATA\\DI_0000_Min_20251111.csv", 12, 5, "*");
Description :
Save 12 data points at 5-minute intervals (12 five-minute data points over 60 minutes) of DI_0000 digital tag's sub-data from 0:00 on December 14, 2024, to 'C:\CATDATA\DI_0000_Min_20251111.csv'.
If data is not available, record it with * and save.
Version Information
Supported Version: 10.3.7.6 or later
Related Helps