|Creating an external event handler [message #1835142]
||Wed, 25 November 2020 14:46
| Noname Noname
Registered: October 2020
I'd like to create a simple handler that sends an external event to an FB when certain external conditions are met.
I've scoured the forums and found some previous posts of interest (1)(2).
The answer in (1) seems to present an outdated method of registering handlers. Handler registration seems to now be done by including a line in CMakeLists.txt, as indicated by the answer in (2).
I have looked at some existing handlers (FDSelectHandler, OPC UA remote and local handlers etc.), but there are still some parts of external event handlers I do not understand.
Is an instance of the handler created automatically if I register the handler type by adding the line to CMakeLists.txt? If so, where does this instance live and how do I access it?
If an instance is not created automatically, what is the preferred method of creating and accessing the handler instance? Does the FB spawn a thread which runs the handler? If I have multiple FBs using the same handler, how do I make the handler known to all the FBs?
If there are tutorials or forum posts regarding these questions that I've missed, I'd appreciate if you directed me to them.
Ninja edit: rephrased first sentence
[Updated on: Wed, 25 November 2020 14:48]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02319 seconds