From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Catching events from web browser control

Does anyone know of a way for a javascript function in a webpage to link into a state machine in LabVIEW?  I have a Web Browser activex control on my front panel that hosts a simple HTML page with a button on it ... and when I click the button, it calls a javascript function.  But I'd like to update a Text Control on my front panel when I click that web page button.  Thought maybe if I could "catch" that event from the webpage I could direct a state machine case structure to update the Text Control.  

 

Any one have any ideas?  Or is this possible?

0 Kudos
Message 1 of 3
(2,817 Views)

Hi taft220,

 

I'm not sure if this will get you exactly what you want to do.  But you may want to explore using register events.  You can see some information on these here: 

 

http://zone.ni.com/reference/en-XX/help/371361E-01/lvcomm/reg_event_callback/

 

For an example on how to use the Register for Events node, you can see the 'Dynamically Register for Events.vi' example in example finder.  

 

I hope this helps!

 

 

Cole R.
National Instruments
Software Engineer
0 Kudos
Message 2 of 3
(2,786 Views)

The link provided above is worth looking at, but here is an example that should help. It provides added flexibility to callback events by having the callback VI fire a user event which then can be handled by your event structure. This way, you can manage all your events in your top level VI, rather than depending on the callback VIs to do any processing. All the callback VIs should do is fire a particular user event to be handled in your event structure. Let me know if you need more clarification. As for the button click, I'm not sure if one of the methods for the activex control corresponds to this. For my example, I just picked an arbitrary callback event to use to show how to handle them with this flexible method.

 

Edit: I did not take time to implement error handling or make clusters and enums typedefs etc. In your program you should take the time to do this.

Message 3 of 3
(2,779 Views)