new file: CopyPaste.py

new file:   DB SIPA Supervision.db
	new file:   DB_SIPA_Supervision_Excel.xlsx
	new file:   DB_Structure.csv
	new file:   DB_Structure.xlsx
	new file:   DB_Structure.xml
	new file:   DB_to_Excel.py
	new file:   ExpandDB.py
	new file:   ExportData.py
	new file:   __pycache__/ExpandDB.cpython-310.pyc
	new file:   __pycache__/ExportData.cpython-310.pyc
	new file:   db_definitions.json
	new file:   udt_definitions.json
This commit is contained in:
Miguel 2024-04-21 10:22:36 +02:00
commit fa6b7573c7
13 changed files with 1973 additions and 0 deletions

28
CopyPaste.py Normal file
View File

@ -0,0 +1,28 @@
def calculate_offsets(db_struct, current_offset=0):
"""
Recursively calculate byte offsets for each field in the DB structure,
applying general alignment rules except inside arrays.
"""
if isinstance(db_struct, dict):
for key, value in db_struct.items():
if isinstance(value, dict) and 'type' in value:
is_array_element = value.get('is_array_element', False)
type_name = value['type']
size = type_sizes.get(type_name, 1)
if 'String' in type_name:
match = re.match(r'String\[(\d+)\]', type_name)
if match:
size = int(match.group(1)) + 2 # String length + 2 for the null terminator and length prefix
if not is_array_element and current_offset % 2 != 0:
current_offset += 1 # Align to the next even offset if it's not an array element
value['offset'] = current_offset
current_offset += size
# Recursively handle nested structures
if isinstance(value, dict):
current_offset = calculate_offsets(value, current_offset)
return current_offset

250
DB SIPA Supervision.db Normal file
View File

@ -0,0 +1,250 @@
TYPE "UDT SIPA SV Main"
VERSION : 0.1
STRUCT
N1 : DInt; // .DB_IOT.USERLEVEL
N2 : String[81]; // .DB_IOT.USERNAME
N3 : String[81]; // .DB_IOT.NOME_RICETTA
N4 : Int; // .DB_IOT.NEXT_MAINT_CYCLES
N5 : Struct // .DB_IOT.NEXT_MAINT_ITEM
V1 : String[254];
V2 : String[254];
V3 : String[254];
V4 : String[254];
V5 : String[8];
END_STRUCT;
N6 : Array[1..3] of Real; // .DB_IOT.ELECTRIC_VOLTAGE_PHASE_D
N7 : Array[1..3] of Real; // .DB_IOT.ELECTRIC_CURRENT_PHASE_D
N8 : Real; // .DB_IOT.ELECTRIC_POWER_D
N9 : Real; // .DB_IOT.ELECTRIC_POWER_FACTOR_D
N10 : Real; // .DB_IOT.ELECTRIC_POWER_HOUR_D
N11 : Real; // .DB_IOT.ELECTRIC_POWER_WH
END_STRUCT;
END_TYPE
TYPE "UDT SIPA SV Section"
VERSION : 0.1
STRUCT
N1 : DInt; // .DB_IOT.STATO_MACCHINA
N2 : DInt; // .DB_IOT.ALLARME_FERMO
N3 : DInt; // .DB_IOT.WARNING_ATTIVO (che compromette produzione)
N4 : Int; // .DB_IOT.STATO_OPERATIVO (Semaforo)
N5 : Int; // .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)
N6 : DInt; // .DB_IOT.ALARM_STOP_NO
N7 : Struct // .DB_IOT.COUNTER
V1 : DInt; // PIECES_TOT
V2 : DInt; // PIECES_OK
V3 : DInt; // PIECES_KO_1
V4 : DInt; // PIECES_KO_2
V5 : DInt; // PIECES_KO_3
V6 : DInt; // PIECES_KO_4
V7 : DInt; // PIECES_KO_5
V8 : DInt; // PIECES_KO_6
V9 : DInt; // PIECES_KO_7
V10 : DInt; // PIECES_KO_8
V11 : DInt; // PIECES_KO_9
V12 : DInt; // PIECES_KO_10
V13 : DInt; // T_ALARM_HOURS
V14 : DInt; // T_DRY_CYCLE_HOURS
V15 : DInt; // T_POWERED_HOURS
V16 : DInt; // T_PRODUCT_100_HOURS
V17 : DInt; // T_PRODUCT_0_HOURS
V18 : DInt; // T_STOP_HOURS
V19 : Int; // T_ALARM_MINUTES
V20 : Int; // T_DRY_CYCLE_MINUTES
V21 : Int; // T_POWERED_MINUTES
V22 : Int; // T_PRODUCT_100_MINUTES
V23 : Int; // T_PRODUCT_0_MINUTES
V24 : Int; // T_STOP_MINUTES
END_STRUCT;
END_STRUCT;
END_TYPE
DATA_BLOCK "DB SIPA Supervision"
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
NON_RETAIN
STRUCT
MAIN : "UDT SIPA SV Main";
SECT1 : "UDT SIPA SV Section";
SECT2 : "UDT SIPA SV Section";
SECT3 : "UDT SIPA SV Section";
SECT4 : "UDT SIPA SV Section";
SECT5 : "UDT SIPA SV Section";
END_STRUCT;
BEGIN
MAIN.N1 := 9;
MAIN.N2 := 'superuser ';
MAIN.N3 := '0,4 L Petaloid Base';
MAIN.N4 := 0;
MAIN.N5.V1 := 'testo da inserire';
MAIN.N5.V2 := '';
MAIN.N5.V3 := '';
MAIN.N5.V4 := '';
MAIN.N5.V5 := '';
MAIN.N6[1] := 0.0;
MAIN.N6[2] := 0.0;
MAIN.N6[3] := 0.0;
MAIN.N7[1] := 0.0;
MAIN.N7[2] := 0.0;
MAIN.N7[3] := 0.0;
MAIN.N8 := 0.0;
MAIN.N9 := 0.0;
MAIN.N10 := 0.0;
MAIN.N11 := 0.0;
SECT1.N1 := 2;
SECT1.N2 := 0;
SECT1.N3 := 0;
SECT1.N4 := 3;
SECT1.N5 := 2;
SECT1.N6 := 0;
SECT1.N7.V1 := 0;
SECT1.N7.V2 := 0;
SECT1.N7.V3 := 0;
SECT1.N7.V4 := 0;
SECT1.N7.V5 := 0;
SECT1.N7.V6 := 0;
SECT1.N7.V7 := 0;
SECT1.N7.V8 := 0;
SECT1.N7.V9 := 0;
SECT1.N7.V10 := 0;
SECT1.N7.V11 := 0;
SECT1.N7.V12 := 0;
SECT1.N7.V13 := 0;
SECT1.N7.V14 := 0;
SECT1.N7.V15 := 0;
SECT1.N7.V16 := 0;
SECT1.N7.V17 := 0;
SECT1.N7.V18 := 0;
SECT1.N7.V19 := 0;
SECT1.N7.V20 := 0;
SECT1.N7.V21 := 0;
SECT1.N7.V22 := 0;
SECT1.N7.V23 := 0;
SECT1.N7.V24 := 0;
SECT2.N1 := 0;
SECT2.N2 := 0;
SECT2.N3 := 0;
SECT2.N4 := 0;
SECT2.N5 := 0;
SECT2.N6 := 0;
SECT2.N7.V1 := 0;
SECT2.N7.V2 := 0;
SECT2.N7.V3 := 0;
SECT2.N7.V4 := 0;
SECT2.N7.V5 := 0;
SECT2.N7.V6 := 0;
SECT2.N7.V7 := 0;
SECT2.N7.V8 := 0;
SECT2.N7.V9 := 0;
SECT2.N7.V10 := 0;
SECT2.N7.V11 := 0;
SECT2.N7.V12 := 0;
SECT2.N7.V13 := 0;
SECT2.N7.V14 := 0;
SECT2.N7.V15 := 0;
SECT2.N7.V16 := 0;
SECT2.N7.V17 := 0;
SECT2.N7.V18 := 0;
SECT2.N7.V19 := 0;
SECT2.N7.V20 := 0;
SECT2.N7.V21 := 0;
SECT2.N7.V22 := 0;
SECT2.N7.V23 := 0;
SECT2.N7.V24 := 0;
SECT3.N1 := 0;
SECT3.N2 := 0;
SECT3.N3 := 0;
SECT3.N4 := 0;
SECT3.N5 := 0;
SECT3.N6 := 0;
SECT3.N7.V1 := 0;
SECT3.N7.V2 := 0;
SECT3.N7.V3 := 0;
SECT3.N7.V4 := 0;
SECT3.N7.V5 := 0;
SECT3.N7.V6 := 0;
SECT3.N7.V7 := 0;
SECT3.N7.V8 := 0;
SECT3.N7.V9 := 0;
SECT3.N7.V10 := 0;
SECT3.N7.V11 := 0;
SECT3.N7.V12 := 0;
SECT3.N7.V13 := 0;
SECT3.N7.V14 := 0;
SECT3.N7.V15 := 0;
SECT3.N7.V16 := 0;
SECT3.N7.V17 := 0;
SECT3.N7.V18 := 0;
SECT3.N7.V19 := 0;
SECT3.N7.V20 := 0;
SECT3.N7.V21 := 0;
SECT3.N7.V22 := 0;
SECT3.N7.V23 := 0;
SECT3.N7.V24 := 0;
SECT4.N1 := 0;
SECT4.N2 := 0;
SECT4.N3 := 0;
SECT4.N4 := 0;
SECT4.N5 := 0;
SECT4.N6 := 0;
SECT4.N7.V1 := 0;
SECT4.N7.V2 := 0;
SECT4.N7.V3 := 0;
SECT4.N7.V4 := 0;
SECT4.N7.V5 := 0;
SECT4.N7.V6 := 0;
SECT4.N7.V7 := 0;
SECT4.N7.V8 := 0;
SECT4.N7.V9 := 0;
SECT4.N7.V10 := 0;
SECT4.N7.V11 := 0;
SECT4.N7.V12 := 0;
SECT4.N7.V13 := 0;
SECT4.N7.V14 := 0;
SECT4.N7.V15 := 0;
SECT4.N7.V16 := 0;
SECT4.N7.V17 := 0;
SECT4.N7.V18 := 0;
SECT4.N7.V19 := 0;
SECT4.N7.V20 := 0;
SECT4.N7.V21 := 0;
SECT4.N7.V22 := 0;
SECT4.N7.V23 := 0;
SECT4.N7.V24 := 0;
SECT5.N1 := 0;
SECT5.N2 := 0;
SECT5.N3 := 0;
SECT5.N4 := 0;
SECT5.N5 := 0;
SECT5.N6 := 0;
SECT5.N7.V1 := 0;
SECT5.N7.V2 := 0;
SECT5.N7.V3 := 0;
SECT5.N7.V4 := 0;
SECT5.N7.V5 := 0;
SECT5.N7.V6 := 0;
SECT5.N7.V7 := 0;
SECT5.N7.V8 := 0;
SECT5.N7.V9 := 0;
SECT5.N7.V10 := 0;
SECT5.N7.V11 := 0;
SECT5.N7.V12 := 0;
SECT5.N7.V13 := 0;
SECT5.N7.V14 := 0;
SECT5.N7.V15 := 0;
SECT5.N7.V16 := 0;
SECT5.N7.V17 := 0;
SECT5.N7.V18 := 0;
SECT5.N7.V19 := 0;
SECT5.N7.V20 := 0;
SECT5.N7.V21 := 0;
SECT5.N7.V22 := 0;
SECT5.N7.V23 := 0;
SECT5.N7.V24 := 0;
END_DATA_BLOCK

Binary file not shown.

176
DB_Structure.csv Normal file
View File

@ -0,0 +1,176 @@
Nombre,Tipo,Offset,Comentario
MAIN,"""UDT SIPA SV Main""",0,
MAIN.N1,DInt,0,.DB_IOT.USERLEVEL
MAIN.N2,String[81],4,.DB_IOT.USERNAME
MAIN.N3,String[81],88,.DB_IOT.NOME_RICETTA
MAIN.N4,Int,172,.DB_IOT.NEXT_MAINT_CYCLES
MAIN.N5.V1,String[254],174,
MAIN.N5.V2,String[254],430,
MAIN.N5.V3,String[254],686,
MAIN.N5.V4,String[254],942,
MAIN.N5.V5,String[8],1198,
MAIN.N6.type_1,Real,1208,N/A
MAIN.N6.type_2,Real,1212,N/A
MAIN.N6.type_3,Real,1216,N/A
MAIN.N7.type_1,Real,1220,N/A
MAIN.N7.type_2,Real,1224,N/A
MAIN.N7.type_3,Real,1228,N/A
MAIN.N8,Real,1232,.DB_IOT.ELECTRIC_POWER_D
MAIN.N9,Real,1236,.DB_IOT.ELECTRIC_POWER_FACTOR_D
MAIN.N10,Real,1240,.DB_IOT.ELECTRIC_POWER_HOUR_D
MAIN.N11,Real,1244,.DB_IOT.ELECTRIC_POWER_WH
SECT1,"""UDT SIPA SV Section""",1248,
SECT1.N1,DInt,1664,.DB_IOT.STATO_MACCHINA
SECT1.N2,DInt,1668,.DB_IOT.ALLARME_FERMO
SECT1.N3,DInt,1672,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
SECT1.N4,Int,1676,.DB_IOT.STATO_OPERATIVO (Semaforo)
SECT1.N5,Int,1678,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
SECT1.N6,DInt,1680,.DB_IOT.ALARM_STOP_NO
SECT1.N7.V1,DInt,1684,PIECES_TOT
SECT1.N7.V2,DInt,1688,PIECES_OK
SECT1.N7.V3,DInt,1692,PIECES_KO_1
SECT1.N7.V4,DInt,1696,PIECES_KO_2
SECT1.N7.V5,DInt,1700,PIECES_KO_3
SECT1.N7.V6,DInt,1704,PIECES_KO_4
SECT1.N7.V7,DInt,1708,PIECES_KO_5
SECT1.N7.V8,DInt,1712,PIECES_KO_6
SECT1.N7.V9,DInt,1716,PIECES_KO_7
SECT1.N7.V10,DInt,1720,PIECES_KO_8
SECT1.N7.V11,DInt,1724,PIECES_KO_9
SECT1.N7.V12,DInt,1728,PIECES_KO_10
SECT1.N7.V13,DInt,1732,T_ALARM_HOURS
SECT1.N7.V14,DInt,1736,T_DRY_CYCLE_HOURS
SECT1.N7.V15,DInt,1740,T_POWERED_HOURS
SECT1.N7.V16,DInt,1744,T_PRODUCT_100_HOURS
SECT1.N7.V17,DInt,1748,T_PRODUCT_0_HOURS
SECT1.N7.V18,DInt,1752,T_STOP_HOURS
SECT1.N7.V19,Int,1756,T_ALARM_MINUTES
SECT1.N7.V20,Int,1758,T_DRY_CYCLE_MINUTES
SECT1.N7.V21,Int,1760,T_POWERED_MINUTES
SECT1.N7.V22,Int,1762,T_PRODUCT_100_MINUTES
SECT1.N7.V23,Int,1764,T_PRODUCT_0_MINUTES
SECT1.N7.V24,Int,1766,T_STOP_MINUTES
SECT2,"""UDT SIPA SV Section""",1352,
SECT2.N1,DInt,1664,.DB_IOT.STATO_MACCHINA
SECT2.N2,DInt,1668,.DB_IOT.ALLARME_FERMO
SECT2.N3,DInt,1672,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
SECT2.N4,Int,1676,.DB_IOT.STATO_OPERATIVO (Semaforo)
SECT2.N5,Int,1678,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
SECT2.N6,DInt,1680,.DB_IOT.ALARM_STOP_NO
SECT2.N7.V1,DInt,1684,PIECES_TOT
SECT2.N7.V2,DInt,1688,PIECES_OK
SECT2.N7.V3,DInt,1692,PIECES_KO_1
SECT2.N7.V4,DInt,1696,PIECES_KO_2
SECT2.N7.V5,DInt,1700,PIECES_KO_3
SECT2.N7.V6,DInt,1704,PIECES_KO_4
SECT2.N7.V7,DInt,1708,PIECES_KO_5
SECT2.N7.V8,DInt,1712,PIECES_KO_6
SECT2.N7.V9,DInt,1716,PIECES_KO_7
SECT2.N7.V10,DInt,1720,PIECES_KO_8
SECT2.N7.V11,DInt,1724,PIECES_KO_9
SECT2.N7.V12,DInt,1728,PIECES_KO_10
SECT2.N7.V13,DInt,1732,T_ALARM_HOURS
SECT2.N7.V14,DInt,1736,T_DRY_CYCLE_HOURS
SECT2.N7.V15,DInt,1740,T_POWERED_HOURS
SECT2.N7.V16,DInt,1744,T_PRODUCT_100_HOURS
SECT2.N7.V17,DInt,1748,T_PRODUCT_0_HOURS
SECT2.N7.V18,DInt,1752,T_STOP_HOURS
SECT2.N7.V19,Int,1756,T_ALARM_MINUTES
SECT2.N7.V20,Int,1758,T_DRY_CYCLE_MINUTES
SECT2.N7.V21,Int,1760,T_POWERED_MINUTES
SECT2.N7.V22,Int,1762,T_PRODUCT_100_MINUTES
SECT2.N7.V23,Int,1764,T_PRODUCT_0_MINUTES
SECT2.N7.V24,Int,1766,T_STOP_MINUTES
SECT3,"""UDT SIPA SV Section""",1456,
SECT3.N1,DInt,1664,.DB_IOT.STATO_MACCHINA
SECT3.N2,DInt,1668,.DB_IOT.ALLARME_FERMO
SECT3.N3,DInt,1672,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
SECT3.N4,Int,1676,.DB_IOT.STATO_OPERATIVO (Semaforo)
SECT3.N5,Int,1678,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
SECT3.N6,DInt,1680,.DB_IOT.ALARM_STOP_NO
SECT3.N7.V1,DInt,1684,PIECES_TOT
SECT3.N7.V2,DInt,1688,PIECES_OK
SECT3.N7.V3,DInt,1692,PIECES_KO_1
SECT3.N7.V4,DInt,1696,PIECES_KO_2
SECT3.N7.V5,DInt,1700,PIECES_KO_3
SECT3.N7.V6,DInt,1704,PIECES_KO_4
SECT3.N7.V7,DInt,1708,PIECES_KO_5
SECT3.N7.V8,DInt,1712,PIECES_KO_6
SECT3.N7.V9,DInt,1716,PIECES_KO_7
SECT3.N7.V10,DInt,1720,PIECES_KO_8
SECT3.N7.V11,DInt,1724,PIECES_KO_9
SECT3.N7.V12,DInt,1728,PIECES_KO_10
SECT3.N7.V13,DInt,1732,T_ALARM_HOURS
SECT3.N7.V14,DInt,1736,T_DRY_CYCLE_HOURS
SECT3.N7.V15,DInt,1740,T_POWERED_HOURS
SECT3.N7.V16,DInt,1744,T_PRODUCT_100_HOURS
SECT3.N7.V17,DInt,1748,T_PRODUCT_0_HOURS
SECT3.N7.V18,DInt,1752,T_STOP_HOURS
SECT3.N7.V19,Int,1756,T_ALARM_MINUTES
SECT3.N7.V20,Int,1758,T_DRY_CYCLE_MINUTES
SECT3.N7.V21,Int,1760,T_POWERED_MINUTES
SECT3.N7.V22,Int,1762,T_PRODUCT_100_MINUTES
SECT3.N7.V23,Int,1764,T_PRODUCT_0_MINUTES
SECT3.N7.V24,Int,1766,T_STOP_MINUTES
SECT4,"""UDT SIPA SV Section""",1560,
SECT4.N1,DInt,1664,.DB_IOT.STATO_MACCHINA
SECT4.N2,DInt,1668,.DB_IOT.ALLARME_FERMO
SECT4.N3,DInt,1672,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
SECT4.N4,Int,1676,.DB_IOT.STATO_OPERATIVO (Semaforo)
SECT4.N5,Int,1678,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
SECT4.N6,DInt,1680,.DB_IOT.ALARM_STOP_NO
SECT4.N7.V1,DInt,1684,PIECES_TOT
SECT4.N7.V2,DInt,1688,PIECES_OK
SECT4.N7.V3,DInt,1692,PIECES_KO_1
SECT4.N7.V4,DInt,1696,PIECES_KO_2
SECT4.N7.V5,DInt,1700,PIECES_KO_3
SECT4.N7.V6,DInt,1704,PIECES_KO_4
SECT4.N7.V7,DInt,1708,PIECES_KO_5
SECT4.N7.V8,DInt,1712,PIECES_KO_6
SECT4.N7.V9,DInt,1716,PIECES_KO_7
SECT4.N7.V10,DInt,1720,PIECES_KO_8
SECT4.N7.V11,DInt,1724,PIECES_KO_9
SECT4.N7.V12,DInt,1728,PIECES_KO_10
SECT4.N7.V13,DInt,1732,T_ALARM_HOURS
SECT4.N7.V14,DInt,1736,T_DRY_CYCLE_HOURS
SECT4.N7.V15,DInt,1740,T_POWERED_HOURS
SECT4.N7.V16,DInt,1744,T_PRODUCT_100_HOURS
SECT4.N7.V17,DInt,1748,T_PRODUCT_0_HOURS
SECT4.N7.V18,DInt,1752,T_STOP_HOURS
SECT4.N7.V19,Int,1756,T_ALARM_MINUTES
SECT4.N7.V20,Int,1758,T_DRY_CYCLE_MINUTES
SECT4.N7.V21,Int,1760,T_POWERED_MINUTES
SECT4.N7.V22,Int,1762,T_PRODUCT_100_MINUTES
SECT4.N7.V23,Int,1764,T_PRODUCT_0_MINUTES
SECT4.N7.V24,Int,1766,T_STOP_MINUTES
SECT5,"""UDT SIPA SV Section""",1664,
SECT5.N1,DInt,1664,.DB_IOT.STATO_MACCHINA
SECT5.N2,DInt,1668,.DB_IOT.ALLARME_FERMO
SECT5.N3,DInt,1672,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
SECT5.N4,Int,1676,.DB_IOT.STATO_OPERATIVO (Semaforo)
SECT5.N5,Int,1678,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
SECT5.N6,DInt,1680,.DB_IOT.ALARM_STOP_NO
SECT5.N7.V1,DInt,1684,PIECES_TOT
SECT5.N7.V2,DInt,1688,PIECES_OK
SECT5.N7.V3,DInt,1692,PIECES_KO_1
SECT5.N7.V4,DInt,1696,PIECES_KO_2
SECT5.N7.V5,DInt,1700,PIECES_KO_3
SECT5.N7.V6,DInt,1704,PIECES_KO_4
SECT5.N7.V7,DInt,1708,PIECES_KO_5
SECT5.N7.V8,DInt,1712,PIECES_KO_6
SECT5.N7.V9,DInt,1716,PIECES_KO_7
SECT5.N7.V10,DInt,1720,PIECES_KO_8
SECT5.N7.V11,DInt,1724,PIECES_KO_9
SECT5.N7.V12,DInt,1728,PIECES_KO_10
SECT5.N7.V13,DInt,1732,T_ALARM_HOURS
SECT5.N7.V14,DInt,1736,T_DRY_CYCLE_HOURS
SECT5.N7.V15,DInt,1740,T_POWERED_HOURS
SECT5.N7.V16,DInt,1744,T_PRODUCT_100_HOURS
SECT5.N7.V17,DInt,1748,T_PRODUCT_0_HOURS
SECT5.N7.V18,DInt,1752,T_STOP_HOURS
SECT5.N7.V19,Int,1756,T_ALARM_MINUTES
SECT5.N7.V20,Int,1758,T_DRY_CYCLE_MINUTES
SECT5.N7.V21,Int,1760,T_POWERED_MINUTES
SECT5.N7.V22,Int,1762,T_PRODUCT_100_MINUTES
SECT5.N7.V23,Int,1764,T_PRODUCT_0_MINUTES
SECT5.N7.V24,Int,1766,T_STOP_MINUTES
1 Nombre Tipo Offset Comentario
2 MAIN "UDT SIPA SV Main" 0
3 MAIN.N1 DInt 0 .DB_IOT.USERLEVEL
4 MAIN.N2 String[81] 4 .DB_IOT.USERNAME
5 MAIN.N3 String[81] 88 .DB_IOT.NOME_RICETTA
6 MAIN.N4 Int 172 .DB_IOT.NEXT_MAINT_CYCLES
7 MAIN.N5.V1 String[254] 174
8 MAIN.N5.V2 String[254] 430
9 MAIN.N5.V3 String[254] 686
10 MAIN.N5.V4 String[254] 942
11 MAIN.N5.V5 String[8] 1198
12 MAIN.N6.type_1 Real 1208 N/A
13 MAIN.N6.type_2 Real 1212 N/A
14 MAIN.N6.type_3 Real 1216 N/A
15 MAIN.N7.type_1 Real 1220 N/A
16 MAIN.N7.type_2 Real 1224 N/A
17 MAIN.N7.type_3 Real 1228 N/A
18 MAIN.N8 Real 1232 .DB_IOT.ELECTRIC_POWER_D
19 MAIN.N9 Real 1236 .DB_IOT.ELECTRIC_POWER_FACTOR_D
20 MAIN.N10 Real 1240 .DB_IOT.ELECTRIC_POWER_HOUR_D
21 MAIN.N11 Real 1244 .DB_IOT.ELECTRIC_POWER_WH
22 SECT1 "UDT SIPA SV Section" 1248
23 SECT1.N1 DInt 1664 .DB_IOT.STATO_MACCHINA
24 SECT1.N2 DInt 1668 .DB_IOT.ALLARME_FERMO
25 SECT1.N3 DInt 1672 .DB_IOT.WARNING_ATTIVO (che compromette produzione)
26 SECT1.N4 Int 1676 .DB_IOT.STATO_OPERATIVO (Semaforo)
27 SECT1.N5 Int 1678 .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)
28 SECT1.N6 DInt 1680 .DB_IOT.ALARM_STOP_NO
29 SECT1.N7.V1 DInt 1684 PIECES_TOT
30 SECT1.N7.V2 DInt 1688 PIECES_OK
31 SECT1.N7.V3 DInt 1692 PIECES_KO_1
32 SECT1.N7.V4 DInt 1696 PIECES_KO_2
33 SECT1.N7.V5 DInt 1700 PIECES_KO_3
34 SECT1.N7.V6 DInt 1704 PIECES_KO_4
35 SECT1.N7.V7 DInt 1708 PIECES_KO_5
36 SECT1.N7.V8 DInt 1712 PIECES_KO_6
37 SECT1.N7.V9 DInt 1716 PIECES_KO_7
38 SECT1.N7.V10 DInt 1720 PIECES_KO_8
39 SECT1.N7.V11 DInt 1724 PIECES_KO_9
40 SECT1.N7.V12 DInt 1728 PIECES_KO_10
41 SECT1.N7.V13 DInt 1732 T_ALARM_HOURS
42 SECT1.N7.V14 DInt 1736 T_DRY_CYCLE_HOURS
43 SECT1.N7.V15 DInt 1740 T_POWERED_HOURS
44 SECT1.N7.V16 DInt 1744 T_PRODUCT_100_HOURS
45 SECT1.N7.V17 DInt 1748 T_PRODUCT_0_HOURS
46 SECT1.N7.V18 DInt 1752 T_STOP_HOURS
47 SECT1.N7.V19 Int 1756 T_ALARM_MINUTES
48 SECT1.N7.V20 Int 1758 T_DRY_CYCLE_MINUTES
49 SECT1.N7.V21 Int 1760 T_POWERED_MINUTES
50 SECT1.N7.V22 Int 1762 T_PRODUCT_100_MINUTES
51 SECT1.N7.V23 Int 1764 T_PRODUCT_0_MINUTES
52 SECT1.N7.V24 Int 1766 T_STOP_MINUTES
53 SECT2 "UDT SIPA SV Section" 1352
54 SECT2.N1 DInt 1664 .DB_IOT.STATO_MACCHINA
55 SECT2.N2 DInt 1668 .DB_IOT.ALLARME_FERMO
56 SECT2.N3 DInt 1672 .DB_IOT.WARNING_ATTIVO (che compromette produzione)
57 SECT2.N4 Int 1676 .DB_IOT.STATO_OPERATIVO (Semaforo)
58 SECT2.N5 Int 1678 .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)
59 SECT2.N6 DInt 1680 .DB_IOT.ALARM_STOP_NO
60 SECT2.N7.V1 DInt 1684 PIECES_TOT
61 SECT2.N7.V2 DInt 1688 PIECES_OK
62 SECT2.N7.V3 DInt 1692 PIECES_KO_1
63 SECT2.N7.V4 DInt 1696 PIECES_KO_2
64 SECT2.N7.V5 DInt 1700 PIECES_KO_3
65 SECT2.N7.V6 DInt 1704 PIECES_KO_4
66 SECT2.N7.V7 DInt 1708 PIECES_KO_5
67 SECT2.N7.V8 DInt 1712 PIECES_KO_6
68 SECT2.N7.V9 DInt 1716 PIECES_KO_7
69 SECT2.N7.V10 DInt 1720 PIECES_KO_8
70 SECT2.N7.V11 DInt 1724 PIECES_KO_9
71 SECT2.N7.V12 DInt 1728 PIECES_KO_10
72 SECT2.N7.V13 DInt 1732 T_ALARM_HOURS
73 SECT2.N7.V14 DInt 1736 T_DRY_CYCLE_HOURS
74 SECT2.N7.V15 DInt 1740 T_POWERED_HOURS
75 SECT2.N7.V16 DInt 1744 T_PRODUCT_100_HOURS
76 SECT2.N7.V17 DInt 1748 T_PRODUCT_0_HOURS
77 SECT2.N7.V18 DInt 1752 T_STOP_HOURS
78 SECT2.N7.V19 Int 1756 T_ALARM_MINUTES
79 SECT2.N7.V20 Int 1758 T_DRY_CYCLE_MINUTES
80 SECT2.N7.V21 Int 1760 T_POWERED_MINUTES
81 SECT2.N7.V22 Int 1762 T_PRODUCT_100_MINUTES
82 SECT2.N7.V23 Int 1764 T_PRODUCT_0_MINUTES
83 SECT2.N7.V24 Int 1766 T_STOP_MINUTES
84 SECT3 "UDT SIPA SV Section" 1456
85 SECT3.N1 DInt 1664 .DB_IOT.STATO_MACCHINA
86 SECT3.N2 DInt 1668 .DB_IOT.ALLARME_FERMO
87 SECT3.N3 DInt 1672 .DB_IOT.WARNING_ATTIVO (che compromette produzione)
88 SECT3.N4 Int 1676 .DB_IOT.STATO_OPERATIVO (Semaforo)
89 SECT3.N5 Int 1678 .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)
90 SECT3.N6 DInt 1680 .DB_IOT.ALARM_STOP_NO
91 SECT3.N7.V1 DInt 1684 PIECES_TOT
92 SECT3.N7.V2 DInt 1688 PIECES_OK
93 SECT3.N7.V3 DInt 1692 PIECES_KO_1
94 SECT3.N7.V4 DInt 1696 PIECES_KO_2
95 SECT3.N7.V5 DInt 1700 PIECES_KO_3
96 SECT3.N7.V6 DInt 1704 PIECES_KO_4
97 SECT3.N7.V7 DInt 1708 PIECES_KO_5
98 SECT3.N7.V8 DInt 1712 PIECES_KO_6
99 SECT3.N7.V9 DInt 1716 PIECES_KO_7
100 SECT3.N7.V10 DInt 1720 PIECES_KO_8
101 SECT3.N7.V11 DInt 1724 PIECES_KO_9
102 SECT3.N7.V12 DInt 1728 PIECES_KO_10
103 SECT3.N7.V13 DInt 1732 T_ALARM_HOURS
104 SECT3.N7.V14 DInt 1736 T_DRY_CYCLE_HOURS
105 SECT3.N7.V15 DInt 1740 T_POWERED_HOURS
106 SECT3.N7.V16 DInt 1744 T_PRODUCT_100_HOURS
107 SECT3.N7.V17 DInt 1748 T_PRODUCT_0_HOURS
108 SECT3.N7.V18 DInt 1752 T_STOP_HOURS
109 SECT3.N7.V19 Int 1756 T_ALARM_MINUTES
110 SECT3.N7.V20 Int 1758 T_DRY_CYCLE_MINUTES
111 SECT3.N7.V21 Int 1760 T_POWERED_MINUTES
112 SECT3.N7.V22 Int 1762 T_PRODUCT_100_MINUTES
113 SECT3.N7.V23 Int 1764 T_PRODUCT_0_MINUTES
114 SECT3.N7.V24 Int 1766 T_STOP_MINUTES
115 SECT4 "UDT SIPA SV Section" 1560
116 SECT4.N1 DInt 1664 .DB_IOT.STATO_MACCHINA
117 SECT4.N2 DInt 1668 .DB_IOT.ALLARME_FERMO
118 SECT4.N3 DInt 1672 .DB_IOT.WARNING_ATTIVO (che compromette produzione)
119 SECT4.N4 Int 1676 .DB_IOT.STATO_OPERATIVO (Semaforo)
120 SECT4.N5 Int 1678 .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)
121 SECT4.N6 DInt 1680 .DB_IOT.ALARM_STOP_NO
122 SECT4.N7.V1 DInt 1684 PIECES_TOT
123 SECT4.N7.V2 DInt 1688 PIECES_OK
124 SECT4.N7.V3 DInt 1692 PIECES_KO_1
125 SECT4.N7.V4 DInt 1696 PIECES_KO_2
126 SECT4.N7.V5 DInt 1700 PIECES_KO_3
127 SECT4.N7.V6 DInt 1704 PIECES_KO_4
128 SECT4.N7.V7 DInt 1708 PIECES_KO_5
129 SECT4.N7.V8 DInt 1712 PIECES_KO_6
130 SECT4.N7.V9 DInt 1716 PIECES_KO_7
131 SECT4.N7.V10 DInt 1720 PIECES_KO_8
132 SECT4.N7.V11 DInt 1724 PIECES_KO_9
133 SECT4.N7.V12 DInt 1728 PIECES_KO_10
134 SECT4.N7.V13 DInt 1732 T_ALARM_HOURS
135 SECT4.N7.V14 DInt 1736 T_DRY_CYCLE_HOURS
136 SECT4.N7.V15 DInt 1740 T_POWERED_HOURS
137 SECT4.N7.V16 DInt 1744 T_PRODUCT_100_HOURS
138 SECT4.N7.V17 DInt 1748 T_PRODUCT_0_HOURS
139 SECT4.N7.V18 DInt 1752 T_STOP_HOURS
140 SECT4.N7.V19 Int 1756 T_ALARM_MINUTES
141 SECT4.N7.V20 Int 1758 T_DRY_CYCLE_MINUTES
142 SECT4.N7.V21 Int 1760 T_POWERED_MINUTES
143 SECT4.N7.V22 Int 1762 T_PRODUCT_100_MINUTES
144 SECT4.N7.V23 Int 1764 T_PRODUCT_0_MINUTES
145 SECT4.N7.V24 Int 1766 T_STOP_MINUTES
146 SECT5 "UDT SIPA SV Section" 1664
147 SECT5.N1 DInt 1664 .DB_IOT.STATO_MACCHINA
148 SECT5.N2 DInt 1668 .DB_IOT.ALLARME_FERMO
149 SECT5.N3 DInt 1672 .DB_IOT.WARNING_ATTIVO (che compromette produzione)
150 SECT5.N4 Int 1676 .DB_IOT.STATO_OPERATIVO (Semaforo)
151 SECT5.N5 Int 1678 .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)
152 SECT5.N6 DInt 1680 .DB_IOT.ALARM_STOP_NO
153 SECT5.N7.V1 DInt 1684 PIECES_TOT
154 SECT5.N7.V2 DInt 1688 PIECES_OK
155 SECT5.N7.V3 DInt 1692 PIECES_KO_1
156 SECT5.N7.V4 DInt 1696 PIECES_KO_2
157 SECT5.N7.V5 DInt 1700 PIECES_KO_3
158 SECT5.N7.V6 DInt 1704 PIECES_KO_4
159 SECT5.N7.V7 DInt 1708 PIECES_KO_5
160 SECT5.N7.V8 DInt 1712 PIECES_KO_6
161 SECT5.N7.V9 DInt 1716 PIECES_KO_7
162 SECT5.N7.V10 DInt 1720 PIECES_KO_8
163 SECT5.N7.V11 DInt 1724 PIECES_KO_9
164 SECT5.N7.V12 DInt 1728 PIECES_KO_10
165 SECT5.N7.V13 DInt 1732 T_ALARM_HOURS
166 SECT5.N7.V14 DInt 1736 T_DRY_CYCLE_HOURS
167 SECT5.N7.V15 DInt 1740 T_POWERED_HOURS
168 SECT5.N7.V16 DInt 1744 T_PRODUCT_100_HOURS
169 SECT5.N7.V17 DInt 1748 T_PRODUCT_0_HOURS
170 SECT5.N7.V18 DInt 1752 T_STOP_HOURS
171 SECT5.N7.V19 Int 1756 T_ALARM_MINUTES
172 SECT5.N7.V20 Int 1758 T_DRY_CYCLE_MINUTES
173 SECT5.N7.V21 Int 1760 T_POWERED_MINUTES
174 SECT5.N7.V22 Int 1762 T_PRODUCT_100_MINUTES
175 SECT5.N7.V23 Int 1764 T_PRODUCT_0_MINUTES
176 SECT5.N7.V24 Int 1766 T_STOP_MINUTES

BIN
DB_Structure.xlsx Normal file

Binary file not shown.

924
DB_Structure.xml Normal file
View File

@ -0,0 +1,924 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<DB SIPA Supervision>
<Struct>
<MAIN>
<type>"UDT SIPA SV Main"</type>
<comment></comment>
<fields>
<Struct>
<N1>
<type>DInt</type>
<comment>.DB_IOT.USERLEVEL</comment>
<offset>0</offset>
</N1>
<N2>
<type>String[81]</type>
<comment>.DB_IOT.USERNAME</comment>
<offset>4</offset>
</N2>
<N3>
<type>String[81]</type>
<comment>.DB_IOT.NOME_RICETTA</comment>
<offset>88</offset>
</N3>
<N4>
<type>Int</type>
<comment>.DB_IOT.NEXT_MAINT_CYCLES</comment>
<offset>172</offset>
</N4>
<N5>
<V1>
<type>String[254]</type>
<comment></comment>
<offset>174</offset>
</V1>
<V2>
<type>String[254]</type>
<comment></comment>
<offset>430</offset>
</V2>
<V3>
<type>String[254]</type>
<comment></comment>
<offset>686</offset>
</V3>
<V4>
<type>String[254]</type>
<comment></comment>
<offset>942</offset>
</V4>
<V5>
<type>String[8]</type>
<comment></comment>
<offset>1198</offset>
</V5>
</N5>
<N6>
<comment>.DB_IOT.ELECTRIC_VOLTAGE_PHASE_D</comment>
<type_1>
<type>Real</type>
<is_array_element>true</is_array_element>
<offset>1208</offset>
</type_1>
<type_2>
<type>Real</type>
<is_array_element>true</is_array_element>
<offset>1212</offset>
</type_2>
<type_3>
<type>Real</type>
<is_array_element>true</is_array_element>
<offset>1216</offset>
</type_3>
</N6>
<N7>
<comment>.DB_IOT.ELECTRIC_CURRENT_PHASE_D</comment>
<type_1>
<type>Real</type>
<is_array_element>true</is_array_element>
<offset>1220</offset>
</type_1>
<type_2>
<type>Real</type>
<is_array_element>true</is_array_element>
<offset>1224</offset>
</type_2>
<type_3>
<type>Real</type>
<is_array_element>true</is_array_element>
<offset>1228</offset>
</type_3>
</N7>
<N8>
<type>Real</type>
<comment>.DB_IOT.ELECTRIC_POWER_D</comment>
<offset>1232</offset>
</N8>
<N9>
<type>Real</type>
<comment>.DB_IOT.ELECTRIC_POWER_FACTOR_D</comment>
<offset>1236</offset>
</N9>
<N10>
<type>Real</type>
<comment>.DB_IOT.ELECTRIC_POWER_HOUR_D</comment>
<offset>1240</offset>
</N10>
<N11>
<type>Real</type>
<comment>.DB_IOT.ELECTRIC_POWER_WH</comment>
<offset>1244</offset>
</N11>
</Struct>
</fields>
<offset>0</offset>
</MAIN>
<SECT1>
<type>"UDT SIPA SV Section"</type>
<comment></comment>
<fields>
<Struct>
<N1>
<type>DInt</type>
<comment>.DB_IOT.STATO_MACCHINA</comment>
<offset>1664</offset>
</N1>
<N2>
<type>DInt</type>
<comment>.DB_IOT.ALLARME_FERMO</comment>
<offset>1668</offset>
</N2>
<N3>
<type>DInt</type>
<comment>.DB_IOT.WARNING_ATTIVO (che compromette produzione)</comment>
<offset>1672</offset>
</N3>
<N4>
<type>Int</type>
<comment>.DB_IOT.STATO_OPERATIVO (Semaforo)</comment>
<offset>1676</offset>
</N4>
<N5>
<type>Int</type>
<comment>.DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)</comment>
<offset>1678</offset>
</N5>
<N6>
<type>DInt</type>
<comment>.DB_IOT.ALARM_STOP_NO</comment>
<offset>1680</offset>
</N6>
<N7>
<V1>
<type>DInt</type>
<comment>PIECES_TOT</comment>
<offset>1684</offset>
</V1>
<V2>
<type>DInt</type>
<comment>PIECES_OK</comment>
<offset>1688</offset>
</V2>
<V3>
<type>DInt</type>
<comment>PIECES_KO_1</comment>
<offset>1692</offset>
</V3>
<V4>
<type>DInt</type>
<comment>PIECES_KO_2</comment>
<offset>1696</offset>
</V4>
<V5>
<type>DInt</type>
<comment>PIECES_KO_3</comment>
<offset>1700</offset>
</V5>
<V6>
<type>DInt</type>
<comment>PIECES_KO_4</comment>
<offset>1704</offset>
</V6>
<V7>
<type>DInt</type>
<comment>PIECES_KO_5</comment>
<offset>1708</offset>
</V7>
<V8>
<type>DInt</type>
<comment>PIECES_KO_6</comment>
<offset>1712</offset>
</V8>
<V9>
<type>DInt</type>
<comment>PIECES_KO_7</comment>
<offset>1716</offset>
</V9>
<V10>
<type>DInt</type>
<comment>PIECES_KO_8</comment>
<offset>1720</offset>
</V10>
<V11>
<type>DInt</type>
<comment>PIECES_KO_9</comment>
<offset>1724</offset>
</V11>
<V12>
<type>DInt</type>
<comment>PIECES_KO_10</comment>
<offset>1728</offset>
</V12>
<V13>
<type>DInt</type>
<comment>T_ALARM_HOURS</comment>
<offset>1732</offset>
</V13>
<V14>
<type>DInt</type>
<comment>T_DRY_CYCLE_HOURS</comment>
<offset>1736</offset>
</V14>
<V15>
<type>DInt</type>
<comment>T_POWERED_HOURS</comment>
<offset>1740</offset>
</V15>
<V16>
<type>DInt</type>
<comment>T_PRODUCT_100_HOURS</comment>
<offset>1744</offset>
</V16>
<V17>
<type>DInt</type>
<comment>T_PRODUCT_0_HOURS</comment>
<offset>1748</offset>
</V17>
<V18>
<type>DInt</type>
<comment>T_STOP_HOURS</comment>
<offset>1752</offset>
</V18>
<V19>
<type>Int</type>
<comment>T_ALARM_MINUTES</comment>
<offset>1756</offset>
</V19>
<V20>
<type>Int</type>
<comment>T_DRY_CYCLE_MINUTES</comment>
<offset>1758</offset>
</V20>
<V21>
<type>Int</type>
<comment>T_POWERED_MINUTES</comment>
<offset>1760</offset>
</V21>
<V22>
<type>Int</type>
<comment>T_PRODUCT_100_MINUTES</comment>
<offset>1762</offset>
</V22>
<V23>
<type>Int</type>
<comment>T_PRODUCT_0_MINUTES</comment>
<offset>1764</offset>
</V23>
<V24>
<type>Int</type>
<comment>T_STOP_MINUTES</comment>
<offset>1766</offset>
</V24>
</N7>
</Struct>
</fields>
<offset>1248</offset>
</SECT1>
<SECT2>
<type>"UDT SIPA SV Section"</type>
<comment></comment>
<fields>
<Struct>
<N1>
<type>DInt</type>
<comment>.DB_IOT.STATO_MACCHINA</comment>
<offset>1664</offset>
</N1>
<N2>
<type>DInt</type>
<comment>.DB_IOT.ALLARME_FERMO</comment>
<offset>1668</offset>
</N2>
<N3>
<type>DInt</type>
<comment>.DB_IOT.WARNING_ATTIVO (che compromette produzione)</comment>
<offset>1672</offset>
</N3>
<N4>
<type>Int</type>
<comment>.DB_IOT.STATO_OPERATIVO (Semaforo)</comment>
<offset>1676</offset>
</N4>
<N5>
<type>Int</type>
<comment>.DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)</comment>
<offset>1678</offset>
</N5>
<N6>
<type>DInt</type>
<comment>.DB_IOT.ALARM_STOP_NO</comment>
<offset>1680</offset>
</N6>
<N7>
<V1>
<type>DInt</type>
<comment>PIECES_TOT</comment>
<offset>1684</offset>
</V1>
<V2>
<type>DInt</type>
<comment>PIECES_OK</comment>
<offset>1688</offset>
</V2>
<V3>
<type>DInt</type>
<comment>PIECES_KO_1</comment>
<offset>1692</offset>
</V3>
<V4>
<type>DInt</type>
<comment>PIECES_KO_2</comment>
<offset>1696</offset>
</V4>
<V5>
<type>DInt</type>
<comment>PIECES_KO_3</comment>
<offset>1700</offset>
</V5>
<V6>
<type>DInt</type>
<comment>PIECES_KO_4</comment>
<offset>1704</offset>
</V6>
<V7>
<type>DInt</type>
<comment>PIECES_KO_5</comment>
<offset>1708</offset>
</V7>
<V8>
<type>DInt</type>
<comment>PIECES_KO_6</comment>
<offset>1712</offset>
</V8>
<V9>
<type>DInt</type>
<comment>PIECES_KO_7</comment>
<offset>1716</offset>
</V9>
<V10>
<type>DInt</type>
<comment>PIECES_KO_8</comment>
<offset>1720</offset>
</V10>
<V11>
<type>DInt</type>
<comment>PIECES_KO_9</comment>
<offset>1724</offset>
</V11>
<V12>
<type>DInt</type>
<comment>PIECES_KO_10</comment>
<offset>1728</offset>
</V12>
<V13>
<type>DInt</type>
<comment>T_ALARM_HOURS</comment>
<offset>1732</offset>
</V13>
<V14>
<type>DInt</type>
<comment>T_DRY_CYCLE_HOURS</comment>
<offset>1736</offset>
</V14>
<V15>
<type>DInt</type>
<comment>T_POWERED_HOURS</comment>
<offset>1740</offset>
</V15>
<V16>
<type>DInt</type>
<comment>T_PRODUCT_100_HOURS</comment>
<offset>1744</offset>
</V16>
<V17>
<type>DInt</type>
<comment>T_PRODUCT_0_HOURS</comment>
<offset>1748</offset>
</V17>
<V18>
<type>DInt</type>
<comment>T_STOP_HOURS</comment>
<offset>1752</offset>
</V18>
<V19>
<type>Int</type>
<comment>T_ALARM_MINUTES</comment>
<offset>1756</offset>
</V19>
<V20>
<type>Int</type>
<comment>T_DRY_CYCLE_MINUTES</comment>
<offset>1758</offset>
</V20>
<V21>
<type>Int</type>
<comment>T_POWERED_MINUTES</comment>
<offset>1760</offset>
</V21>
<V22>
<type>Int</type>
<comment>T_PRODUCT_100_MINUTES</comment>
<offset>1762</offset>
</V22>
<V23>
<type>Int</type>
<comment>T_PRODUCT_0_MINUTES</comment>
<offset>1764</offset>
</V23>
<V24>
<type>Int</type>
<comment>T_STOP_MINUTES</comment>
<offset>1766</offset>
</V24>
</N7>
</Struct>
</fields>
<offset>1352</offset>
</SECT2>
<SECT3>
<type>"UDT SIPA SV Section"</type>
<comment></comment>
<fields>
<Struct>
<N1>
<type>DInt</type>
<comment>.DB_IOT.STATO_MACCHINA</comment>
<offset>1664</offset>
</N1>
<N2>
<type>DInt</type>
<comment>.DB_IOT.ALLARME_FERMO</comment>
<offset>1668</offset>
</N2>
<N3>
<type>DInt</type>
<comment>.DB_IOT.WARNING_ATTIVO (che compromette produzione)</comment>
<offset>1672</offset>
</N3>
<N4>
<type>Int</type>
<comment>.DB_IOT.STATO_OPERATIVO (Semaforo)</comment>
<offset>1676</offset>
</N4>
<N5>
<type>Int</type>
<comment>.DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)</comment>
<offset>1678</offset>
</N5>
<N6>
<type>DInt</type>
<comment>.DB_IOT.ALARM_STOP_NO</comment>
<offset>1680</offset>
</N6>
<N7>
<V1>
<type>DInt</type>
<comment>PIECES_TOT</comment>
<offset>1684</offset>
</V1>
<V2>
<type>DInt</type>
<comment>PIECES_OK</comment>
<offset>1688</offset>
</V2>
<V3>
<type>DInt</type>
<comment>PIECES_KO_1</comment>
<offset>1692</offset>
</V3>
<V4>
<type>DInt</type>
<comment>PIECES_KO_2</comment>
<offset>1696</offset>
</V4>
<V5>
<type>DInt</type>
<comment>PIECES_KO_3</comment>
<offset>1700</offset>
</V5>
<V6>
<type>DInt</type>
<comment>PIECES_KO_4</comment>
<offset>1704</offset>
</V6>
<V7>
<type>DInt</type>
<comment>PIECES_KO_5</comment>
<offset>1708</offset>
</V7>
<V8>
<type>DInt</type>
<comment>PIECES_KO_6</comment>
<offset>1712</offset>
</V8>
<V9>
<type>DInt</type>
<comment>PIECES_KO_7</comment>
<offset>1716</offset>
</V9>
<V10>
<type>DInt</type>
<comment>PIECES_KO_8</comment>
<offset>1720</offset>
</V10>
<V11>
<type>DInt</type>
<comment>PIECES_KO_9</comment>
<offset>1724</offset>
</V11>
<V12>
<type>DInt</type>
<comment>PIECES_KO_10</comment>
<offset>1728</offset>
</V12>
<V13>
<type>DInt</type>
<comment>T_ALARM_HOURS</comment>
<offset>1732</offset>
</V13>
<V14>
<type>DInt</type>
<comment>T_DRY_CYCLE_HOURS</comment>
<offset>1736</offset>
</V14>
<V15>
<type>DInt</type>
<comment>T_POWERED_HOURS</comment>
<offset>1740</offset>
</V15>
<V16>
<type>DInt</type>
<comment>T_PRODUCT_100_HOURS</comment>
<offset>1744</offset>
</V16>
<V17>
<type>DInt</type>
<comment>T_PRODUCT_0_HOURS</comment>
<offset>1748</offset>
</V17>
<V18>
<type>DInt</type>
<comment>T_STOP_HOURS</comment>
<offset>1752</offset>
</V18>
<V19>
<type>Int</type>
<comment>T_ALARM_MINUTES</comment>
<offset>1756</offset>
</V19>
<V20>
<type>Int</type>
<comment>T_DRY_CYCLE_MINUTES</comment>
<offset>1758</offset>
</V20>
<V21>
<type>Int</type>
<comment>T_POWERED_MINUTES</comment>
<offset>1760</offset>
</V21>
<V22>
<type>Int</type>
<comment>T_PRODUCT_100_MINUTES</comment>
<offset>1762</offset>
</V22>
<V23>
<type>Int</type>
<comment>T_PRODUCT_0_MINUTES</comment>
<offset>1764</offset>
</V23>
<V24>
<type>Int</type>
<comment>T_STOP_MINUTES</comment>
<offset>1766</offset>
</V24>
</N7>
</Struct>
</fields>
<offset>1456</offset>
</SECT3>
<SECT4>
<type>"UDT SIPA SV Section"</type>
<comment></comment>
<fields>
<Struct>
<N1>
<type>DInt</type>
<comment>.DB_IOT.STATO_MACCHINA</comment>
<offset>1664</offset>
</N1>
<N2>
<type>DInt</type>
<comment>.DB_IOT.ALLARME_FERMO</comment>
<offset>1668</offset>
</N2>
<N3>
<type>DInt</type>
<comment>.DB_IOT.WARNING_ATTIVO (che compromette produzione)</comment>
<offset>1672</offset>
</N3>
<N4>
<type>Int</type>
<comment>.DB_IOT.STATO_OPERATIVO (Semaforo)</comment>
<offset>1676</offset>
</N4>
<N5>
<type>Int</type>
<comment>.DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)</comment>
<offset>1678</offset>
</N5>
<N6>
<type>DInt</type>
<comment>.DB_IOT.ALARM_STOP_NO</comment>
<offset>1680</offset>
</N6>
<N7>
<V1>
<type>DInt</type>
<comment>PIECES_TOT</comment>
<offset>1684</offset>
</V1>
<V2>
<type>DInt</type>
<comment>PIECES_OK</comment>
<offset>1688</offset>
</V2>
<V3>
<type>DInt</type>
<comment>PIECES_KO_1</comment>
<offset>1692</offset>
</V3>
<V4>
<type>DInt</type>
<comment>PIECES_KO_2</comment>
<offset>1696</offset>
</V4>
<V5>
<type>DInt</type>
<comment>PIECES_KO_3</comment>
<offset>1700</offset>
</V5>
<V6>
<type>DInt</type>
<comment>PIECES_KO_4</comment>
<offset>1704</offset>
</V6>
<V7>
<type>DInt</type>
<comment>PIECES_KO_5</comment>
<offset>1708</offset>
</V7>
<V8>
<type>DInt</type>
<comment>PIECES_KO_6</comment>
<offset>1712</offset>
</V8>
<V9>
<type>DInt</type>
<comment>PIECES_KO_7</comment>
<offset>1716</offset>
</V9>
<V10>
<type>DInt</type>
<comment>PIECES_KO_8</comment>
<offset>1720</offset>
</V10>
<V11>
<type>DInt</type>
<comment>PIECES_KO_9</comment>
<offset>1724</offset>
</V11>
<V12>
<type>DInt</type>
<comment>PIECES_KO_10</comment>
<offset>1728</offset>
</V12>
<V13>
<type>DInt</type>
<comment>T_ALARM_HOURS</comment>
<offset>1732</offset>
</V13>
<V14>
<type>DInt</type>
<comment>T_DRY_CYCLE_HOURS</comment>
<offset>1736</offset>
</V14>
<V15>
<type>DInt</type>
<comment>T_POWERED_HOURS</comment>
<offset>1740</offset>
</V15>
<V16>
<type>DInt</type>
<comment>T_PRODUCT_100_HOURS</comment>
<offset>1744</offset>
</V16>
<V17>
<type>DInt</type>
<comment>T_PRODUCT_0_HOURS</comment>
<offset>1748</offset>
</V17>
<V18>
<type>DInt</type>
<comment>T_STOP_HOURS</comment>
<offset>1752</offset>
</V18>
<V19>
<type>Int</type>
<comment>T_ALARM_MINUTES</comment>
<offset>1756</offset>
</V19>
<V20>
<type>Int</type>
<comment>T_DRY_CYCLE_MINUTES</comment>
<offset>1758</offset>
</V20>
<V21>
<type>Int</type>
<comment>T_POWERED_MINUTES</comment>
<offset>1760</offset>
</V21>
<V22>
<type>Int</type>
<comment>T_PRODUCT_100_MINUTES</comment>
<offset>1762</offset>
</V22>
<V23>
<type>Int</type>
<comment>T_PRODUCT_0_MINUTES</comment>
<offset>1764</offset>
</V23>
<V24>
<type>Int</type>
<comment>T_STOP_MINUTES</comment>
<offset>1766</offset>
</V24>
</N7>
</Struct>
</fields>
<offset>1560</offset>
</SECT4>
<SECT5>
<type>"UDT SIPA SV Section"</type>
<comment></comment>
<fields>
<Struct>
<N1>
<type>DInt</type>
<comment>.DB_IOT.STATO_MACCHINA</comment>
<offset>1664</offset>
</N1>
<N2>
<type>DInt</type>
<comment>.DB_IOT.ALLARME_FERMO</comment>
<offset>1668</offset>
</N2>
<N3>
<type>DInt</type>
<comment>.DB_IOT.WARNING_ATTIVO (che compromette produzione)</comment>
<offset>1672</offset>
</N3>
<N4>
<type>Int</type>
<comment>.DB_IOT.STATO_OPERATIVO (Semaforo)</comment>
<offset>1676</offset>
</N4>
<N5>
<type>Int</type>
<comment>.DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)</comment>
<offset>1678</offset>
</N5>
<N6>
<type>DInt</type>
<comment>.DB_IOT.ALARM_STOP_NO</comment>
<offset>1680</offset>
</N6>
<N7>
<V1>
<type>DInt</type>
<comment>PIECES_TOT</comment>
<offset>1684</offset>
</V1>
<V2>
<type>DInt</type>
<comment>PIECES_OK</comment>
<offset>1688</offset>
</V2>
<V3>
<type>DInt</type>
<comment>PIECES_KO_1</comment>
<offset>1692</offset>
</V3>
<V4>
<type>DInt</type>
<comment>PIECES_KO_2</comment>
<offset>1696</offset>
</V4>
<V5>
<type>DInt</type>
<comment>PIECES_KO_3</comment>
<offset>1700</offset>
</V5>
<V6>
<type>DInt</type>
<comment>PIECES_KO_4</comment>
<offset>1704</offset>
</V6>
<V7>
<type>DInt</type>
<comment>PIECES_KO_5</comment>
<offset>1708</offset>
</V7>
<V8>
<type>DInt</type>
<comment>PIECES_KO_6</comment>
<offset>1712</offset>
</V8>
<V9>
<type>DInt</type>
<comment>PIECES_KO_7</comment>
<offset>1716</offset>
</V9>
<V10>
<type>DInt</type>
<comment>PIECES_KO_8</comment>
<offset>1720</offset>
</V10>
<V11>
<type>DInt</type>
<comment>PIECES_KO_9</comment>
<offset>1724</offset>
</V11>
<V12>
<type>DInt</type>
<comment>PIECES_KO_10</comment>
<offset>1728</offset>
</V12>
<V13>
<type>DInt</type>
<comment>T_ALARM_HOURS</comment>
<offset>1732</offset>
</V13>
<V14>
<type>DInt</type>
<comment>T_DRY_CYCLE_HOURS</comment>
<offset>1736</offset>
</V14>
<V15>
<type>DInt</type>
<comment>T_POWERED_HOURS</comment>
<offset>1740</offset>
</V15>
<V16>
<type>DInt</type>
<comment>T_PRODUCT_100_HOURS</comment>
<offset>1744</offset>
</V16>
<V17>
<type>DInt</type>
<comment>T_PRODUCT_0_HOURS</comment>
<offset>1748</offset>
</V17>
<V18>
<type>DInt</type>
<comment>T_STOP_HOURS</comment>
<offset>1752</offset>
</V18>
<V19>
<type>Int</type>
<comment>T_ALARM_MINUTES</comment>
<offset>1756</offset>
</V19>
<V20>
<type>Int</type>
<comment>T_DRY_CYCLE_MINUTES</comment>
<offset>1758</offset>
</V20>
<V21>
<type>Int</type>
<comment>T_POWERED_MINUTES</comment>
<offset>1760</offset>
</V21>
<V22>
<type>Int</type>
<comment>T_PRODUCT_100_MINUTES</comment>
<offset>1762</offset>
</V22>
<V23>
<type>Int</type>
<comment>T_PRODUCT_0_MINUTES</comment>
<offset>1764</offset>
</V23>
<V24>
<type>Int</type>
<comment>T_STOP_MINUTES</comment>
<offset>1766</offset>
</V24>
</N7>
</Struct>
</fields>
<offset>1664</offset>
</SECT5>
</Struct>
</DB SIPA Supervision>
</root>

172
DB_to_Excel.py Normal file
View File

@ -0,0 +1,172 @@
import re
import json
import pandas as pd
from ExportData import *
from ExpandDB import *
def clean_line(line):
"""Clean line from BOM and extra spaces or quotes."""
# Remove UTF-8 BOM if exists and strip trailing/leading whitespace
line = line.replace("\ufeff", "").strip()
# Standardize TYPE and DATA_BLOCK definitions to ensure they're properly captured
line = re.sub(r'\s*TYPE\s+"?', 'TYPE "', line)
line = re.sub(r'\s*DATA_BLOCK\s+"?', 'DATA_BLOCK "', line)
return line
def extract_name(line):
"""Extract the name from TYPE or DATA_BLOCK definition line."""
# Attempt to find a quoted name first
match = re.search(r'(TYPE|DATA_BLOCK)\s+"([^"]+)"', line)
if match:
return match.group(2).strip() # The name is within quotes
# If no quoted name, find an unquoted name
match = re.search(r"(TYPE|DATA_BLOCK)\s+(\S+)", line)
if match:
return match.group(2).strip() # The name is without quotes
def parse_udts(lines):
udt_json = {}
udt_name = None
nested_structs = []
current_struct = None
is_within_struct = False
for line in lines:
line = clean_line(line)
if "TYPE" in line and "END_TYPE" not in line:
udt_name = extract_name(line)
udt_json[udt_name] = {}
current_struct = udt_json[udt_name]
print(f"Created UDT: {udt_name}")
elif "END_TYPE" in line:
print(f"Completed UDT: {udt_name}")
udt_name = None
nested_structs = []
current_struct = None
is_within_struct = False
elif "STRUCT" in line and "END_STRUCT" not in line and udt_name is not None:
struct_name = (
"Struct" if "STRUCT" == line.strip() else line.split(":")[0].strip()
)
new_struct = {}
current_struct[struct_name] = new_struct
nested_structs.append(current_struct)
current_struct = new_struct
is_within_struct = True
print(f"Created STRUCT: {struct_name}")
elif "END_STRUCT" in line and udt_name is not None:
current_struct = nested_structs.pop() if nested_structs else None
is_within_struct = bool(nested_structs)
print(f"Closed STRUCT in UDT '{udt_name}'")
elif udt_name and ":" in line and is_within_struct:
parts = line.split(":")
field_name = parts[0].strip()
field_details = parts[1].strip().split("//")
field_type = (
field_details[0].replace(";", "").strip()
) # Removing ';' from field type
field_comment = parts[1].split("//")[1].strip() if "//" in parts[1] else ""
if "Struct" in field_type:
new_struct = {}
current_struct[field_name] = new_struct
nested_structs.append(current_struct)
current_struct = new_struct
print(f"Opened inline STRUCT at field '{field_name}'")
else:
current_struct[field_name] = {
"type": field_type,
"comment": field_comment,
}
print(
f"Added field '{field_name}' to STRUCT: Type={field_type}, Comment={field_comment}"
)
return udt_json
def parse_dbs(lines, udts):
db_json = {}
db_name = None
nested_structs = []
current_struct = None
is_within_struct = False
for line in lines:
line = clean_line(line)
if "DATA_BLOCK" in line and "END_DATA_BLOCK" not in line:
db_name = extract_name(line)
db_json[db_name] = {}
current_struct = db_json[db_name]
print(f"Created DATA_BLOCK: {db_name}")
elif "END_DATA_BLOCK" in line:
print(f"Completed DATA_BLOCK: {db_name}")
db_name = None
nested_structs = []
current_struct = None
is_within_struct = False
elif "STRUCT" in line and "END_STRUCT" not in line and db_name is not None:
struct_name = (
"Struct" if "STRUCT" == line.strip() else line.split(":")[0].strip()
)
new_struct = {}
current_struct[struct_name] = new_struct
nested_structs.append(current_struct)
current_struct = new_struct
is_within_struct = True
print(f"Created STRUCT in DB '{db_name}': {struct_name}")
elif "END_STRUCT" in line and db_name is not None:
current_struct = nested_structs.pop() if nested_structs else None
is_within_struct = bool(nested_structs)
print(f"Closed STRUCT in DB '{db_name}'")
elif db_name and ":" in line and is_within_struct:
parts = line.split(":")
field_name = parts[0].strip()
field_details = parts[1].strip().split("//")
field_type = (
field_details[0].replace(";", "").strip()
) # Removing ';' from field type
field_comment = parts[1].split("//")[1].strip() if "//" in parts[1] else ""
if "Struct" in field_type:
new_struct = {}
current_struct[field_name] = new_struct
nested_structs.append(current_struct)
current_struct = new_struct
print(f"Opened inline STRUCT at field '{field_name}' in DB '{db_name}'")
else:
current_struct[field_name] = {
"type": field_type,
"comment": field_comment,
}
print(
f"Added field '{field_name}' to STRUCT in DB '{db_name}': Type={field_type}, Comment={field_comment}"
)
return db_json
if __name__ == "__main__":
file_path = "DB SIPA Supervision.db"
with open(file_path, "r", encoding="utf-8-sig") as file:
lines = file.readlines()
udt_json = parse_udts(lines)
db_json = parse_dbs(lines, udt_json)
expand_dbs(udt_json, db_json) # Expand DBs with UDT definitions
for db_name, db_content in db_json.items():
calculate_offsets(
db_content
) # Calculate offsets including special handling for Bool and String
# Display the expanded DBs as a table
df = display_as_table(db_json)
save_dataframe_to_file(df) # Save the DataFrame to a CSV file
save_dataframe_to_excel(df) # Optionally, save the DataFrame to an Excel file
# Save JSON data to an XML file
save_json_to_xml(db_json)

125
ExpandDB.py Normal file
View File

@ -0,0 +1,125 @@
import re
import json
import pandas as pd
def expand_udt_references(db_struct, udts):
"""
Recursively expand UDT references in the given DB structure using the UDT definitions.
This function specifically expands fields designated as 'type' which reference UDTs.
"""
if isinstance(db_struct, dict):
for key, value in list(db_struct.items()):
if isinstance(value, dict):
# Recurse into dictionaries
expand_udt_references(value, udts)
elif isinstance(value, str) and key == "type": # Only expand 'type' fields
type_name = value.strip(
'"'
) # Remove quotes which may wrap UDT names with spaces
if type_name in udts:
# Replace the UDT reference with its definition, if it exists
db_struct["fields"] = udts[
type_name
].copy() # Assume structure to insert is under 'fields'
print(f"Expanded UDT '{type_name}' at field '{key}' ")
elif isinstance(db_struct, list):
for item in db_struct:
expand_udt_references(item, udts)
def handle_array_types(db_struct):
"""
Handle array types once all UDTs are expanded.
This function modifies the structure in place.
"""
if isinstance(db_struct, dict):
for key, value in list(db_struct.items()):
if isinstance(value, dict):
handle_array_types(value)
elif isinstance(value, str):
# Parsing array definitions, e.g., "Array[1..3] of Real"
match = re.match(r"Array\[(\d+)\.\.(\d+)\] of (\w+)", value)
if match:
lower_bound, upper_bound, base_type = (
int(match.group(1)),
int(match.group(2)),
match.group(3),
)
# Expand this field into multiple fields
db_struct.pop(key) # Remove the original field
for i in range(lower_bound, upper_bound + 1):
db_struct[f"{key}_{i}"] = {"type": base_type, 'is_array_element': True}
print(
f"Expanded field '{key}' into array fields: {key}_{lower_bound} to {key}_{upper_bound} of type {base_type}"
)
type_sizes = {
"Int": 2,
"DInt": 4,
"Word": 2,
"Real": 4,
"Bool": 2, # We'll adjust this dynamically based on context (1 byte if alone, 1 bit if grouped)
"String": 1, # This will be multiplied by the specified size in brackets [n]
}
def calculate_offsets(db_struct, current_offset=0, parent=None):
"""
Recursively calculate byte offsets for each field in the DB structure considering special types.
"""
last_key_was_bool = False
if isinstance(db_struct, dict):
for key, value in list(db_struct.items()):
if isinstance(value, dict):
if "type" in value:
type_name = value["type"]
is_array_element = value.get('is_array_element', False)
size = type_sizes.get(
type_name, 0
) # Default to 1 byte if type is not recognized
if not is_array_element and current_offset % 2 != 0:
current_offset += 1 # Align to the next even offset if it's not an array element
# Special handling for String types
if "String" in type_name:
match = re.match(r"String\[(\d+)\]", type_name)
if match:
length = int(match.group(1))
size = length + 2 # Account for null-termination and string length prefix
else:
size = type_sizes.get(type_name, 1) # Default to generic size if not an array
# Adjusting Bool sizes based on grouping
if type_name == "Bool":
if last_key_was_bool: # This is a grouped bool
size = 0.125 # One bit per Bool if grouped
else:
size = 2 # Bools use a full byte if not grouped
last_key_was_bool = True
else:
last_key_was_bool = False
value["offset"] = current_offset
current_offset += size
current_offset = calculate_offsets(
value, current_offset, value
) # Recurse into nested structs
elif isinstance(db_struct, list):
for item in db_struct:
current_offset = calculate_offsets(item, current_offset, parent)
return current_offset
def expand_dbs(udts, dbs):
"""
Expand all UDT references in all DBs and then handle array types.
"""
for db_name, db_content in dbs.items():
print(f"Expanding DB: {db_name}")
expand_udt_references(db_content, udts)
handle_array_types(db_content)
calculate_offsets(db_content)
print(f"Completed expansion for DB: {db_name}")

74
ExportData.py Normal file
View File

@ -0,0 +1,74 @@
import xmltodict
import pandas as pd
def save_json_to_xml(json_data, filename="DB_Structure.xml"):
"""
Convert JSON data to XML and save it to a file.
"""
xml_data = xmltodict.unparse({"root": json_data}, pretty=True)
with open(filename, "w") as xml_file:
xml_file.write(xml_data)
print(f"XML data saved to {filename}")
def save_dataframe_to_excel(df, filename="DB_Structure.xlsx"):
"""
Save the provided DataFrame to an Excel file.
"""
df.to_excel(filename, index=False)
print(f"Data saved to {filename}")
def save_dataframe_to_file(df, filename="DB_Structure.csv"):
"""
Save the provided DataFrame to a CSV file.
"""
df.to_csv(filename, index=False)
print(f"Data saved to {filename}")
def collect_data_for_table(db_struct, parent_prefix="", collected_data=[]):
"""
Recursively collect data from the DB structure to display in a tabular format,
omitting 'fields' and 'Struct' in the names.
"""
if isinstance(db_struct, dict):
for key, value in db_struct.items():
# Skip 'fields' and 'Struct' keys in the name path
if key == 'fields' or key == 'Struct':
next_prefix = parent_prefix # Continue with the current prefix
else:
next_prefix = f"{parent_prefix}.{key}" if parent_prefix else key
if isinstance(value, dict) and 'type' in value: # Directly a field with 'type'
field_data = {
"Nombre": next_prefix,
"Tipo": value.get('type', 'N/A'),
"Offset": value.get('offset', 'N/A'),
"Comentario": value.get('comment', 'N/A')
}
collected_data.append(field_data)
# Recursively handle nested dictionaries and lists
if isinstance(value, dict) or isinstance(value, list):
collect_data_for_table(value, next_prefix, collected_data)
elif isinstance(db_struct, list):
for index, item in enumerate(db_struct):
item_prefix = f"{parent_prefix}[{index}]" if parent_prefix else f"[{index}]"
collect_data_for_table(item, item_prefix, collected_data)
return collected_data
def display_as_table(dbs):
"""
Convert collected DB data into a pandas DataFrame and display it.
"""
all_data = []
for db_name, db_content in dbs.items():
print(f"Processing DB: {db_name}")
db_data = collect_data_for_table(db_content)
all_data.extend(db_data)
df = pd.DataFrame(all_data)
return df

Binary file not shown.

Binary file not shown.

30
db_definitions.json Normal file
View File

@ -0,0 +1,30 @@
{
"DB SIPA Supervision": {
"root": {
"MAIN": {
"type": "\"UDT SIPA SV Main\";",
"comment": ""
},
"SECT1": {
"type": "\"UDT SIPA SV Section\";",
"comment": ""
},
"SECT2": {
"type": "\"UDT SIPA SV Section\";",
"comment": ""
},
"SECT3": {
"type": "\"UDT SIPA SV Section\";",
"comment": ""
},
"SECT4": {
"type": "\"UDT SIPA SV Section\";",
"comment": ""
},
"SECT5": {
"type": "\"UDT SIPA SV Section\";",
"comment": ""
}
}
}
}

194
udt_definitions.json Normal file
View File

@ -0,0 +1,194 @@
{
"UDT SIPA SV Main": {
"root": {
"N1": {
"type": "DInt;",
"comment": ".DB_IOT.USERLEVEL"
},
"N2": {
"type": "String[81];",
"comment": ".DB_IOT.USERNAME"
},
"N3": {
"type": "String[81];",
"comment": ".DB_IOT.NOME_RICETTA"
},
"N4": {
"type": "Int;",
"comment": ".DB_IOT.NEXT_MAINT_CYCLES"
},
"N5": {
"V1": {
"type": "String[254];",
"comment": ""
},
"V2": {
"type": "String[254];",
"comment": ""
},
"V3": {
"type": "String[254];",
"comment": ""
},
"V4": {
"type": "String[254];",
"comment": ""
},
"V5": {
"type": "String[8];",
"comment": ""
}
},
"N6": {
"type": "Array[1..3] of Real;",
"comment": ".DB_IOT.ELECTRIC_VOLTAGE_PHASE_D"
},
"N7": {
"type": "Array[1..3] of Real;",
"comment": ".DB_IOT.ELECTRIC_CURRENT_PHASE_D"
},
"N8": {
"type": "Real;",
"comment": ".DB_IOT.ELECTRIC_POWER_D"
},
"N9": {
"type": "Real;",
"comment": ".DB_IOT.ELECTRIC_POWER_FACTOR_D"
},
"N10": {
"type": "Real;",
"comment": ".DB_IOT.ELECTRIC_POWER_HOUR_D"
},
"N11": {
"type": "Real;",
"comment": ".DB_IOT.ELECTRIC_POWER_WH"
}
}
},
"UDT SIPA SV Section": {
"root": {
"N1": {
"type": "DInt;",
"comment": ".DB_IOT.STATO_MACCHINA"
},
"N2": {
"type": "DInt;",
"comment": ".DB_IOT.ALLARME_FERMO"
},
"N3": {
"type": "DInt;",
"comment": ".DB_IOT.WARNING_ATTIVO (che compromette produzione)"
},
"N4": {
"type": "Int;",
"comment": ".DB_IOT.STATO_OPERATIVO (Semaforo)"
},
"N5": {
"type": "Int;",
"comment": ".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
},
"N6": {
"type": "DInt;",
"comment": ".DB_IOT.ALARM_STOP_NO"
},
"N7": {
"V1": {
"type": "DInt;",
"comment": "PIECES_TOT"
},
"V2": {
"type": "DInt;",
"comment": "PIECES_OK"
},
"V3": {
"type": "DInt;",
"comment": "PIECES_KO_1"
},
"V4": {
"type": "DInt;",
"comment": "PIECES_KO_2"
},
"V5": {
"type": "DInt;",
"comment": "PIECES_KO_3"
},
"V6": {
"type": "DInt;",
"comment": "PIECES_KO_4"
},
"V7": {
"type": "DInt;",
"comment": "PIECES_KO_5"
},
"V8": {
"type": "DInt;",
"comment": "PIECES_KO_6"
},
"V9": {
"type": "DInt;",
"comment": "PIECES_KO_7"
},
"V10": {
"type": "DInt;",
"comment": "PIECES_KO_8"
},
"V11": {
"type": "DInt;",
"comment": "PIECES_KO_9"
},
"V12": {
"type": "DInt;",
"comment": "PIECES_KO_10"
},
"V13": {
"type": "DInt;",
"comment": "T_ALARM_HOURS"
},
"V14": {
"type": "DInt;",
"comment": "T_DRY_CYCLE_HOURS"
},
"V15": {
"type": "DInt;",
"comment": "T_POWERED_HOURS"
},
"V16": {
"type": "DInt;",
"comment": "T_PRODUCT_100_HOURS"
},
"V17": {
"type": "DInt;",
"comment": "T_PRODUCT_0_HOURS"
},
"V18": {
"type": "DInt;",
"comment": "T_STOP_HOURS"
},
"V19": {
"type": "Int;",
"comment": "T_ALARM_MINUTES"
},
"V20": {
"type": "Int;",
"comment": "T_DRY_CYCLE_MINUTES"
},
"V21": {
"type": "Int;",
"comment": "T_POWERED_MINUTES"
},
"V22": {
"type": "Int;",
"comment": "T_PRODUCT_100_MINUTES"
},
"V23": {
"type": "Int;",
"comment": "T_PRODUCT_0_MINUTES"
},
"V24": {
"type": "Int;",
"comment": "T_STOP_MINUTES"
}
}
}
}
}