Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
(from manual)
meaning the busy output is starting with FALSE (normal as default of all bools is false.
now when claim gets TRUE the busy stays FALSE, as it is defined above the claim.
the next round it sees x TRUE so busy gets also TRUE.
think of a semaphore, the signal only gets red after the train is passed, if you would arrive at the signal and claim it the signal would change from green to red immediately, so the driver has no time to pass the signal.
as the block is public you can change it to what you like, or try the oscat.lib as it has many FBC for all types of functions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey,
I have a questing concerning the SEMA function in Standard.lib
SemaInstance.BUSY becomes true when the SEMA function is called with CLAIM := true, but this only after the second cycle. Not the first.
Does anybody knows if this is normal?
Declarations:
Program:
BUSY = SEMA(CLAIM, RELEASE) means:
BUSY := X;
IF CLAIM THEN X:=TRUE;
ELSE IF RELEASE THEN BUSY := FALSE; X:= FALSE;
END_IF
(from manual)
meaning the busy output is starting with FALSE (normal as default of all bools is false.
now when claim gets TRUE the busy stays FALSE, as it is defined above the claim.
the next round it sees x TRUE so busy gets also TRUE.
think of a semaphore, the signal only gets red after the train is passed, if you would arrive at the signal and claim it the signal would change from green to red immediately, so the driver has no time to pass the signal.
as the block is public you can change it to what you like, or try the oscat.lib as it has many FBC for all types of functions.
Thanks