Hey there!
I've got a "simple" problem, so:
(This is just an example i know it has no sense):
http://imgur.com/WogIgo1
I have to SET Variable to 1 after i press on START and then i have to RESET it to 0 when i press START again and so on to make some Function get to work. I tho it would be easy but i am stuck . I have no idea how to SET/RESET it after i press START. Any advices?
Thanks.
[Newbie Question][Proficy Machine Edition] If Statement
-
- Posts: 2
- Joined: Wed Mar 05, 2014 10:36 pm
-
- Posts: 894
- Joined: Sun Apr 11, 2010 3:00 am
- Location: Russia
Re: [Newbie Question][Proficy Machine Edition] If Statement
Is it principally to use ladder? Try this way:
where
Code: Select all
IF Start THEN
IF NOT flag THEN
Out := NOT Out;
END_IF;
flag := TRUE;
ELSE
flag := FALSE;
END_IF;
Code: Select all
FUNCTION_BLOCK start_example
VAR_INPUT
Start: BOOL;
END_VAR
VAR_OUTPUT
Out: BOOL;
END_VAR
VAR
flag: BOOL; (* aux.var *)
END_VAR
-
- Posts: 2
- Joined: Wed Mar 05, 2014 10:36 pm
Re: [Newbie Question][Proficy Machine Edition] If Statement
Forgot to mention. I have to use ladders . Any example would be appreciated.
-
- Posts: 894
- Joined: Sun Apr 11, 2010 3:00 am
- Location: Russia
Re: [Newbie Question][Proficy Machine Edition] If Statement
Example with falling edge detector (temp: F_TRIG)