Vai al contenuto

Check a SFC POU From Other Programs

To allow the managing of a SFC POU from other programs GF_ProjectVX code provides the following functionalities:
  • The compiler automatically generates the _RESET_SFC and _ HOLD_SFC flags.
  • If the SFC POU is a function block, the user has the possibility to declare, as VAR_INPUT and type BOOL, both flags having the name of the SFC POU control flags.
  • If the SFC POU is a program, the user has the possibility to declare, as VAR_GLOBAL and type BOOL, both flags having the name of the SFC POU control flags.
  • In both cases above, GF_ProjectVX code compiler will use the variables declared among the VAR_ INPUT or VAR_GLOBAL ones and not those automatically generated (therefore they will be not generated).
Using these techniques, user then can manage the working state of the SFC POU from other POU using the INPUT variables of the SFC POU.ExampleFUNCTION_BLOCK testVAR_INPUT…test_RESET_SFC : BOOL; (* Control flag explicitly declared *)END_VAR…END_FUNCTION_BLOCKPROGRAM MainVAR…block : test; (* SFC block instance *)END_VAR…(* Reset SFC block state *)block.test_RESET_SFC := TRUE;…END_PROGRAM