Hello to all TwinCAT developers,
I am currently developing function blocks with TwinCAT.
I'm trying to find a "standard" way to interact with the outside of the block.
The Beckhoff examples always have a bExec
signal to start a state machine on the rising edge.
fbRisingEdge(CLK := bExec);
IF fbRisingEdge.Q THEN
nStep := 1;
END_IF
CASE nStep OF
1:
nStep := nStep + 1;
2:
nStep := nStep + 1;
END_CASE
I find that this principle is heavy to use and requires more code to create the rising edge:
fbFileOpen(sPathName := sPathName, bExecute := FALSE);
fbFileOpen(sPathName := sPathName, bExecute := TRUE);
Would anyone use another alternative to start a state-machine inside a FB?
Thank you, Happy new year!