Skip to content

dcs.data.processing

DataGathering

Handle data gathering from PLC and export to files.

Provides functionality for collecting data during PLC operations and exporting to JSON and CSV formats.

Parameters:

Name Type Description Default
filename str

Base filename for exported data files.

required

__init__(filename)

Initialize data gathering with specified filename.

write_dict_to_csv(data, header)

Export list of dictionaries to CSV file.

Parameters:

Name Type Description Default
data list

List of dictionaries containing row data.

required
header list

List of column headers for the CSV file.

required

write_dict_to_json(data)

Export dictionary data to JSON file.

Parameters:

Name Type Description Default
data dict

Data dictionary to export to JSON.

required