JPak
Hello, 
I am trying to Program a functionblock in IL. I Remodelled the Code After an existing Code but the Compiler says EOL missing at the end of IL instruction.
I have no clue what i did wrong. 
Best wishes
Jan P
Quote 0 0
JPak
Hey there,

my code goes as follow:

Timer(
     IN := (Timer.Q
              NOT
              😉,
     PT := 100,
     Q => ,
     ET =>
)
Zaehler(
     CD := Timer.Q,
     LD := Zaehler.Q,
     PV := 16,
     Q =>,
     CV =>
)
LD  Zaehler.Q
JMPCN Weiter
LD    FuehlerwertIntern
DIV   (Zaehler.PV
       INT_TO_UINT
       😉
ADD   (Ausgang_UINT
       MUL  2
       😉
DIV    3
ST    Ausgang_UINT
LD    0
ST    FuehlerwertIntern
Weiter: 
LD    Timer.Q
JMPCN Fuehlerstoerung
LD    FuehlerwertIntern
ADD   Eingang_UINT
ST    FuehlerwertIntern
Fuehlerstoerung: 
LD    Eingang_UINT
LT    MIN_Grenzwert_UINT
OR    (   Eingang_UINT
      GT  MAX_Grenzwert_UINT
       😉
ST    Fuehlerbruch_BOOL
LD    Erstdurchlauf
JMPCN Ende
LD    Eingang_UINT
ST    Ausgang_UINT
Ende: 


and the original code i remodelled to my code (from sucosoft s40):
  CAL Timer(
    Set :=(  Timer.OutputControl
      NOT
      😉,
    ReSet :=,
    Hold :=,
    PresetTime :=100
    |
     :=OutputControl,
     :=ElapsedTime
  😉
  CAL Zaehler(
    CD :=Timer.OutputControl,
    LOAD :=Zaehler.Q,
    PV :=16
    |
     :=Q,
     :=CV
  😉
  LD  Zaehler.Q
  JMPCN  Weiter
  LD  FuehlerwertIntern
  DIV  (  Zaehler.PV
      INT_TO_UINT
    😉  
  ADD  (  Ausgang_UINT
      MUL  2  
    😉
  DIV  3
  ST  Ausgang_UINT
  LD  0
  ST  FuehlerwertIntern
Weiter:
  
  LD  Timer.OutputControl
  JMPCN  Fuehlerstoerung
  LD  FuehlerwertIntern  
  ADD  Eingang_UINT
  ST  FuehlerwertIntern
  
Fuehlerstoerung:
  LD  Eingang_UINT
  LT  MIN_Grenzwert_UINT
  OR  (  Eingang_UINT
    GT  MAX_Grenzwert_UINT
    😉  
  ST  Fuehlerbruch_BOOL
  LD  ISA
  PLC_Message
  JMPCN Ende
  
  LD  Eingang_UINT
  ST  Ausgang_UINT
  
Ende:


Sorry for my bad english and the german plc-program
I hope you can still help me with my problem
Quote 0 0
thiagoralves
Can you attach your project here in a zip file? The code was messed up by the forum automatic emoji feature.
Quote 0 0
JPak
Here's the attached file of the program

The program is supposed to be a watchdog for some analog 0-10v sensors.
If the sensor fails (i.e. value is 0 or 4095 for a period of time) the programs gives a boolean output (Fuehlerbruch) that tells the main program that the sensor is not working and a ErrorBit should be set to interrupt the machine.
Quote 0 0
thiagoralves
Your program has several syntax errors. The EOL error is actually a side effect of the compiler not being able to understand the code. First, you put your code in a function block that never gets called. If this is the main code, it should reside in the main program POU (which is empty on your project). Then, there are several incorrect constructs such as
Timer(
     IN := (Timer.Q
              NOT
             )

The "NOT" instruction is sitting there out of place. Same thing happened with INT_TO_UINT and some other function calls.

I think what you want to achieve would be much easier to write in Structured Text or even Ladder Logic than Instruction List. I suggest you try to rewrite this in one of those languages or refactor your Instruction List code according to IEC 61131-3 specifications.
Quote 0 0
JPak
Hello, 
So the thing is, this is Just a function Block and Not the Main Program, only an extension for the Main program. 
The Main program is already written, but in a different project.
I want to use the IL Language but how could i achieve the Code behaving like the original Code from Moeller PS400 PLC
I.e. 
Timer (
  In := (Timer.Q 
      NOT
    😉 



I want to build the plc for a hvac rooftop System (german Dachlüftungszentrale) and i have to rewrite the Code in OpenPLC, because the original plc isnt manufactured anymore and the Software is still a bit old (2001) and i also have to rewrite many functions which are missing All along. 
Quote 0 0