31 lines
501 B
Python
31 lines
501 B
Python
import csv
|
|
|
|
print("Exporter")
|
|
|
|
file = open("PM8000_Modbus_Map.csv", "r")
|
|
data = list(csv.reader(file, delimiter=","))
|
|
file.close()
|
|
|
|
header = """
|
|
typedef struct
|
|
{
|
|
uint16_t address;
|
|
uint16_t size;
|
|
char* type[];
|
|
char* name[];
|
|
|
|
} pm8000_reg_map_t;
|
|
|
|
pm8000_reg_map_t pm8000_reg_map[] = {
|
|
|
|
};
|
|
"""
|
|
|
|
for d in range(1, len(data)):
|
|
if not data[d][1].isnumeric():
|
|
continue
|
|
print("{} @ {}:{} ({}) Tag: {}".format(data[d][0], data[d][1] ,data[d][2] ,data[d][3],data[d][7]))
|
|
|
|
#
|
|
|