The diagnostics buffer gives you much more information than that. There may be many entries in the diagnostics buffer. The entry that points the most directly to the cause of the error may not be the last entry.JesperMp: Diagnostic buffer says that OB1 has error. OB1 contains this function (that contains this part of code). As I said when I delete these two lines highlighted with yellow every thing is ok.
FUNCTION FC1 : VOID
[B]VAR_TEMP[/B]
iBert:INT;
END_VAR
iBert:=0;
END_FUNCTION
The diagnostics buffer gives you much more information than that. There may be many entries in the diagnostics buffer. The entry that points the most directly to the cause of the error may not be the last entry.
Use the following for declaring temp variables thus preventing further confusion.
Code:FUNCTION FC1 : VOID [B]VAR_TEMP[/B] iBert:INT; END_VAR iBert:=0; END_FUNCTION
Exactly - when are posters going to learn to read and inwardly digest the information presented to them?
Thank you. But I'm declaring variables for one shot signal, so It is wrong to declare them in TEMP area. Instead, I will make a function block and use STATIC area.