Welcome to the 9th tutorial on our series Mastering Forge.
In our previous article, Mastering Forge #8, we explored how to use reverse connections in Forge.
In this article, we will focus on Forge’s Event Generator Module. Event Generator is useful for enabling event-based communication when your data source doesn’t provide or even support events. You’ll learn to create reusable event templates and configure event generators to attach new events to objects.
If you prefer your tutorials in video format, you can watch our video tutorial on configuring event generators on YouTube.
During this tutorial, we’ll be using the following products:
- Prosys OPC UA Forge
- You can download an evaluation version through the request form.
- Prosys OPC UA Server
- You can download the free version through the product’s request form.
- Prosys OPC UA Browser
- You can download the free version through the product’s request form.
Create Event Templates and Generators
To follow this tutorial, in Forge’s address space, create an object node and add a variable node for the object node. Then, map the variable to Prosys OPC UA Simulation Server’s Sinusoid variable. In this example, I created a WaterTank object node with a WaterLevel variable.
1. From the Dashboard, start the Event Generator Module.
![1-start-event-generator-module - Prosys OPC - Prosys OPC Starting Event Generator Module](https://prosysopc.com/wp-content/uploads/1-start-event-generator-module.webp)
2. Navigate to Event Generator > Templates and press Add Template.
![2-add-event-template - Prosys OPC - Prosys OPC Adding Event Template](https://prosysopc.com/wp-content/uploads/2-add-event-template.webp)
3. Here, you will create an event template that defines how the event is presented.
- Start by giving the template a name.
- Next, from the + icon, add two Event Property templates.
- Fill in their Event Property and Template according to the figure below. Last, press Add.
![3-event-template-configuration - Prosys OPC - Prosys OPC](https://prosysopc.com/wp-content/uploads/3-event-template-configuration.webp)
4. Navigate to Generators and press + Add generator.
![4-add-event-generator - Prosys OPC - Prosys OPC Adding Event Generator](https://prosysopc.com/wp-content/uploads/4-add-event-generator.webp)
5. Generators define the object the event relates to and how it is triggered.
- First, give the generator a name.
- Then, select an object node that will be the source for the event and the Template we created previously.
- In the Template Variables, select the mapped variable (WaterLevel) to value.
- For the Generation Triggers, choose the same variable as a trigger with the settings shown below. For Trigger conditions, use High Limit with 1.5 as Comparison value. This triggers the event only once after exceeding the 1.5 threshold. Finally, press Add.
![5-configure-event-generator - Prosys OPC - Prosys OPC](https://prosysopc.com/wp-content/uploads/5-configure-event-generator-2.webp)
6. Open Prosys OPC UA Browser and connect it to Forge. In the Objects folder, right-click the object for which you defined the event and select Monitor Events. The event should now appear once the variable’s value exceeds 1.5.
![6-event-from-browser - Prosys OPC - Prosys OPC Monitoring Events from Prosys OPC UA Browser](https://prosysopc.com/wp-content/uploads/6-event-from-browser.webp)
Next Steps
This wraps up the 9th article of the Mastering Forge series. Here’s a recap of what we did in this tutorial:
- Started the Event Generator Module and created an Event Template.
- Configured an Event Generator that attaches the event to an object and defines its triggers.
- Used Prosys OPC UA Browser to monitor the object’s events.
In the next article, we will work with Forge’s OPC UA Publisher and Subscriber modules used for OPC UA’s PubSub communication.
If you want to learn more about Forge and its capabilities, you can request a detailed introduction by emailing sales@prosysopc.com or using our contact form. We’d be delighted to provide tailored information about Forge that aligns with your interests and requirements.
Author Info
![ProsysOPC-support-Iivo-yrjola - Prosys OPC - Prosys OPC A headshot of Iivo Yrjölä](https://prosysopc.com/wp-content/uploads/ProsysOPC-support-Iivo-yrjola.webp)
Iivo Yrjölä
Customer Integration & Support, Prosys OPC
Email: iivo.yrjola@prosysopc.com