thisisawful
Hello - I'm new to PLC programming so I humbly apologize if this is a stupid question (it likely is). My goal is to produce a state machine that flips to TRUE after a FALSE condition occurs. In other words, when "a" flips from TRUE to FALSE, it it should set "b" to TRUE. A simple setup like this would, I think, work:

demo.png 
However, as shown by the highlights on B, whenever i start the program this automatically starts in a TRUE state. Could someone explain to me what I'm missing. I feel really stupid.
thiagoralves
I believe it could be a bug in the F_TRIG block that produces a single pulse if the input starts as FALSE. Try creating your own F_TRIG block with the following code and check if that works (you will have to define the variables yourself in the editor, it won’t allow variable declarations directly in the code)

Function_Block MY_F_TRIG
    Var_Input CLK : BOOL; End_Var
    Var_Output Q : BOOL; End_Var
    Var M : BOOL := TRUE; End_Var
    Q := NOT CLK AND NOT M;
    M := NOT CLK;
End_Function_Block
Reply 1 0
thisisawful
Hi Thiagoralves, thanks so much. I think it does appear to be a bug. Thanks for creating the software and providing feedback so quickly. That's so nice of you and I know we all appreciate it. 
Reply 2 0
Reply