SetEvent/SetExtEvent aren't global functions but instance methods of OpconUnit. That's why they can only be called in the context of Control plus model tree objects. Apart from that, the methods are also available in sequences deriving from OpconBaseChain, but only because the chains are always owned by an OpconUnit which is used internally for setting the events.
The main reason why the methods need the OpconUnit context is that every Control plus event has a source object (i.e. an instance ID) telling exactly who created the event.
You could pass a reference to an OpconUnit into another FB allowing it to call SetEvent on the Unit. But that means the FB is no longer independent from the Control plus infrastructure.
The more common solution would be to pass a result value with an error code from the FB to the calling OpconUnit (e.g. ModeHandler) and doing all the event handling there.
... View more