plc:software_plc_examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
plc:software_plc_examples [2019/07/12 09:26] – ivan | plc:software_plc_examples [2021/02/03 16:04] – ivan | ||
---|---|---|---|
Line 261: | Line 261: | ||
}; | }; | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===Switching an output ON for a certain period of time=== | ||
+ | |||
+ | < | ||
+ | #define OUTPUT_TIMER 15 | ||
+ | main() | ||
+ | { | ||
+ | count=0; | ||
+ | do{ | ||
+ | a=gvarget(7373); | ||
+ | |||
+ | if (a!=0) | ||
+ | { | ||
+ | count++; | ||
+ | if (count< | ||
+ | else { | ||
+ | portclr(OUTPUT_TIMER); | ||
+ | if (count> | ||
+ | }; | ||
+ | }else | ||
+ | { | ||
+ | portclr(OUTPUT_TIMER); | ||
+ | count=0; | ||
+ | }; | ||
+ | }while(1); | ||
+ | exit(99); | ||
+ | }; | ||
</ | </ | ||
plc/software_plc_examples.txt · Last modified: 2022/03/29 15:55 by ivan