wrong syntax if drag-n-drop POU into IL editor

Issue #77 new
Andrey Skvortsov created an issue

If you dran-n-drop POU from variable panel into IL editor, than ST template is pasted, but it should be IL.

For example,

FUNCTION function0 : BOOL
  VAR_INPUT
    In1 : BOOL;
    In2 : BOOL;
  END_VAR

  function0 := NOT In1;
END_FUNCTION

FUNCTION_BLOCK functionBlock0
  VAR_INPUT
    In1 : BOOL;
    In2 : BOOL;
  END_VAR
  VAR_OUTPUT
    Out : BOOL;
  END_VAR

  Out := In1;
END_FUNCTION_BLOCK
PROGRAM program0
  VAR
    In1_1 : BOOL;
    In1_2 : BOOL;
    In2_1 : BOOL;
    In2_2 : BOOL;
    Out1 : BOOL;
    Out2 : BOOL;
    Fb0 : functionBlock0;
  END_VAR

  (* function call *)
  LD In1_1
  function0 IN1_2
  ST Out1

  (* wrong pasted code by drag-n-drop *)

  function0(
       In1 := (*BOOL*),
       In2 := (*BOOL*),
       OUT => (*BOOL*))





  (* function block call *)
  cal Fb0(
    In1 := In2_1,
    In2 := In2_2
  )
  LD Fb0.Out
  ST Out2

  (* wrong pasted code by drag-n-drop *)
  fb0(
       In1 := (*BOOL*),
       In2 := (*BOOL*),
       Out => (*BOOL*))
END_PROGRAM

attached project for quick testing

Comments (2)

  1. Log in to comment