Some courses and learning paths on NI Learning Center may not appear on learner dashboards. Our team is actively investigating.

If you encounter access issues, please contact services@ni.com and include the learner’s name, email, service ID or EA number, and the list of required courses.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Where do I set OnPanelChanged variable?

Using DIADEM 2012 Trial

 

I need to run a sub procedure that will add units (oz-in) to one of my channels and then ultimately converts it to(Nm).  I got that working fine so I want to now have it run based on an event.  It looks like if I use OnPanelChanged I can set it to call this sub anytime I switch from Nav to View.  Where do I set the variable? 

0 Kudos
Message 1 of 2
(5,030 Views)

Hello Tweedy,

 

Here are the steps to reproduce:

 

-Create and save a script file containing:

 

Call AddUserCommandToEvent("onPanelChanged", "yourSub")

Sub yourSub(LastPanel, NewPanel)

End Sub

 

The Call AddUserCommandToEvent adds the myTest function as a callback when the onPanelChanged event occurs. The function needs to contain the two parameters for the LastPanel and NewPanel. You can call your sub within that sub or just make your sub the callback function however it would have to have only the LastPanel and NewPanel as parameter inputs.

 

-Navigate to Settings>>Options>>Extensions>>User Commands

-Add the script you created above

-Click Refresh and the script should be loaded

Ian M.
National Instruments
0 Kudos
Message 2 of 2
(5,016 Views)