You can register for events the items contained within a cluster by doing this dynamically instead of adding all of the items manually. Follow these steps to dynamically register the items contained within a cluster:
1. Create a reference to the cluster by right-clicking on it and selecting
Create >> Reference.
2. Wire a property node to the reference and select the
Controls[] property to get an array with the reference to all of the items contained within the cluster.
3. Place the
Register For Events Function in the block diagram and wire the output of the previously created property node to the input of this function.
4. Select the event that you want to register for the items in the cluster.
5. Create an event structure within a while loop and wire the stop condition.
6. Right-click on the event structure and click on
Show Dynamic Event Terminals.
7. Wire the
event reg refnum out from the Register For Events Function to the
Event Dynamic Registration terminal.
8. Place an
Unregister For Events Function outside the while loop and wire the
Event Dynamic Registration output terminal of the event structure to it.
9. Right-click on the event structure and click on
Add Event Case...10. In the Edit Events Window go to the Event Sources panel and you should be able to find the dynamically registered event under the Dynamic section. Click on the registered action and then click on Add Event.
11. Configure the event case with the additional code required by your application.