Modifiche1

This commit is contained in:
Giuseppe De Franceschi 2025-08-25 08:55:46 +02:00
parent 97f4c9e975
commit 5340ff59c7
2 changed files with 102 additions and 4 deletions

View File

@ -1,12 +1,11 @@
---
id: flusso-comunicazione
sidebar_position: 7
title: Flusso di Scambio Dati (PLC-HMI-SCADA)
sidebar_label: Flusso Comunicazione
sidebar_label: Flusso di Comunicazione
pagination_prev: null
hide_table_of_contents: true
sidebar_position: 6
---
# Flusso di Scambio Dati (PLC - HMI - SCADA)
Questo documento descrive il processo di scambio dati tra PLC, HMI e SCADA

View File

@ -0,0 +1,99 @@
---
id: flusso-comunicazione1
sidebar_position: 6
title: Flusso di Scambio Dati (PLC-HMI-SCADA)
sidebar_label: Flusso di Comunicazione
pagination_prev: null
hide_table_of_contents: true
---
# Flusso di Scambio Dati (PLC - HMI - SCADA)
Questo documento descrive il processo di scambio dati tra PLC, HMI e SCADA
per la gestione del **cambio ricetta** e del **meccanismo di heartbeat (watchdog)**.
---
## Sequence Diagram Cambio Ricetta e Heartbeat
```mermaid
sequenceDiagram
autonumber
participant HMI as HMI (Operatore)
participant PLC as PLC
participant SCADA as SCADA
Note over HMI: Operatore abilita controllo remoto
HMI->>PLC: RemoteControlEn = TRUE
Note over SCADA: Invio nuova produzione (indice ricetta, lotto, …)
SCADA->>PLC: ProductionChangeRequest = TRUE
PLC-->>SCADA: AckChangeRecipe = TRUE
SCADA-->>PLC: ProductionChangeRequest = FALSE
PLC-->>SCADA: AckChangeRecipe = FALSE
PLC-->>HMI: AckChangeRecipeToHMI = TRUE (apri pop-up)
alt Operatore ACCETTA
HMI->>PLC: RecipeChangeOk = TRUE
PLC->>PLC: Carica ricetta / aggiorna dati
PLC-->>SCADA: RecipeChangeOK = TRUE (2s)
else Operatore RIFIUTA (o chiude)
HMI->>PLC: RejectRecipeChange = TRUE (o CloseMESWindow)
PLC-->>SCADA: RecipeChangeReject = TRUE (2s)
else Operatore POSTICIPA
HMI->>PLC: BatchChangePopupDismiss = TRUE
PLC->>PLC: Avvia timer 30s
PLC-->>SCADA: RecipeChangePostpone = TRUE
PLC-->>HMI: (allo scadere 30s) ri-apri pop-up
end
par Heartbeat / Watchdog
loop ogni 1s
PLC-->>SCADA: PlcHeartbeat_Toggle (inverti bit)
SCADA-->>PLC: ScadaHeartbeat_Echo = PlcHeartbeat_Toggle
end
PLC->>PLC: Se mismatch > 3s ⇒ MesCommunicationFault = TRUE
end
```
---
## State Diagram Macchina a stati (S60_RecipeManagement)
```mermaid
stateDiagram-v2
[*] --> Idle
Idle --> Handshake_In: ProductionChangeRequest ↑
Handshake_In --> Wait_Request_Low: AckChangeRecipe = TRUE
Wait_Request_Low --> Popup_To_HMI: ProductionChangeRequest = FALSE, AckChangeRecipe = FALSE
Popup_To_HMI --> Wait_Operator: AckChangeRecipeToHMI = TRUE
state Wait_Operator {
[*] --> AwaitChoice
AwaitChoice --> ApplyRecipe: RecipeChangeOk = TRUE
AwaitChoice --> RejectRecipe: RejectRecipeChange = TRUE
AwaitChoice --> Postpone: BatchChangePopupDismiss = TRUE
ApplyRecipe --> ReportOK: (carica/aggiorna dati)
ReportOK --> [*]
RejectRecipe --> ReportReject
ReportReject --> [*]
Postpone --> Timer30s
Timer30s --> Popup_To_HMI: allo scadere 30s (riapri pop-up)
}
note right of ReportOK
Egress.RecipeChangeOK = TRUE (2s)
end note
note right of ReportReject
Egress.RecipeChangeReject = TRUE (2s)
end note
```