Use the following diagram as a base to complete the procedure:
1. Use the
Create User Event Function to create the Custom Event, this and other event VIs are located in the
Dialog & User Interface>>Events Pallete. Notice how the input for this event is a cluster, the data type and label of the elements define the data type and name of the user event. LabVIEW uses
owned labels to identify data the user event carries, you should name each element of the input with a descriptive owned label. If you do not add a label, the user event will not appear in the Event Data Node of an
Event structure when added.
2. Place a
Register For Events Node and connect the event created in step 1, this node will create an event registration refnum for the custom event that will be used later in the event structure.
3. Place an
Active X container in the front panel, this and other Active X components are located in the
.NET & Active X Pallete. Once you add the control, right-click on it and select
Insert Active X Object, select the required object and then click on
OK, for this example we will select the
Microsoft Web Browser Object.

4. Place
Register Event Callback node and connect the Active X control created in the last step to the Event Source Terminal. Click on the dropdown menu and select the Event, for this example select the
Title Change Event. Pass a cluster of bot the custom event refnum created in the step 1 and a reference for a string (Web Page Title) to the User Parameter terminal, and use the bundle function to form a cluster of the last 2 mentioned components. Both the reference and the event refnum will be used inside the Calllback VI that will be created in the next step.
5. To create the Callback VI, right-click in
VI Ref and select
Create Callback VI
This option will automatically create a Callback VI, from there you will be able to access the User Parameters. Double-click on the created VI to open it. and create the following VI, after completing the diagram save the VI:
a. Use a Unbundle By Name function to access both the event refnum cluster and the Web Page Title reference.
b. Use another Unbundle By Name function to access the Text from the Event Data cluster, this is the data returned by the Title Change Event selected in step 4. The text will contain the name of the web page.
c. Use a Property node with the Web Page Title reference as the input, select the Value property in write mode and pass the text as the input. This property node will write the value to the Web Page Title indicator we have in the main front panel.
d. Use a
Generate User Event function to create an event that will trigger the Event structure in the main VI.
6. Create a while loop with an event structure inside. To register programmatic events such as the custom event we created in the last steps, right click on the structure and select Show Dynamic Event Terminals
Once the structure is created create the following 3 events with the respective block diagram,
- <Custom Event>: User event:
This event will demonstrate the custom event we created in step 1 and generated in step 5 is triggering the event structure. For this example, you can use a Led to demonstrate the execution, in another application you can adjust this event according to your requirements.
Use this event to stop the loop.
- "Web Page URL": Value Change
This is the secondary Active X event mentioned in the first section of the article. It uses the Navigate2 method to Navigate to the specific URL. Use the Web Browser container created in step 3 as the input.