modified: .gitignore
modified: CopyPaste.py new file: CreateTable.py deleted: DB_SIPA_Supervision_Excel.xlsx modified: DB_Structure.csv new file: DB_Structure.jon modified: DB_Structure.xlsx modified: DB_Structure.xml modified: DB_to_Excel.py new file: Data_block_1.db modified: ExpandDB.py deleted: ExportData.py modified: __pycache__/ExpandDB.cpython-310.pyc modified: __pycache__/ExportData.cpython-310.pyc deleted: db_definitions.json new file: manejoArchivos.py deleted: udt_definitions.json
This commit is contained in:
parent
4ef4fa2657
commit
5c904b7a05
|
@ -158,3 +158,5 @@ cython_debug/
|
||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
|
CopyPaste.py
|
51
CopyPaste.py
51
CopyPaste.py
|
@ -1,19 +1,36 @@
|
||||||
def calculate_offsets(db_struct, current_offset=0, parent=None):
|
import os
|
||||||
"""
|
import subprocess
|
||||||
Recursively calculate byte offsets for each field in the DB structure considering special types.
|
import tkinter as tk
|
||||||
"""
|
from tkinter import filedialog
|
||||||
last_key_was_bool = False
|
|
||||||
last_bit_offset = 0 # To track bit offsets within a byte
|
|
||||||
if isinstance(db_struct, dict):
|
|
||||||
for key, value in list(db_struct.items()):
|
|
||||||
if isinstance(value, dict):
|
|
||||||
if "type" in value and not "offset" in value:
|
|
||||||
|
|
||||||
current_offset = calculate_offsets(
|
def select_file():
|
||||||
value, current_offset, value
|
"""
|
||||||
) # Recurse into nested structs
|
Opens a file dialog to select a .db file and returns the selected file path.
|
||||||
|
"""
|
||||||
|
root = tk.Tk()
|
||||||
|
root.withdraw() # Use to hide the tkinter root window
|
||||||
|
|
||||||
elif isinstance(db_struct, list):
|
# Open file dialog and return the selected file path
|
||||||
for item in db_struct:
|
file_path = filedialog.askopenfilename(
|
||||||
current_offset = calculate_offsets(item, current_offset, parent)
|
title="Select a .db file",
|
||||||
return current_offset
|
filetypes=(("DB files", "*.db"), ("All files", "*.*"))
|
||||||
|
)
|
||||||
|
return file_path
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
file_path = select_file()
|
||||||
|
if file_path: # Proceed only if a file was selected
|
||||||
|
with open(file_path, "r", encoding="utf-8-sig") as file:
|
||||||
|
lines = file.readlines()
|
||||||
|
|
||||||
|
udt_json = parse_udts(lines)
|
||||||
|
# Assume processing and file generation happens here, e.g., creating `output.txt`
|
||||||
|
output_file_path = os.path.join(os.path.dirname(file_path), "output.txt")
|
||||||
|
# Save or manipulate output files as needed
|
||||||
|
|
||||||
|
# Open the directory containing the new file in Explorer
|
||||||
|
open_file_explorer(os.path.dirname(output_file_path))
|
||||||
|
else:
|
||||||
|
print("No file was selected.")
|
||||||
|
|
|
@ -0,0 +1,244 @@
|
||||||
|
import xmltodict
|
||||||
|
import pandas as pd
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
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}")
|
||||||
|
|
||||||
|
|
||||||
|
type_sizes = {
|
||||||
|
"Byte": 1,
|
||||||
|
"Char": 1,
|
||||||
|
"Int": 2,
|
||||||
|
"DInt": 4,
|
||||||
|
"Word": 2,
|
||||||
|
"DWord": 4,
|
||||||
|
"Real": 4,
|
||||||
|
"Date": 2,
|
||||||
|
"Time": 4,
|
||||||
|
"Time_Of_Day": 4,
|
||||||
|
"S5Time": 2,
|
||||||
|
"Bool": 0.125, # Recuerda, esto significa 1 bit, pero es comúnmente agrupado en 8 bits = 1 Byte
|
||||||
|
"String": 256, # Especificar si es necesario como String[256] que serían 258 bytes (256 caracteres + 2 de longitud)
|
||||||
|
"WString": 512,
|
||||||
|
"LReal": 8, # Doble precisión de punto flotante
|
||||||
|
"UDInt": 4, # Entero sin signo de 32 bits
|
||||||
|
"USInt": 1, # Entero sin signo de 8 bits (Byte)
|
||||||
|
"UInt": 2, # Entero sin signo de 16 bits (Word)
|
||||||
|
"ULInt": 8, # Entero sin signo de 64 bits (Doble DWord)
|
||||||
|
"LWord": 8, # Entero sin signo de 64 bits (Doble DWord)
|
||||||
|
"LInt": 8, # Entero con signo de 64 bits
|
||||||
|
"Date_And_Time": 8, # Fecha y hora combinadas, 8 bytes
|
||||||
|
"DTL": 12, # Date and time long (fecha, hora y precisión a microsegundos, 12 bytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def calculate_plc_address(type_name, byte_offset):
|
||||||
|
"""
|
||||||
|
Calculate the PLC address notation based on byte size, byte offset and bit offset.
|
||||||
|
"""
|
||||||
|
byte_size = type_sizes.get(type_name, 0)
|
||||||
|
bit_offset = int((byte_offset - int(byte_offset)) * 8)
|
||||||
|
byte_offset = int(byte_offset)
|
||||||
|
if type_name == "Bool":
|
||||||
|
if bit_offset is not None:
|
||||||
|
return f"DBX{byte_offset}.{bit_offset}" # Address for single bits
|
||||||
|
return f"DBB{byte_offset}" # Address for single bytes
|
||||||
|
elif type_name == "Byte":
|
||||||
|
return f"DBB{byte_offset}" # Address for two-byte words
|
||||||
|
elif byte_size == 2:
|
||||||
|
return f"DBW{byte_offset}" # Address for two-byte words
|
||||||
|
elif byte_size == 4:
|
||||||
|
return f"DBD{byte_offset}" # Address for four-byte double words
|
||||||
|
else:
|
||||||
|
return f"DBX{byte_offset}.0" # Default to bit address for types longer than 4 bytes (e.g., strings)
|
||||||
|
|
||||||
|
|
||||||
|
def calculate_plc_size(size):
|
||||||
|
byte_size = size
|
||||||
|
bit_offset = int((size - int(size)) * 8)
|
||||||
|
size = int(size)
|
||||||
|
if bit_offset > 0:
|
||||||
|
return f"{size}.{bit_offset}"
|
||||||
|
else:
|
||||||
|
return f"{size}"
|
||||||
|
|
||||||
|
|
||||||
|
class OffsetState:
|
||||||
|
last_key_was_bool = False
|
||||||
|
last_bit_offset = 0 # To track bit offsets within a byte
|
||||||
|
current_offset = 0
|
||||||
|
|
||||||
|
|
||||||
|
def calculate_offsets(value, state):
|
||||||
|
|
||||||
|
type_name = value["type"]
|
||||||
|
is_array_element = value.get("is_array_element", False)
|
||||||
|
is_array_definition = value.get("array_definition", False)
|
||||||
|
is_udt_definition = value.get("is_udt_definition", False)
|
||||||
|
|
||||||
|
if state.last_key_was_bool:
|
||||||
|
is_array_element = True
|
||||||
|
size = 0
|
||||||
|
|
||||||
|
if not is_array_element:
|
||||||
|
if state.current_offset % 2 != 0:
|
||||||
|
state.current_offset += (
|
||||||
|
1 # Align to the next even offset if it's not an array element
|
||||||
|
)
|
||||||
|
|
||||||
|
# Adjusting Bool sizes based on grouping
|
||||||
|
if type_name == "Bool":
|
||||||
|
state.last_key_was_bool = True
|
||||||
|
size += 1 / 8
|
||||||
|
|
||||||
|
else:
|
||||||
|
if state.last_key_was_bool: # After bools
|
||||||
|
state.last_key_was_bool = False ## Not Bool
|
||||||
|
if (
|
||||||
|
state.last_bit_offset > 0
|
||||||
|
or int(state.current_offset) != state.current_offset
|
||||||
|
):
|
||||||
|
state.last_bit_offset = 0
|
||||||
|
state.current_offset = int(state.current_offset) + 1
|
||||||
|
if state.current_offset % 2 != 0:
|
||||||
|
state.current_offset += (
|
||||||
|
1 # Align to the next even offset if it's not an array element
|
||||||
|
)
|
||||||
|
|
||||||
|
# Special handling for String types
|
||||||
|
if type_name.startswith("String"):
|
||||||
|
match = re.match(r"String\[(\d+)\]", type_name)
|
||||||
|
state.last_bit_offset = 0
|
||||||
|
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, 0) ## Standar size for strings
|
||||||
|
|
||||||
|
else: ## Other Data Types
|
||||||
|
if is_array_definition:
|
||||||
|
size = 0
|
||||||
|
if state.current_offset % 2 != 0:
|
||||||
|
state.current_offset += (
|
||||||
|
1 # Align to the next even offset if it's not an array element
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
size = type_sizes.get(
|
||||||
|
type_name, -1
|
||||||
|
) # Default to 1 byte if type is not recognized
|
||||||
|
|
||||||
|
if size == -1 and not is_udt_definition:
|
||||||
|
print(f"UDT o DataType '{type_name}' no encontrado. Abortando.")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
plc_address = calculate_plc_address(type_name, state.current_offset)
|
||||||
|
value["offset"] = int(state.current_offset)
|
||||||
|
value["plc_address"] = plc_address # Store the calculated PLC address
|
||||||
|
value["size"] = calculate_plc_size(size)
|
||||||
|
# print(f"Offset '{state.current_offset}' at field '{key}' ")
|
||||||
|
state.current_offset += size
|
||||||
|
return state
|
||||||
|
|
||||||
|
|
||||||
|
def collect_data_for_table(
|
||||||
|
db_struct, offset_state, level=0, parent_prefix="", collected_data=[]
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
Recursively collect data from the DB structure to display in a tabular format,
|
||||||
|
omitting 'fields' and 'Struct' in the names.
|
||||||
|
"""
|
||||||
|
is_array_element = False
|
||||||
|
increase_level = 0
|
||||||
|
|
||||||
|
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" or key == "Array":
|
||||||
|
next_prefix = parent_prefix # Continue with the current prefix
|
||||||
|
else:
|
||||||
|
if isinstance(value, dict):
|
||||||
|
is_array_element = value.get("is_array_element", False)
|
||||||
|
if not is_array_element:
|
||||||
|
next_prefix = f"{parent_prefix}.{key}" if parent_prefix else key
|
||||||
|
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'
|
||||||
|
offset_state = calculate_offsets(value, offset_state)
|
||||||
|
field_data = {
|
||||||
|
"Nombre": next_prefix,
|
||||||
|
"Tipo": value.get("type", "N/A"),
|
||||||
|
"Offset": value.get("offset", "N/A"),
|
||||||
|
"Size": value.get("size", "N/A"),
|
||||||
|
"Level": level,
|
||||||
|
"Dirección PLC": value.get("plc_address", "N/A"),
|
||||||
|
"Comentario": value.get("comment", "N/A"),
|
||||||
|
}
|
||||||
|
collected_data.append(field_data)
|
||||||
|
increase_level = 1
|
||||||
|
|
||||||
|
# Recursively handle nested dictionaries and lists
|
||||||
|
if isinstance(value, dict) or isinstance(value, list):
|
||||||
|
collect_data_for_table(
|
||||||
|
value,
|
||||||
|
offset_state,
|
||||||
|
level + increase_level,
|
||||||
|
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, offset_state, level + increase_level, item_prefix, collected_data
|
||||||
|
)
|
||||||
|
|
||||||
|
return collected_data
|
||||||
|
|
||||||
|
|
||||||
|
def convert_to_table(db_struct):
|
||||||
|
offset_state = OffsetState()
|
||||||
|
return collect_data_for_table(db_struct, offset_state)
|
||||||
|
|
||||||
|
|
||||||
|
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 = convert_to_table(db_content)
|
||||||
|
all_data.extend(db_data)
|
||||||
|
|
||||||
|
df = pd.DataFrame(all_data)
|
||||||
|
return df
|
Binary file not shown.
440
DB_Structure.csv
440
DB_Structure.csv
|
@ -1,178 +1,262 @@
|
||||||
Nombre,Tipo,Offset,Dirección PLC,Comentario
|
Nombre,Tipo,Offset,Size,Level,Dirección PLC,Comentario
|
||||||
MAIN,"""UDT SIPA SV Main""",0,DBX0.0,
|
asa,Array[1..8] of Byte,0,0,0,DBX0.0,
|
||||||
MAIN.N1,DInt,0,DBD0,.DB_IOT.USERLEVEL
|
asa[1],Byte,0,1,1,DBB0,
|
||||||
MAIN.N2,String[81],4,DBX4.0,.DB_IOT.USERNAME
|
asa[2],Byte,1,1,1,DBB1,
|
||||||
MAIN.N3,String[81],88,DBX88.0,.DB_IOT.NOME_RICETTA
|
asa[3],Byte,2,1,1,DBB2,
|
||||||
MAIN.N4,Int,172,DBW172,.DB_IOT.NEXT_MAINT_CYCLES
|
asa[4],Byte,3,1,1,DBB3,
|
||||||
MAIN.N5.V1,String[254],174,DBX174.0,
|
asa[5],Byte,4,1,1,DBB4,
|
||||||
MAIN.N5.V2,String[254],430,DBX430.0,
|
asa[6],Byte,5,1,1,DBB5,
|
||||||
MAIN.N5.V3,String[254],686,DBX686.0,
|
asa[7],Byte,6,1,1,DBB6,
|
||||||
MAIN.N5.V4,String[254],942,DBX942.0,
|
asa[8],Byte,7,1,1,DBB7,
|
||||||
MAIN.N5.V5,String[8],1198,DBX1198.0,
|
b0,Bool,8,0.1,0,DBX8.0,
|
||||||
MAIN.N6,Array[1..3] of Real,1208,DBX1208.0,.DB_IOT.ELECTRIC_VOLTAGE_PHASE_D
|
b1,Bool,8,0.1,0,DBX8.1,
|
||||||
MAIN.N6[1],Real,1208,DBD1208,.DB_IOT.ELECTRIC_VOLTAGE_PHASE_D
|
s5,S5Time,10,2,0,DBW10,
|
||||||
MAIN.N6[2],Real,1212,DBD1212,.DB_IOT.ELECTRIC_VOLTAGE_PHASE_D
|
s,LInt,12,8,0,DBX12.0,
|
||||||
MAIN.N6[3],Real,1216,DBD1216,.DB_IOT.ELECTRIC_VOLTAGE_PHASE_D
|
s_1,WString,20,512,0,DBX20.0,
|
||||||
MAIN.N7,Array[1..3] of Real,1220,DBX1220.0,.DB_IOT.ELECTRIC_CURRENT_PHASE_D
|
s_2,UInt,532,2,0,DBW532,
|
||||||
MAIN.N7[1],Real,1220,DBD1220,.DB_IOT.ELECTRIC_CURRENT_PHASE_D
|
ss,LReal,534,8,0,DBX534.0,
|
||||||
MAIN.N7[2],Real,1224,DBD1224,.DB_IOT.ELECTRIC_CURRENT_PHASE_D
|
b2,Int,542,2,0,DBW542,
|
||||||
MAIN.N7[3],Real,1228,DBD1228,.DB_IOT.ELECTRIC_CURRENT_PHASE_D
|
b3,Array[0..15] of Bool,544,0,0,DBX544.0,
|
||||||
MAIN.N8,Real,1232,DBD1232,.DB_IOT.ELECTRIC_POWER_D
|
b3[0],Bool,544,0.1,1,DBX544.0,
|
||||||
MAIN.N9,Real,1236,DBD1236,.DB_IOT.ELECTRIC_POWER_FACTOR_D
|
b3[1],Bool,544,0.1,1,DBX544.1,
|
||||||
MAIN.N10,Real,1240,DBD1240,.DB_IOT.ELECTRIC_POWER_HOUR_D
|
b3[2],Bool,544,0.1,1,DBX544.2,
|
||||||
MAIN.N11,Real,1244,DBD1244,.DB_IOT.ELECTRIC_POWER_WH
|
b3[3],Bool,544,0.1,1,DBX544.3,
|
||||||
SECT1,"""UDT SIPA SV Section""",1248,DBX1248.0,
|
b3[4],Bool,544,0.1,1,DBX544.4,
|
||||||
SECT1.N1,DInt,1248,DBD1248,.DB_IOT.STATO_MACCHINA
|
b3[5],Bool,544,0.1,1,DBX544.5,
|
||||||
SECT1.N2,DInt,1252,DBD1252,.DB_IOT.ALLARME_FERMO
|
b3[6],Bool,544,0.1,1,DBX544.6,
|
||||||
SECT1.N3,DInt,1256,DBD1256,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
|
b3[7],Bool,544,0.1,1,DBX544.7,
|
||||||
SECT1.N4,Int,1260,DBW1260,.DB_IOT.STATO_OPERATIVO (Semaforo)
|
b3[8],Bool,545,0.1,1,DBX545.0,
|
||||||
SECT1.N5,Int,1262,DBW1262,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
|
b3[9],Bool,545,0.1,1,DBX545.1,
|
||||||
SECT1.N6,DInt,1264,DBD1264,.DB_IOT.ALARM_STOP_NO
|
b3[10],Bool,545,0.1,1,DBX545.2,
|
||||||
SECT1.N7.V1,DInt,1268,DBD1268,PIECES_TOT
|
b3[11],Bool,545,0.1,1,DBX545.3,
|
||||||
SECT1.N7.V2,DInt,1272,DBD1272,PIECES_OK
|
b3[12],Bool,545,0.1,1,DBX545.4,
|
||||||
SECT1.N7.V3,DInt,1276,DBD1276,PIECES_KO_1
|
b3[13],Bool,545,0.1,1,DBX545.5,
|
||||||
SECT1.N7.V4,DInt,1280,DBD1280,PIECES_KO_2
|
b3[14],Bool,545,0.1,1,DBX545.6,
|
||||||
SECT1.N7.V5,DInt,1284,DBD1284,PIECES_KO_3
|
b3[15],Bool,545,0.1,1,DBX545.7,
|
||||||
SECT1.N7.V6,DInt,1288,DBD1288,PIECES_KO_4
|
b4,Array[0..11] of Bool,546,0,0,DBX546.0,
|
||||||
SECT1.N7.V7,DInt,1292,DBD1292,PIECES_KO_5
|
b4[0],Bool,546,0.1,1,DBX546.0,
|
||||||
SECT1.N7.V8,DInt,1296,DBD1296,PIECES_KO_6
|
b4[1],Bool,546,0.1,1,DBX546.1,
|
||||||
SECT1.N7.V9,DInt,1300,DBD1300,PIECES_KO_7
|
b4[2],Bool,546,0.1,1,DBX546.2,
|
||||||
SECT1.N7.V10,DInt,1304,DBD1304,PIECES_KO_8
|
b4[3],Bool,546,0.1,1,DBX546.3,
|
||||||
SECT1.N7.V11,DInt,1308,DBD1308,PIECES_KO_9
|
b4[4],Bool,546,0.1,1,DBX546.4,
|
||||||
SECT1.N7.V12,DInt,1312,DBD1312,PIECES_KO_10
|
b4[5],Bool,546,0.1,1,DBX546.5,
|
||||||
SECT1.N7.V13,DInt,1316,DBD1316,T_ALARM_HOURS
|
b4[6],Bool,546,0.1,1,DBX546.6,
|
||||||
SECT1.N7.V14,DInt,1320,DBD1320,T_DRY_CYCLE_HOURS
|
b4[7],Bool,546,0.1,1,DBX546.7,
|
||||||
SECT1.N7.V15,DInt,1324,DBD1324,T_POWERED_HOURS
|
b4[8],Bool,547,0.1,1,DBX547.0,
|
||||||
SECT1.N7.V16,DInt,1328,DBD1328,T_PRODUCT_100_HOURS
|
b4[9],Bool,547,0.1,1,DBX547.1,
|
||||||
SECT1.N7.V17,DInt,1332,DBD1332,T_PRODUCT_0_HOURS
|
b4[10],Bool,547,0.1,1,DBX547.2,
|
||||||
SECT1.N7.V18,DInt,1336,DBD1336,T_STOP_HOURS
|
b4[11],Bool,547,0.1,1,DBX547.3,
|
||||||
SECT1.N7.V19,Int,1340,DBW1340,T_ALARM_MINUTES
|
"""Udt""","""UDT Complicada""",548,-1,0,DBX548.0,
|
||||||
SECT1.N7.V20,Int,1342,DBW1342,T_DRY_CYCLE_MINUTES
|
"""Udt"".""String""",String,548,256,1,DBX548.0,
|
||||||
SECT1.N7.V21,Int,1344,DBW1344,T_POWERED_MINUTES
|
"""Udt"".String_1",String[60],804,62,1,DBX804.0,
|
||||||
SECT1.N7.V22,Int,1346,DBW1346,T_PRODUCT_100_MINUTES
|
"""Udt"".""Bool""",Bool,866,0.1,1,DBX866.0,
|
||||||
SECT1.N7.V23,Int,1348,DBW1348,T_PRODUCT_0_MINUTES
|
"""Udt"".Bool_1",Array[0..1] of Bool,868,0,1,DBX868.0,
|
||||||
SECT1.N7.V24,Int,1350,DBW1350,T_STOP_MINUTES
|
"""Udt"".Bool_1[0]",Bool,868,0.1,2,DBX868.0,
|
||||||
SECT2,"""UDT SIPA SV Section""",1352,DBX1352.0,
|
"""Udt"".Bool_1[1]",Bool,868,0.1,2,DBX868.1,
|
||||||
SECT2.N1,DInt,1352,DBD1352,.DB_IOT.STATO_MACCHINA
|
"""Udt"".Bool_2",Array[0..51] of Bool,870,0,1,DBX870.0,
|
||||||
SECT2.N2,DInt,1356,DBD1356,.DB_IOT.ALLARME_FERMO
|
"""Udt"".Bool_2[0]",Bool,870,0.1,2,DBX870.0,
|
||||||
SECT2.N3,DInt,1360,DBD1360,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
|
"""Udt"".Bool_2[1]",Bool,870,0.1,2,DBX870.1,
|
||||||
SECT2.N4,Int,1364,DBW1364,.DB_IOT.STATO_OPERATIVO (Semaforo)
|
"""Udt"".Bool_2[2]",Bool,870,0.1,2,DBX870.2,
|
||||||
SECT2.N5,Int,1366,DBW1366,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
|
"""Udt"".Bool_2[3]",Bool,870,0.1,2,DBX870.3,
|
||||||
SECT2.N6,DInt,1368,DBD1368,.DB_IOT.ALARM_STOP_NO
|
"""Udt"".Bool_2[4]",Bool,870,0.1,2,DBX870.4,
|
||||||
SECT2.N7.V1,DInt,1372,DBD1372,PIECES_TOT
|
"""Udt"".Bool_2[5]",Bool,870,0.1,2,DBX870.5,
|
||||||
SECT2.N7.V2,DInt,1376,DBD1376,PIECES_OK
|
"""Udt"".Bool_2[6]",Bool,870,0.1,2,DBX870.6,
|
||||||
SECT2.N7.V3,DInt,1380,DBD1380,PIECES_KO_1
|
"""Udt"".Bool_2[7]",Bool,870,0.1,2,DBX870.7,
|
||||||
SECT2.N7.V4,DInt,1384,DBD1384,PIECES_KO_2
|
"""Udt"".Bool_2[8]",Bool,871,0.1,2,DBX871.0,
|
||||||
SECT2.N7.V5,DInt,1388,DBD1388,PIECES_KO_3
|
"""Udt"".Bool_2[9]",Bool,871,0.1,2,DBX871.1,
|
||||||
SECT2.N7.V6,DInt,1392,DBD1392,PIECES_KO_4
|
"""Udt"".Bool_2[10]",Bool,871,0.1,2,DBX871.2,
|
||||||
SECT2.N7.V7,DInt,1396,DBD1396,PIECES_KO_5
|
"""Udt"".Bool_2[11]",Bool,871,0.1,2,DBX871.3,
|
||||||
SECT2.N7.V8,DInt,1400,DBD1400,PIECES_KO_6
|
"""Udt"".Bool_2[12]",Bool,871,0.1,2,DBX871.4,
|
||||||
SECT2.N7.V9,DInt,1404,DBD1404,PIECES_KO_7
|
"""Udt"".Bool_2[13]",Bool,871,0.1,2,DBX871.5,
|
||||||
SECT2.N7.V10,DInt,1408,DBD1408,PIECES_KO_8
|
"""Udt"".Bool_2[14]",Bool,871,0.1,2,DBX871.6,
|
||||||
SECT2.N7.V11,DInt,1412,DBD1412,PIECES_KO_9
|
"""Udt"".Bool_2[15]",Bool,871,0.1,2,DBX871.7,
|
||||||
SECT2.N7.V12,DInt,1416,DBD1416,PIECES_KO_10
|
"""Udt"".Bool_2[16]",Bool,872,0.1,2,DBX872.0,
|
||||||
SECT2.N7.V13,DInt,1420,DBD1420,T_ALARM_HOURS
|
"""Udt"".Bool_2[17]",Bool,872,0.1,2,DBX872.1,
|
||||||
SECT2.N7.V14,DInt,1424,DBD1424,T_DRY_CYCLE_HOURS
|
"""Udt"".Bool_2[18]",Bool,872,0.1,2,DBX872.2,
|
||||||
SECT2.N7.V15,DInt,1428,DBD1428,T_POWERED_HOURS
|
"""Udt"".Bool_2[19]",Bool,872,0.1,2,DBX872.3,
|
||||||
SECT2.N7.V16,DInt,1432,DBD1432,T_PRODUCT_100_HOURS
|
"""Udt"".Bool_2[20]",Bool,872,0.1,2,DBX872.4,
|
||||||
SECT2.N7.V17,DInt,1436,DBD1436,T_PRODUCT_0_HOURS
|
"""Udt"".Bool_2[21]",Bool,872,0.1,2,DBX872.5,
|
||||||
SECT2.N7.V18,DInt,1440,DBD1440,T_STOP_HOURS
|
"""Udt"".Bool_2[22]",Bool,872,0.1,2,DBX872.6,
|
||||||
SECT2.N7.V19,Int,1444,DBW1444,T_ALARM_MINUTES
|
"""Udt"".Bool_2[23]",Bool,872,0.1,2,DBX872.7,
|
||||||
SECT2.N7.V20,Int,1446,DBW1446,T_DRY_CYCLE_MINUTES
|
"""Udt"".Bool_2[24]",Bool,873,0.1,2,DBX873.0,
|
||||||
SECT2.N7.V21,Int,1448,DBW1448,T_POWERED_MINUTES
|
"""Udt"".Bool_2[25]",Bool,873,0.1,2,DBX873.1,
|
||||||
SECT2.N7.V22,Int,1450,DBW1450,T_PRODUCT_100_MINUTES
|
"""Udt"".Bool_2[26]",Bool,873,0.1,2,DBX873.2,
|
||||||
SECT2.N7.V23,Int,1452,DBW1452,T_PRODUCT_0_MINUTES
|
"""Udt"".Bool_2[27]",Bool,873,0.1,2,DBX873.3,
|
||||||
SECT2.N7.V24,Int,1454,DBW1454,T_STOP_MINUTES
|
"""Udt"".Bool_2[28]",Bool,873,0.1,2,DBX873.4,
|
||||||
SECT3,"""UDT SIPA SV Section""",1456,DBX1456.0,
|
"""Udt"".Bool_2[29]",Bool,873,0.1,2,DBX873.5,
|
||||||
SECT3.N1,DInt,1456,DBD1456,.DB_IOT.STATO_MACCHINA
|
"""Udt"".Bool_2[30]",Bool,873,0.1,2,DBX873.6,
|
||||||
SECT3.N2,DInt,1460,DBD1460,.DB_IOT.ALLARME_FERMO
|
"""Udt"".Bool_2[31]",Bool,873,0.1,2,DBX873.7,
|
||||||
SECT3.N3,DInt,1464,DBD1464,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
|
"""Udt"".Bool_2[32]",Bool,874,0.1,2,DBX874.0,
|
||||||
SECT3.N4,Int,1468,DBW1468,.DB_IOT.STATO_OPERATIVO (Semaforo)
|
"""Udt"".Bool_2[33]",Bool,874,0.1,2,DBX874.1,
|
||||||
SECT3.N5,Int,1470,DBW1470,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
|
"""Udt"".Bool_2[34]",Bool,874,0.1,2,DBX874.2,
|
||||||
SECT3.N6,DInt,1472,DBD1472,.DB_IOT.ALARM_STOP_NO
|
"""Udt"".Bool_2[35]",Bool,874,0.1,2,DBX874.3,
|
||||||
SECT3.N7.V1,DInt,1476,DBD1476,PIECES_TOT
|
"""Udt"".Bool_2[36]",Bool,874,0.1,2,DBX874.4,
|
||||||
SECT3.N7.V2,DInt,1480,DBD1480,PIECES_OK
|
"""Udt"".Bool_2[37]",Bool,874,0.1,2,DBX874.5,
|
||||||
SECT3.N7.V3,DInt,1484,DBD1484,PIECES_KO_1
|
"""Udt"".Bool_2[38]",Bool,874,0.1,2,DBX874.6,
|
||||||
SECT3.N7.V4,DInt,1488,DBD1488,PIECES_KO_2
|
"""Udt"".Bool_2[39]",Bool,874,0.1,2,DBX874.7,
|
||||||
SECT3.N7.V5,DInt,1492,DBD1492,PIECES_KO_3
|
"""Udt"".Bool_2[40]",Bool,875,0.1,2,DBX875.0,
|
||||||
SECT3.N7.V6,DInt,1496,DBD1496,PIECES_KO_4
|
"""Udt"".Bool_2[41]",Bool,875,0.1,2,DBX875.1,
|
||||||
SECT3.N7.V7,DInt,1500,DBD1500,PIECES_KO_5
|
"""Udt"".Bool_2[42]",Bool,875,0.1,2,DBX875.2,
|
||||||
SECT3.N7.V8,DInt,1504,DBD1504,PIECES_KO_6
|
"""Udt"".Bool_2[43]",Bool,875,0.1,2,DBX875.3,
|
||||||
SECT3.N7.V9,DInt,1508,DBD1508,PIECES_KO_7
|
"""Udt"".Bool_2[44]",Bool,875,0.1,2,DBX875.4,
|
||||||
SECT3.N7.V10,DInt,1512,DBD1512,PIECES_KO_8
|
"""Udt"".Bool_2[45]",Bool,875,0.1,2,DBX875.5,
|
||||||
SECT3.N7.V11,DInt,1516,DBD1516,PIECES_KO_9
|
"""Udt"".Bool_2[46]",Bool,875,0.1,2,DBX875.6,
|
||||||
SECT3.N7.V12,DInt,1520,DBD1520,PIECES_KO_10
|
"""Udt"".Bool_2[47]",Bool,875,0.1,2,DBX875.7,
|
||||||
SECT3.N7.V13,DInt,1524,DBD1524,T_ALARM_HOURS
|
"""Udt"".Bool_2[48]",Bool,876,0.1,2,DBX876.0,
|
||||||
SECT3.N7.V14,DInt,1528,DBD1528,T_DRY_CYCLE_HOURS
|
"""Udt"".Bool_2[49]",Bool,876,0.1,2,DBX876.1,
|
||||||
SECT3.N7.V15,DInt,1532,DBD1532,T_POWERED_HOURS
|
"""Udt"".Bool_2[50]",Bool,876,0.1,2,DBX876.2,
|
||||||
SECT3.N7.V16,DInt,1536,DBD1536,T_PRODUCT_100_HOURS
|
"""Udt"".Bool_2[51]",Bool,876,0.1,2,DBX876.3,
|
||||||
SECT3.N7.V17,DInt,1540,DBD1540,T_PRODUCT_0_HOURS
|
"""Udt"".""Int""",Int,878,2,1,DBW878,
|
||||||
SECT3.N7.V18,DInt,1544,DBD1544,T_STOP_HOURS
|
"""Udt"".""Hola como Estas""",Int,880,2,1,DBW880,
|
||||||
SECT3.N7.V19,Int,1548,DBW1548,T_ALARM_MINUTES
|
"""Udt"".""No se""",Int,882,2,1,DBW882,
|
||||||
SECT3.N7.V20,Int,1550,DBW1550,T_DRY_CYCLE_MINUTES
|
"""Udt"".""Real""",Array[0..10] of Real,884,0,1,DBX884.0,
|
||||||
SECT3.N7.V21,Int,1552,DBW1552,T_POWERED_MINUTES
|
"""Udt"".""Real""[0]",Real,884,4,2,DBD884,
|
||||||
SECT3.N7.V22,Int,1554,DBW1554,T_PRODUCT_100_MINUTES
|
"""Udt"".""Real""[1]",Real,888,4,2,DBD888,
|
||||||
SECT3.N7.V23,Int,1556,DBW1556,T_PRODUCT_0_MINUTES
|
"""Udt"".""Real""[2]",Real,892,4,2,DBD892,
|
||||||
SECT3.N7.V24,Int,1558,DBW1558,T_STOP_MINUTES
|
"""Udt"".""Real""[3]",Real,896,4,2,DBD896,
|
||||||
SECT4,"""UDT SIPA SV Section""",1560,DBX1560.0,
|
"""Udt"".""Real""[4]",Real,900,4,2,DBD900,
|
||||||
SECT4.N1,DInt,1560,DBD1560,.DB_IOT.STATO_MACCHINA
|
"""Udt"".""Real""[5]",Real,904,4,2,DBD904,
|
||||||
SECT4.N2,DInt,1564,DBD1564,.DB_IOT.ALLARME_FERMO
|
"""Udt"".""Real""[6]",Real,908,4,2,DBD908,
|
||||||
SECT4.N3,DInt,1568,DBD1568,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
|
"""Udt"".""Real""[7]",Real,912,4,2,DBD912,
|
||||||
SECT4.N4,Int,1572,DBW1572,.DB_IOT.STATO_OPERATIVO (Semaforo)
|
"""Udt"".""Real""[8]",Real,916,4,2,DBD916,
|
||||||
SECT4.N5,Int,1574,DBW1574,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
|
"""Udt"".""Real""[9]",Real,920,4,2,DBD920,
|
||||||
SECT4.N6,DInt,1576,DBD1576,.DB_IOT.ALARM_STOP_NO
|
"""Udt"".""Real""[10]",Real,924,4,2,DBD924,
|
||||||
SECT4.N7.V1,DInt,1580,DBD1580,PIECES_TOT
|
"""Udt"".Bool_3",Bool,928,0.1,1,DBX928.0,
|
||||||
SECT4.N7.V2,DInt,1584,DBD1584,PIECES_OK
|
"""Udt"".Bool_4",Bool,928,0.1,1,DBX928.1,
|
||||||
SECT4.N7.V3,DInt,1588,DBD1588,PIECES_KO_1
|
"""Udt"".Bool_5",Array[0..7] of Bool,930,0,1,DBX930.0,
|
||||||
SECT4.N7.V4,DInt,1592,DBD1592,PIECES_KO_2
|
"""Udt"".Bool_5[0]",Bool,930,0.1,2,DBX930.0,
|
||||||
SECT4.N7.V5,DInt,1596,DBD1596,PIECES_KO_3
|
"""Udt"".Bool_5[1]",Bool,930,0.1,2,DBX930.1,
|
||||||
SECT4.N7.V6,DInt,1600,DBD1600,PIECES_KO_4
|
"""Udt"".Bool_5[2]",Bool,930,0.1,2,DBX930.2,
|
||||||
SECT4.N7.V7,DInt,1604,DBD1604,PIECES_KO_5
|
"""Udt"".Bool_5[3]",Bool,930,0.1,2,DBX930.3,
|
||||||
SECT4.N7.V8,DInt,1608,DBD1608,PIECES_KO_6
|
"""Udt"".Bool_5[4]",Bool,930,0.1,2,DBX930.4,
|
||||||
SECT4.N7.V9,DInt,1612,DBD1612,PIECES_KO_7
|
"""Udt"".Bool_5[5]",Bool,930,0.1,2,DBX930.5,
|
||||||
SECT4.N7.V10,DInt,1616,DBD1616,PIECES_KO_8
|
"""Udt"".Bool_5[6]",Bool,930,0.1,2,DBX930.6,
|
||||||
SECT4.N7.V11,DInt,1620,DBD1620,PIECES_KO_9
|
"""Udt"".Bool_5[7]",Bool,930,0.1,2,DBX930.7,
|
||||||
SECT4.N7.V12,DInt,1624,DBD1624,PIECES_KO_10
|
"""Udt"".Bool_6",Array[0..15] of Bool,932,0,1,DBX932.0,
|
||||||
SECT4.N7.V13,DInt,1628,DBD1628,T_ALARM_HOURS
|
"""Udt"".Bool_6[0]",Bool,932,0.1,2,DBX932.0,
|
||||||
SECT4.N7.V14,DInt,1632,DBD1632,T_DRY_CYCLE_HOURS
|
"""Udt"".Bool_6[1]",Bool,932,0.1,2,DBX932.1,
|
||||||
SECT4.N7.V15,DInt,1636,DBD1636,T_POWERED_HOURS
|
"""Udt"".Bool_6[2]",Bool,932,0.1,2,DBX932.2,
|
||||||
SECT4.N7.V16,DInt,1640,DBD1640,T_PRODUCT_100_HOURS
|
"""Udt"".Bool_6[3]",Bool,932,0.1,2,DBX932.3,
|
||||||
SECT4.N7.V17,DInt,1644,DBD1644,T_PRODUCT_0_HOURS
|
"""Udt"".Bool_6[4]",Bool,932,0.1,2,DBX932.4,
|
||||||
SECT4.N7.V18,DInt,1648,DBD1648,T_STOP_HOURS
|
"""Udt"".Bool_6[5]",Bool,932,0.1,2,DBX932.5,
|
||||||
SECT4.N7.V19,Int,1652,DBW1652,T_ALARM_MINUTES
|
"""Udt"".Bool_6[6]",Bool,932,0.1,2,DBX932.6,
|
||||||
SECT4.N7.V20,Int,1654,DBW1654,T_DRY_CYCLE_MINUTES
|
"""Udt"".Bool_6[7]",Bool,932,0.1,2,DBX932.7,
|
||||||
SECT4.N7.V21,Int,1656,DBW1656,T_POWERED_MINUTES
|
"""Udt"".Bool_6[8]",Bool,933,0.1,2,DBX933.0,
|
||||||
SECT4.N7.V22,Int,1658,DBW1658,T_PRODUCT_100_MINUTES
|
"""Udt"".Bool_6[9]",Bool,933,0.1,2,DBX933.1,
|
||||||
SECT4.N7.V23,Int,1660,DBW1660,T_PRODUCT_0_MINUTES
|
"""Udt"".Bool_6[10]",Bool,933,0.1,2,DBX933.2,
|
||||||
SECT4.N7.V24,Int,1662,DBW1662,T_STOP_MINUTES
|
"""Udt"".Bool_6[11]",Bool,933,0.1,2,DBX933.3,
|
||||||
SECT5,"""UDT SIPA SV Section""",1664,DBX1664.0,
|
"""Udt"".Bool_6[12]",Bool,933,0.1,2,DBX933.4,
|
||||||
SECT5.N1,DInt,1664,DBD1664,.DB_IOT.STATO_MACCHINA
|
"""Udt"".Bool_6[13]",Bool,933,0.1,2,DBX933.5,
|
||||||
SECT5.N2,DInt,1668,DBD1668,.DB_IOT.ALLARME_FERMO
|
"""Udt"".Bool_6[14]",Bool,933,0.1,2,DBX933.6,
|
||||||
SECT5.N3,DInt,1672,DBD1672,.DB_IOT.WARNING_ATTIVO (che compromette produzione)
|
"""Udt"".Bool_6[15]",Bool,933,0.1,2,DBX933.7,
|
||||||
SECT5.N4,Int,1676,DBW1676,.DB_IOT.STATO_OPERATIVO (Semaforo)
|
"""Udt"".Int_1",Int,934,2,1,DBW934,
|
||||||
SECT5.N5,Int,1678,DBW1678,".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)"
|
"""Udt"".""Time""",Time,936,4,1,DBD936,
|
||||||
SECT5.N6,DInt,1680,DBD1680,.DB_IOT.ALARM_STOP_NO
|
"""Udt"".Time_of",Time_Of_Day,940,4,1,DBD940,
|
||||||
SECT5.N7.V1,DInt,1684,DBD1684,PIECES_TOT
|
"""Udt"".""Word""",Word,944,2,1,DBW944,
|
||||||
SECT5.N7.V2,DInt,1688,DBD1688,PIECES_OK
|
udt_1,"""UDTComp""",946,-1,0,DBX946.0,
|
||||||
SECT5.N7.V3,DInt,1692,DBD1692,PIECES_KO_1
|
"udt_1.""String""",String,946,256,1,DBX946.0,
|
||||||
SECT5.N7.V4,DInt,1696,DBD1696,PIECES_KO_2
|
udt_1.String_1,String[60],1202,62,1,DBX1202.0,
|
||||||
SECT5.N7.V5,DInt,1700,DBD1700,PIECES_KO_3
|
"udt_1.""Bool""",Bool,1264,0.1,1,DBX1264.0,
|
||||||
SECT5.N7.V6,DInt,1704,DBD1704,PIECES_KO_4
|
udt_1.Bool_1,Array[0..1] of Bool,1266,0,1,DBX1266.0,
|
||||||
SECT5.N7.V7,DInt,1708,DBD1708,PIECES_KO_5
|
udt_1.Bool_1[0],Bool,1266,0.1,2,DBX1266.0,
|
||||||
SECT5.N7.V8,DInt,1712,DBD1712,PIECES_KO_6
|
udt_1.Bool_1[1],Bool,1266,0.1,2,DBX1266.1,
|
||||||
SECT5.N7.V9,DInt,1716,DBD1716,PIECES_KO_7
|
udt_1.Bool_2,Array[0..51] of Bool,1268,0,1,DBX1268.0,
|
||||||
SECT5.N7.V10,DInt,1720,DBD1720,PIECES_KO_8
|
udt_1.Bool_2[0],Bool,1268,0.1,2,DBX1268.0,
|
||||||
SECT5.N7.V11,DInt,1724,DBD1724,PIECES_KO_9
|
udt_1.Bool_2[1],Bool,1268,0.1,2,DBX1268.1,
|
||||||
SECT5.N7.V12,DInt,1728,DBD1728,PIECES_KO_10
|
udt_1.Bool_2[2],Bool,1268,0.1,2,DBX1268.2,
|
||||||
SECT5.N7.V13,DInt,1732,DBD1732,T_ALARM_HOURS
|
udt_1.Bool_2[3],Bool,1268,0.1,2,DBX1268.3,
|
||||||
SECT5.N7.V14,DInt,1736,DBD1736,T_DRY_CYCLE_HOURS
|
udt_1.Bool_2[4],Bool,1268,0.1,2,DBX1268.4,
|
||||||
SECT5.N7.V15,DInt,1740,DBD1740,T_POWERED_HOURS
|
udt_1.Bool_2[5],Bool,1268,0.1,2,DBX1268.5,
|
||||||
SECT5.N7.V16,DInt,1744,DBD1744,T_PRODUCT_100_HOURS
|
udt_1.Bool_2[6],Bool,1268,0.1,2,DBX1268.6,
|
||||||
SECT5.N7.V17,DInt,1748,DBD1748,T_PRODUCT_0_HOURS
|
udt_1.Bool_2[7],Bool,1268,0.1,2,DBX1268.7,
|
||||||
SECT5.N7.V18,DInt,1752,DBD1752,T_STOP_HOURS
|
udt_1.Bool_2[8],Bool,1269,0.1,2,DBX1269.0,
|
||||||
SECT5.N7.V19,Int,1756,DBW1756,T_ALARM_MINUTES
|
udt_1.Bool_2[9],Bool,1269,0.1,2,DBX1269.1,
|
||||||
SECT5.N7.V20,Int,1758,DBW1758,T_DRY_CYCLE_MINUTES
|
udt_1.Bool_2[10],Bool,1269,0.1,2,DBX1269.2,
|
||||||
SECT5.N7.V21,Int,1760,DBW1760,T_POWERED_MINUTES
|
udt_1.Bool_2[11],Bool,1269,0.1,2,DBX1269.3,
|
||||||
SECT5.N7.V22,Int,1762,DBW1762,T_PRODUCT_100_MINUTES
|
udt_1.Bool_2[12],Bool,1269,0.1,2,DBX1269.4,
|
||||||
SECT5.N7.V23,Int,1764,DBW1764,T_PRODUCT_0_MINUTES
|
udt_1.Bool_2[13],Bool,1269,0.1,2,DBX1269.5,
|
||||||
SECT5.N7.V24,Int,1766,DBW1766,T_STOP_MINUTES
|
udt_1.Bool_2[14],Bool,1269,0.1,2,DBX1269.6,
|
||||||
|
udt_1.Bool_2[15],Bool,1269,0.1,2,DBX1269.7,
|
||||||
|
udt_1.Bool_2[16],Bool,1270,0.1,2,DBX1270.0,
|
||||||
|
udt_1.Bool_2[17],Bool,1270,0.1,2,DBX1270.1,
|
||||||
|
udt_1.Bool_2[18],Bool,1270,0.1,2,DBX1270.2,
|
||||||
|
udt_1.Bool_2[19],Bool,1270,0.1,2,DBX1270.3,
|
||||||
|
udt_1.Bool_2[20],Bool,1270,0.1,2,DBX1270.4,
|
||||||
|
udt_1.Bool_2[21],Bool,1270,0.1,2,DBX1270.5,
|
||||||
|
udt_1.Bool_2[22],Bool,1270,0.1,2,DBX1270.6,
|
||||||
|
udt_1.Bool_2[23],Bool,1270,0.1,2,DBX1270.7,
|
||||||
|
udt_1.Bool_2[24],Bool,1271,0.1,2,DBX1271.0,
|
||||||
|
udt_1.Bool_2[25],Bool,1271,0.1,2,DBX1271.1,
|
||||||
|
udt_1.Bool_2[26],Bool,1271,0.1,2,DBX1271.2,
|
||||||
|
udt_1.Bool_2[27],Bool,1271,0.1,2,DBX1271.3,
|
||||||
|
udt_1.Bool_2[28],Bool,1271,0.1,2,DBX1271.4,
|
||||||
|
udt_1.Bool_2[29],Bool,1271,0.1,2,DBX1271.5,
|
||||||
|
udt_1.Bool_2[30],Bool,1271,0.1,2,DBX1271.6,
|
||||||
|
udt_1.Bool_2[31],Bool,1271,0.1,2,DBX1271.7,
|
||||||
|
udt_1.Bool_2[32],Bool,1272,0.1,2,DBX1272.0,
|
||||||
|
udt_1.Bool_2[33],Bool,1272,0.1,2,DBX1272.1,
|
||||||
|
udt_1.Bool_2[34],Bool,1272,0.1,2,DBX1272.2,
|
||||||
|
udt_1.Bool_2[35],Bool,1272,0.1,2,DBX1272.3,
|
||||||
|
udt_1.Bool_2[36],Bool,1272,0.1,2,DBX1272.4,
|
||||||
|
udt_1.Bool_2[37],Bool,1272,0.1,2,DBX1272.5,
|
||||||
|
udt_1.Bool_2[38],Bool,1272,0.1,2,DBX1272.6,
|
||||||
|
udt_1.Bool_2[39],Bool,1272,0.1,2,DBX1272.7,
|
||||||
|
udt_1.Bool_2[40],Bool,1273,0.1,2,DBX1273.0,
|
||||||
|
udt_1.Bool_2[41],Bool,1273,0.1,2,DBX1273.1,
|
||||||
|
udt_1.Bool_2[42],Bool,1273,0.1,2,DBX1273.2,
|
||||||
|
udt_1.Bool_2[43],Bool,1273,0.1,2,DBX1273.3,
|
||||||
|
udt_1.Bool_2[44],Bool,1273,0.1,2,DBX1273.4,
|
||||||
|
udt_1.Bool_2[45],Bool,1273,0.1,2,DBX1273.5,
|
||||||
|
udt_1.Bool_2[46],Bool,1273,0.1,2,DBX1273.6,
|
||||||
|
udt_1.Bool_2[47],Bool,1273,0.1,2,DBX1273.7,
|
||||||
|
udt_1.Bool_2[48],Bool,1274,0.1,2,DBX1274.0,
|
||||||
|
udt_1.Bool_2[49],Bool,1274,0.1,2,DBX1274.1,
|
||||||
|
udt_1.Bool_2[50],Bool,1274,0.1,2,DBX1274.2,
|
||||||
|
udt_1.Bool_2[51],Bool,1274,0.1,2,DBX1274.3,
|
||||||
|
"udt_1.""Int""",Int,1276,2,1,DBW1276,
|
||||||
|
"udt_1.""Hola como Estas""",Int,1278,2,1,DBW1278,
|
||||||
|
"udt_1.""No se""",Int,1280,2,1,DBW1280,
|
||||||
|
"udt_1.""Real""",Array[0..10] of Real,1282,0,1,DBX1282.0,
|
||||||
|
"udt_1.""Real""[0]",Real,1282,4,2,DBD1282,
|
||||||
|
"udt_1.""Real""[1]",Real,1286,4,2,DBD1286,
|
||||||
|
"udt_1.""Real""[2]",Real,1290,4,2,DBD1290,
|
||||||
|
"udt_1.""Real""[3]",Real,1294,4,2,DBD1294,
|
||||||
|
"udt_1.""Real""[4]",Real,1298,4,2,DBD1298,
|
||||||
|
"udt_1.""Real""[5]",Real,1302,4,2,DBD1302,
|
||||||
|
"udt_1.""Real""[6]",Real,1306,4,2,DBD1306,
|
||||||
|
"udt_1.""Real""[7]",Real,1310,4,2,DBD1310,
|
||||||
|
"udt_1.""Real""[8]",Real,1314,4,2,DBD1314,
|
||||||
|
"udt_1.""Real""[9]",Real,1318,4,2,DBD1318,
|
||||||
|
"udt_1.""Real""[10]",Real,1322,4,2,DBD1322,
|
||||||
|
udt_1.Bool_3,Bool,1326,0.1,1,DBX1326.0,
|
||||||
|
udt_1.Bool_4,Bool,1326,0.1,1,DBX1326.1,
|
||||||
|
udt_1.Bool_5,Array[0..7] of Bool,1328,0,1,DBX1328.0,
|
||||||
|
udt_1.Bool_5[0],Bool,1328,0.1,2,DBX1328.0,
|
||||||
|
udt_1.Bool_5[1],Bool,1328,0.1,2,DBX1328.1,
|
||||||
|
udt_1.Bool_5[2],Bool,1328,0.1,2,DBX1328.2,
|
||||||
|
udt_1.Bool_5[3],Bool,1328,0.1,2,DBX1328.3,
|
||||||
|
udt_1.Bool_5[4],Bool,1328,0.1,2,DBX1328.4,
|
||||||
|
udt_1.Bool_5[5],Bool,1328,0.1,2,DBX1328.5,
|
||||||
|
udt_1.Bool_5[6],Bool,1328,0.1,2,DBX1328.6,
|
||||||
|
udt_1.Bool_5[7],Bool,1328,0.1,2,DBX1328.7,
|
||||||
|
udt_1.Bool_6,Array[0..15] of Bool,1330,0,1,DBX1330.0,
|
||||||
|
udt_1.Bool_6[0],Bool,1330,0.1,2,DBX1330.0,
|
||||||
|
udt_1.Bool_6[1],Bool,1330,0.1,2,DBX1330.1,
|
||||||
|
udt_1.Bool_6[2],Bool,1330,0.1,2,DBX1330.2,
|
||||||
|
udt_1.Bool_6[3],Bool,1330,0.1,2,DBX1330.3,
|
||||||
|
udt_1.Bool_6[4],Bool,1330,0.1,2,DBX1330.4,
|
||||||
|
udt_1.Bool_6[5],Bool,1330,0.1,2,DBX1330.5,
|
||||||
|
udt_1.Bool_6[6],Bool,1330,0.1,2,DBX1330.6,
|
||||||
|
udt_1.Bool_6[7],Bool,1330,0.1,2,DBX1330.7,
|
||||||
|
udt_1.Bool_6[8],Bool,1331,0.1,2,DBX1331.0,
|
||||||
|
udt_1.Bool_6[9],Bool,1331,0.1,2,DBX1331.1,
|
||||||
|
udt_1.Bool_6[10],Bool,1331,0.1,2,DBX1331.2,
|
||||||
|
udt_1.Bool_6[11],Bool,1331,0.1,2,DBX1331.3,
|
||||||
|
udt_1.Bool_6[12],Bool,1331,0.1,2,DBX1331.4,
|
||||||
|
udt_1.Bool_6[13],Bool,1331,0.1,2,DBX1331.5,
|
||||||
|
udt_1.Bool_6[14],Bool,1331,0.1,2,DBX1331.6,
|
||||||
|
udt_1.Bool_6[15],Bool,1331,0.1,2,DBX1331.7,
|
||||||
|
udt_1.Int_1,Int,1332,2,1,DBW1332,
|
||||||
|
"udt_1.""Time""",Time,1334,4,1,DBD1334,
|
||||||
|
udt_1.Time_of,Time_Of_Day,1338,4,1,DBD1338,
|
||||||
|
"udt_1.""Word""",Word,1342,2,1,DBW1342,
|
||||||
|
|
|
|
@ -0,0 +1,780 @@
|
||||||
|
{
|
||||||
|
"Data_block_1": {
|
||||||
|
"Struct": {
|
||||||
|
"asa": {
|
||||||
|
"type": "Array[1..8] of Byte",
|
||||||
|
"comment": "",
|
||||||
|
"array_definition": true,
|
||||||
|
"Array": {
|
||||||
|
"[1]": {
|
||||||
|
"type": "Byte",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[2]": {
|
||||||
|
"type": "Byte",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[3]": {
|
||||||
|
"type": "Byte",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[4]": {
|
||||||
|
"type": "Byte",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[5]": {
|
||||||
|
"type": "Byte",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[6]": {
|
||||||
|
"type": "Byte",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[7]": {
|
||||||
|
"type": "Byte",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[8]": {
|
||||||
|
"type": "Byte",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"b0": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"b1": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"s5": {
|
||||||
|
"type": "S5Time",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"type": "LInt",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"s_1": {
|
||||||
|
"type": "WString",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"s_2": {
|
||||||
|
"type": "UInt",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"ss": {
|
||||||
|
"type": "LReal",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"b2": {
|
||||||
|
"type": "Int",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"b3": {
|
||||||
|
"type": "Array[0..15] of Bool",
|
||||||
|
"comment": "",
|
||||||
|
"array_definition": true,
|
||||||
|
"Array": {
|
||||||
|
"[0]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[1]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[2]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[3]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[4]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[5]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[6]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[7]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[8]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[9]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[10]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[11]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[12]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[13]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[14]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[15]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"b4": {
|
||||||
|
"type": "Array[0..11] of Bool",
|
||||||
|
"comment": "",
|
||||||
|
"array_definition": true,
|
||||||
|
"Array": {
|
||||||
|
"[0]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[1]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[2]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[3]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[4]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[5]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[6]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[7]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[8]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[9]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[10]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[11]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"\"Udt\"": {
|
||||||
|
"type": "\"UDTd Complicada\"",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"udt_1": {
|
||||||
|
"type": "\"UDTComp\"",
|
||||||
|
"comment": "",
|
||||||
|
"is_udt_definition": true,
|
||||||
|
"fields": {
|
||||||
|
"Struct": {
|
||||||
|
"\"String\"": {
|
||||||
|
"type": "String",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"String_1": {
|
||||||
|
"type": "String[60]",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"\"Bool\"": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"Bool_1": {
|
||||||
|
"type": "Array[0..1] of Bool",
|
||||||
|
"comment": "",
|
||||||
|
"array_definition": true,
|
||||||
|
"Array": {
|
||||||
|
"[0]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[1]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Bool_2": {
|
||||||
|
"type": "Array[0..51] of Bool",
|
||||||
|
"comment": "",
|
||||||
|
"array_definition": true,
|
||||||
|
"Array": {
|
||||||
|
"[0]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[1]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[2]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[3]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[4]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[5]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[6]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[7]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[8]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[9]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[10]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[11]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[12]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[13]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[14]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[15]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[16]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[17]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[18]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[19]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[20]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[21]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[22]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[23]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[24]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[25]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[26]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[27]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[28]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[29]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[30]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[31]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[32]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[33]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[34]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[35]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[36]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[37]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[38]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[39]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[40]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[41]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[42]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[43]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[44]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[45]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[46]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[47]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[48]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[49]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[50]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[51]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"\"Int\"": {
|
||||||
|
"type": "Int",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"\"Hola como Estas\"": {
|
||||||
|
"type": "Int",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"\"No se\"": {
|
||||||
|
"type": "Int",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"\"Real\"": {
|
||||||
|
"type": "Array[0..10] of Real",
|
||||||
|
"comment": "",
|
||||||
|
"array_definition": true,
|
||||||
|
"Array": {
|
||||||
|
"[0]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[1]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[2]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[3]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[4]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[5]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[6]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[7]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[8]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[9]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[10]": {
|
||||||
|
"type": "Real",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Bool_3": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"Bool_4": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"Bool_5": {
|
||||||
|
"type": "Array[0..7] of Bool",
|
||||||
|
"comment": "",
|
||||||
|
"array_definition": true,
|
||||||
|
"Array": {
|
||||||
|
"[0]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[1]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[2]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[3]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[4]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[5]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[6]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[7]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Bool_6": {
|
||||||
|
"type": "Array[0..15] of Bool",
|
||||||
|
"comment": "",
|
||||||
|
"array_definition": true,
|
||||||
|
"Array": {
|
||||||
|
"[0]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[1]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[2]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[3]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[4]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[5]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[6]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[7]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[8]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[9]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[10]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[11]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[12]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[13]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[14]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
},
|
||||||
|
"[15]": {
|
||||||
|
"type": "Bool",
|
||||||
|
"comment": "",
|
||||||
|
"is_array_element": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Int_1": {
|
||||||
|
"type": "Int",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"\"Time\"": {
|
||||||
|
"type": "Time",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"Time_of": {
|
||||||
|
"type": "Time_Of_Day",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
|
"\"Word\"": {
|
||||||
|
"type": "Word",
|
||||||
|
"comment": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
3150
DB_Structure.xml
3150
DB_Structure.xml
File diff suppressed because it is too large
Load Diff
|
@ -1,9 +1,6 @@
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
import json
|
import json
|
||||||
import pandas as pd
|
|
||||||
from ExportData import *
|
|
||||||
from ExpandDB import *
|
|
||||||
|
|
||||||
|
|
||||||
def clean_line(line):
|
def clean_line(line):
|
||||||
"""Clean line from BOM and extra spaces or quotes."""
|
"""Clean line from BOM and extra spaces or quotes."""
|
||||||
|
@ -12,8 +9,15 @@ def clean_line(line):
|
||||||
# Standardize TYPE and DATA_BLOCK definitions to ensure they're properly captured
|
# 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*TYPE\s+"?', 'TYPE "', line)
|
||||||
line = re.sub(r'\s*DATA_BLOCK\s+"?', 'DATA_BLOCK "', line)
|
line = re.sub(r'\s*DATA_BLOCK\s+"?', 'DATA_BLOCK "', line)
|
||||||
|
line = remove_text_inside_brackets(line)
|
||||||
return line
|
return line
|
||||||
|
|
||||||
|
def remove_text_inside_brackets(text):
|
||||||
|
# Define the pattern to find text inside brackets
|
||||||
|
pattern = r"\{.*?\}"
|
||||||
|
# Use re.sub to replace the found text with an empty string
|
||||||
|
cleaned_text = re.sub(pattern, '', text)
|
||||||
|
return cleaned_text
|
||||||
|
|
||||||
def extract_name(line):
|
def extract_name(line):
|
||||||
"""Extract the name from TYPE or DATA_BLOCK definition line."""
|
"""Extract the name from TYPE or DATA_BLOCK definition line."""
|
||||||
|
@ -147,9 +151,17 @@ def parse_dbs(lines, udts):
|
||||||
|
|
||||||
return db_json
|
return db_json
|
||||||
|
|
||||||
|
def save_data_as_json(file_path, data):
|
||||||
|
with open(file_path, 'w', encoding='utf-8') as f:
|
||||||
|
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||||
|
|
||||||
|
from CreateTable import *
|
||||||
|
from ExpandDB import *
|
||||||
|
from manejoArchivos import *
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
file_path = "DB SIPA Supervision.db"
|
file_path = "Data_block_1.db" ## select_file()
|
||||||
|
if file_path: # Proceed only if a file was selected
|
||||||
with open(file_path, "r", encoding="utf-8-sig") as file:
|
with open(file_path, "r", encoding="utf-8-sig") as file:
|
||||||
lines = file.readlines()
|
lines = file.readlines()
|
||||||
|
|
||||||
|
@ -157,11 +169,17 @@ if __name__ == "__main__":
|
||||||
db_json = parse_dbs(lines, udt_json)
|
db_json = parse_dbs(lines, udt_json)
|
||||||
|
|
||||||
expand_dbs(udt_json, db_json) # Expand DBs with UDT definitions
|
expand_dbs(udt_json, db_json) # Expand DBs with UDT definitions
|
||||||
|
save_data_as_json("DB_Structure.jon", db_json)
|
||||||
|
|
||||||
# Display the expanded DBs as a table
|
# Display the expanded DBs as a table
|
||||||
df = display_as_table(db_json)
|
df = display_as_table(db_json)
|
||||||
save_dataframe_to_file(df) # Save the DataFrame to a CSV file
|
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_dataframe_to_excel(df,"DB_Structure.xlsx") # Optionally, save the DataFrame to an Excel file
|
||||||
|
|
||||||
# Save JSON data to an XML file
|
# Save JSON data to an XML file
|
||||||
save_json_to_xml(db_json)
|
save_json_to_xml(db_json)
|
||||||
|
|
||||||
|
# Open the directory containing the new file in Explorer
|
||||||
|
##open_file_explorer(os.path.dirname(file_path))
|
||||||
|
else:
|
||||||
|
print("No file was selected.")
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
TYPE "UDT Complicada"
|
||||||
|
VERSION : 0.1
|
||||||
|
STRUCT
|
||||||
|
"String" : String;
|
||||||
|
String_1 : String[60];
|
||||||
|
"Bool" : Bool;
|
||||||
|
Bool_1 : Array[0..1] of Bool;
|
||||||
|
Bool_2 : Array[0..51] of Bool;
|
||||||
|
"Int" : Int;
|
||||||
|
"Hola como Estas" : Int;
|
||||||
|
"No se" : Int;
|
||||||
|
"Real" : Array[0..10] of Real;
|
||||||
|
Bool_3 : Bool;
|
||||||
|
Bool_4 : Bool;
|
||||||
|
Bool_5 : Array[0..7] of Bool;
|
||||||
|
Bool_6 : Array[0..15] of Bool;
|
||||||
|
Int_1 : Int;
|
||||||
|
"Time" : Time;
|
||||||
|
Time_of : Time_Of_Day;
|
||||||
|
"Word" : Word;
|
||||||
|
END_STRUCT;
|
||||||
|
|
||||||
|
END_TYPE
|
||||||
|
|
||||||
|
TYPE "UDTComp"
|
||||||
|
VERSION : 0.1
|
||||||
|
STRUCT
|
||||||
|
"String" : String;
|
||||||
|
String_1 : String[60];
|
||||||
|
"Bool" : Bool;
|
||||||
|
Bool_1 : Array[0..1] of Bool;
|
||||||
|
Bool_2 : Array[0..51] of Bool;
|
||||||
|
"Int" : Int;
|
||||||
|
"Hola como Estas" : Int;
|
||||||
|
"No se" : Int;
|
||||||
|
"Real" : Array[0..10] of Real;
|
||||||
|
Bool_3 : Bool;
|
||||||
|
Bool_4 : Bool;
|
||||||
|
Bool_5 : Array[0..7] of Bool;
|
||||||
|
Bool_6 : Array[0..15] of Bool;
|
||||||
|
Int_1 : Int;
|
||||||
|
"Time" : Time;
|
||||||
|
Time_of : Time_Of_Day;
|
||||||
|
"Word" : Word;
|
||||||
|
END_STRUCT;
|
||||||
|
|
||||||
|
END_TYPE
|
||||||
|
|
||||||
|
DATA_BLOCK "Data_block_1"
|
||||||
|
{ S7_Optimized_Access := 'FALSE' }
|
||||||
|
VERSION : 0.1
|
||||||
|
NON_RETAIN
|
||||||
|
STRUCT
|
||||||
|
asa : Array[1..8] of Byte;
|
||||||
|
b0 : Bool;
|
||||||
|
b1 : Bool;
|
||||||
|
s5 : S5Time;
|
||||||
|
s : LInt;
|
||||||
|
s_1 : WString;
|
||||||
|
s_2 : UInt;
|
||||||
|
ss : LReal;
|
||||||
|
b2 : Int;
|
||||||
|
b3 : Array[0..15] of Bool;
|
||||||
|
b4 : Array[0..11] of Bool;
|
||||||
|
"Udt" { S7_SetPoint := 'False'} : "UDTd Complicada";
|
||||||
|
udt_1 : "UDTComp";
|
||||||
|
END_STRUCT;
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
END_DATA_BLOCK
|
||||||
|
|
102
ExpandDB.py
102
ExpandDB.py
|
@ -27,7 +27,9 @@ def expand_udt_references(db_struct, udts):
|
||||||
) # Remove quotes which may wrap UDT names with spaces
|
) # Remove quotes which may wrap UDT names with spaces
|
||||||
if type_name in udts:
|
if type_name in udts:
|
||||||
# Replace the UDT reference with its deeply copied definition
|
# Replace the UDT reference with its deeply copied definition
|
||||||
|
db_struct["is_udt_definition"] = True
|
||||||
db_struct["fields"] = deepcopy(udts[type_name])
|
db_struct["fields"] = deepcopy(udts[type_name])
|
||||||
|
|
||||||
print(f"Expanded UDT '{type_name}' at field '{key}'")
|
print(f"Expanded UDT '{type_name}' at field '{key}'")
|
||||||
elif isinstance(db_struct, list):
|
elif isinstance(db_struct, list):
|
||||||
for item in db_struct:
|
for item in db_struct:
|
||||||
|
@ -54,7 +56,7 @@ def handle_array_types(db_struct):
|
||||||
match.group(3),
|
match.group(3),
|
||||||
)
|
)
|
||||||
comment = value.get("comment", "")
|
comment = value.get("comment", "")
|
||||||
|
value["array_definition"] = True
|
||||||
# Instead of popping the original key, initialize a sub-dictionary
|
# Instead of popping the original key, initialize a sub-dictionary
|
||||||
value["Array"] = (
|
value["Array"] = (
|
||||||
{}
|
{}
|
||||||
|
@ -76,103 +78,6 @@ def handle_array_types(db_struct):
|
||||||
handle_array_types(value)
|
handle_array_types(value)
|
||||||
|
|
||||||
|
|
||||||
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_plc_address(type_name, byte_offset, bit_offset=None):
|
|
||||||
"""
|
|
||||||
Calculate the PLC address notation based on byte size, byte offset and bit offset.
|
|
||||||
"""
|
|
||||||
byte_size = type_sizes.get(type_name, 0)
|
|
||||||
if type_name == "Bool":
|
|
||||||
if bit_offset is not None:
|
|
||||||
return f"DBX{byte_offset}.{bit_offset}" # Address for single bits
|
|
||||||
return f"DBB{byte_offset}" # Address for single bytes
|
|
||||||
elif byte_size == 2:
|
|
||||||
return f"DBW{byte_offset}" # Address for two-byte words
|
|
||||||
elif byte_size == 4:
|
|
||||||
return f"DBD{byte_offset}" # Address for four-byte double words
|
|
||||||
else:
|
|
||||||
return f"DBX{byte_offset}.0" # Default to bit address for types longer than 4 bytes (e.g., strings)
|
|
||||||
|
|
||||||
|
|
||||||
def calculate_offsets(db_struct, current_offset=0):
|
|
||||||
"""
|
|
||||||
Recursively calculate byte offsets for each field in the DB structure considering special types.
|
|
||||||
"""
|
|
||||||
is_array_element = False
|
|
||||||
last_key_was_bool = False
|
|
||||||
last_bit_offset = 0 # To track bit offsets within a byte
|
|
||||||
if isinstance(db_struct, dict):
|
|
||||||
for key, value in db_struct.items():
|
|
||||||
# Skip 'fields' and 'Struct' keys in the name path
|
|
||||||
#
|
|
||||||
if (
|
|
||||||
isinstance(value, dict) and "type" in value
|
|
||||||
): # Directly a field with 'type'
|
|
||||||
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
|
|
||||||
)
|
|
||||||
last_bit_offset = 0
|
|
||||||
|
|
||||||
plc_address = calculate_plc_address(
|
|
||||||
type_name, current_offset, last_bit_offset
|
|
||||||
)
|
|
||||||
|
|
||||||
# Special handling for String types
|
|
||||||
if "String" in type_name:
|
|
||||||
match = re.match(r"String\[(\d+)\]", type_name)
|
|
||||||
last_bit_offset = 0
|
|
||||||
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
|
|
||||||
last_bit_offset += 1 # One bit per Bool if grouped
|
|
||||||
else:
|
|
||||||
size = 2 # Bools use a full byte if not grouped
|
|
||||||
last_bit_offset = 0
|
|
||||||
last_key_was_bool = True
|
|
||||||
else:
|
|
||||||
last_key_was_bool = False
|
|
||||||
|
|
||||||
value["offset"] = current_offset
|
|
||||||
value["plc_address"] = plc_address # Store the calculated PLC address
|
|
||||||
# print(f"Offset '{current_offset}' at field '{key}' ")
|
|
||||||
current_offset += size
|
|
||||||
|
|
||||||
# Recursively handle nested dictionaries and lists
|
|
||||||
if isinstance(value, dict) or isinstance(value, list):
|
|
||||||
current_offset = calculate_offsets(value, current_offset)
|
|
||||||
elif isinstance(db_struct, list):
|
|
||||||
for index, item in enumerate(db_struct):
|
|
||||||
for item in db_struct:
|
|
||||||
current_offset = calculate_offsets(item, current_offset)
|
|
||||||
|
|
||||||
return current_offset
|
|
||||||
|
|
||||||
|
|
||||||
def expand_dbs(udts, dbs):
|
def expand_dbs(udts, dbs):
|
||||||
"""
|
"""
|
||||||
|
@ -182,5 +87,4 @@ def expand_dbs(udts, dbs):
|
||||||
print(f"Expanding DB: {db_name}")
|
print(f"Expanding DB: {db_name}")
|
||||||
expand_udt_references(db_content, udts)
|
expand_udt_references(db_content, udts)
|
||||||
handle_array_types(db_content)
|
handle_array_types(db_content)
|
||||||
calculate_offsets(db_content)
|
|
||||||
print(f"Completed expansion for DB: {db_name}")
|
print(f"Completed expansion for DB: {db_name}")
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
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.
|
|
||||||
"""
|
|
||||||
is_array_element = False
|
|
||||||
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" or key == "Array":
|
|
||||||
next_prefix = parent_prefix # Continue with the current prefix
|
|
||||||
else:
|
|
||||||
if isinstance(value, dict):
|
|
||||||
is_array_element = value.get('is_array_element', False)
|
|
||||||
if not is_array_element:
|
|
||||||
next_prefix = f"{parent_prefix}.{key}" if parent_prefix else key
|
|
||||||
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"),
|
|
||||||
"Dirección PLC": value.get("plc_address", "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.
|
@ -1,30 +0,0 @@
|
||||||
{
|
|
||||||
"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": ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
import pandas as pd
|
||||||
|
import tkinter as tk
|
||||||
|
from tkinter import filedialog
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
def select_file():
|
||||||
|
"""
|
||||||
|
Opens a file dialog to select a .db file and returns the selected file path.
|
||||||
|
"""
|
||||||
|
root = tk.Tk()
|
||||||
|
root.withdraw() # Use to hide the tkinter root window
|
||||||
|
|
||||||
|
# Open file dialog and return the selected file path
|
||||||
|
file_path = filedialog.askopenfilename(
|
||||||
|
title="Select a .db file",
|
||||||
|
filetypes=(("DB files", "*.db"), ("All files", "*.*"))
|
||||||
|
)
|
||||||
|
return file_path
|
||||||
|
|
||||||
|
def open_file_explorer(path):
|
||||||
|
"""
|
||||||
|
Opens the file explorer at the given path, correctly handling paths with spaces.
|
||||||
|
"""
|
||||||
|
# Normalize the path to ensure it's in the correct format
|
||||||
|
normalized_path = os.path.normpath(path)
|
||||||
|
|
||||||
|
# Check if the path is a directory or a file and format the command accordingly
|
||||||
|
if os.path.isdir(normalized_path):
|
||||||
|
# If it's a directory, use the 'explorer' command directly
|
||||||
|
command = f'explorer "{normalized_path}"'
|
||||||
|
else:
|
||||||
|
# If it's a file, use the 'explorer /select,' command to highlight the file in its folder
|
||||||
|
command = f'explorer /select,"{normalized_path}"'
|
||||||
|
|
||||||
|
# Execute the command using subprocess.run, with shell=True to handle paths with spaces correctly
|
||||||
|
subprocess.run(command, shell=True)
|
|
@ -1,194 +0,0 @@
|
||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue