plc:button_to_toggle_select_output_pin_with_indication
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
plc:button_to_toggle_select_output_pin_with_indication [2017/12/06 01:47] – es | plc:button_to_toggle_select_output_pin_with_indication [2017/12/06 13:38] – es | ||
---|---|---|---|
Line 28: | Line 28: | ||
main() | main() | ||
{ | { | ||
- | a=portget (0x406); | ||
- | if (a==0) {portset(6); | ||
- | if (a!=0) {portclr(6); | ||
+ | a=portget (0x406); //read current state of output #6 | ||
+ | |||
+ | if (a==0) {portset(6); | ||
+ | else {portclr(6); | ||
exit(99); | exit(99); | ||
+ | | ||
}; | }; | ||
</ | </ |
plc/button_to_toggle_select_output_pin_with_indication.txt · Last modified: 2017/12/06 13:49 by es