Differences
This shows you the differences between two versions of the page.
— |
de:project_s7:init_one_times [2022/04/21 15:01] () |
||
---|---|---|---|
1: | 1: | ||
+ | ====== Init only one times ====== | ||
+ | {{: | ||
+ | This " | ||
+ | {{: | ||
+ | Dieser " | ||
+ | |||
+ | {{: | ||
+ | Ennek az " | ||
+ | |||
+ | <WRAP center round download 80%> | ||
+ | **SCL-Programm download : ** {{ : | ||
+ | Der Quellcode enthält eine Beschreibung eines scl-Codes (siehe Quellcode unten). Der Code kann im TIA-Portal geöffnet und übersetzt werden. | ||
+ | </ | ||
+ | |||
+ | From file (from 2020.10.30) **{{dlcounter> | ||
+ | |||
+ | Das Programm wurde mit **TIA Portal 16** getestet. | ||
+ | |||
+ | <hidden Klicken Sie hier, um den Code anzuzeigen - Click here to view the code> | ||
+ | <code pascal> | ||
+ | FUNCTION_BLOCK " | ||
+ | { S7_Optimized_Access := ' | ||
+ | VERSION : 0.1 | ||
+ | | ||
+ | newstart : Bool := FALSE; | ||
+ | initOneTime : Bool := FALSE; | ||
+ | waitAfterNewStart {InstructionName := ' | ||
+ | test { S7_SetPoint := ' | ||
+ | | ||
+ | |||
+ | |||
+ | BEGIN | ||
+ | // init one times with delay | ||
+ | // Vamos Sandor 2020 | ||
+ | // | ||
+ | // It is often necessary for the PLC to run an init program block for a specific task. | ||
+ | // This " | ||
+ | |||
+ | # | ||
+ | | ||
+ | |||
+ | # | ||
+ | |||
+ | IF # | ||
+ | #newstart := TRUE; // newstart is ready | ||
+ | # | ||
+ | END_IF; | ||
+ | |||
+ | IF # | ||
+ | // the beginning of the init block | ||
+ | | ||
+ | #test := #test + 1; | ||
+ | | ||
+ | // the end of the init block | ||
+ | | ||
+ | END_IF; | ||
+ | |||
+ | // check the test function | ||
+ | // - runninfg only one times (count to 1) | ||
+ | // - running with delay (1 min from PLC new start) | ||
+ | #test := #test; | ||
+ | END_FUNCTION_BLOCK | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | {{page> |