tests/syntax/configuration/configuration.txt
author mjsousa
Sun, 19 Oct 2014 08:36:49 +0100
changeset 936 0f7bcc160568
parent 109 3af0b849b9c6
permissions -rwxr-xr-x
Fix bug: Add support for de-referencing pointers to struct (struct_ptr^.elem1) when used inside FB.
Note that multiple de-referencing of structs (struct_ptr_ptr^^.elem) is not supported inside FB code (this would need BIG changes to the compiler!)



PROGRAM foo
VAR_INPUT
  single, interval, priority : BOOL;
END_VAR
  LD single
  LD interval
  LD priority
END_PROGRAM


PROGRAM priority
VAR_INPUT
  bar : BOOL;
END_VAR
  LD bar
END_PROGRAM


PROGRAM single
VAR_INPUT
  bar : BOOL;
END_VAR
  LD bar
END_PROGRAM


PROGRAM interval
VAR_INPUT
  bar : BOOL;
END_VAR
  LD bar
END_PROGRAM





CONFIGURATION config1
 TASK fast(PRIORITY := 4);
 PROGRAM P1 WITH fast:
       FOO(single := TRUE, interval := TRUE, priority := TRUE);
END_CONFIGURATION


CONFIGURATION config2
 TASK fast(SINGLE := 3, PRIORITY := 4);
 PROGRAM P1 WITH fast:
       FOO(single := TRUE, interval := TRUE, priority := TRUE);
END_CONFIGURATION


CONFIGURATION config3
 TASK fast(INTERVAL := T#1s, PRIORITY := 4);
 PROGRAM P1 WITH fast:
       FOO(single := TRUE, interval := TRUE, priority := TRUE);
END_CONFIGURATION


CONFIGURATION config4
 TASK fast(SINGLE := 3, INTERVAL := T#1s, PRIORITY := 4);
 PROGRAM P1 WITH fast:
       FOO(single := TRUE, interval := TRUE, priority := TRUE);
END_CONFIGURATION