Errore compilatore C0076

Messaggio

Unexpected structure initialization

Causa messaggio

Errore di sintassi nell’inizializzazione della struttura.

Soluzione

Accertarsi che la sintassi sia corretta.

Esempio di errore

PROGRAM PLC_PRG
VAR
 st1 : INT := (p1 := 1);
END_VAR

--> C0076: Unexpected structure initialization

--> C0032: Cannot convert type 'STRUCT(p1:=1)' to type 'INT'

--> C0046: Identifier 'p1' is not defined

--> C0018: 'p1' is no valid assignment target

Correzione errore

st1 : STRUCT1 := (p1:=1,p2:=10);

Dove STRUCT1 è dichiarato come:

TYPE STRUCT1:
STRUCT
  p1 : INT;
  p2 : INT;
END_STRUCT
END_TYPE