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.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Handler Not Detecting Value Change through Reference

Solved!
Go to solution

I'm working on an actor framework application, but am having an issue with detecting a value change in my event handler.  Essentially I have two actors TorqueView which inherits from ParameterView.  In my TorqueView Actor Core override I write an exit control reference to the object's private data, because I want it to trigger an event in my ParameterView Actor Core override.  I then have the ParameterView event handler register for value changes of the exit control.  However, when I click the exit button on the TorqueView.Actor Core front panel, the event doesn't get triggered.  When I turn on trace execution in my ParameterView Actor Core however, it detects the user inputted value changes, but with trace execution turned off, it doesn't detect the value changes.  Help!TorqueView.Actor Core()TorqueView.Actor Core()ParameterView.Actor Core()ParameterView.Actor Core()

 

0 Kudos
Message 1 of 11
(4,783 Views)

I added a small delay in the TorqueView.Actor Core() and it now works so if anyone can tell me why that works, i'd love to hear!

0 Kudos
Message 2 of 11
(4,777 Views)
Solution
Accepted by topic author LabViewLuvr

I would suspect that you are registering for the Value Change event before the Front Panel is loaded, and thus not work.  Delaying the registration causes it to happen after the FP is loaded.  You should make sure it is loaded before you register, by opening the Front Panel before registering.  Here is one way to do that:

Open FP before Event Registration.png

Message 3 of 11
(4,767 Views)

Just to make sure I understand correct, is that code supposed to be at the front of my ParameterView Actor Core?

0 Kudos
Message 4 of 11
(4,758 Views)

I tried putting this code into the being of my parameterView Actor Core and it didn't fix the issue.

0 Kudos
Message 5 of 11
(4,751 Views)

Did you make sure the FP load code is executed before the Dynamic-Event Registration node?  Ordering needs to be enforced to make sure one happens before the other, such as by dataflow.   Also, are you displaying any error produced by the Registration node?

0 Kudos
Message 6 of 11
(4,730 Views)

Thank you so much for all the help.  I entered the code into the program as shown below, and I am getting a 1001 error from the dynamic registration terminal.image.png

0 Kudos
Message 7 of 11
(4,720 Views)

Strange, 1001 is “the front panel is not open”, but you appear to be opening it.

0 Kudos
Message 8 of 11
(4,715 Views)

Hi, so I'm sorry I misinterpreted what you said at first.  The screenshot I showed you is a vi that doesn't have the actual control on its front page, but this vi's event handler responds to the vi.  I placed the code snippet in the vi that does have the control on its front panel and I didn't get the error!

 

The problem now is the vi I opened, I'm trying to load into a subpanel, and it won't display in the subpanel.  Is there an alternative way to ensure the front panel is loaded?

0 Kudos
Message 9 of 11
(4,712 Views)
Solution
Accepted by topic author LabViewLuvr

@LabViewLuvr wrote:

The problem now is the vi I opened, I'm trying to load into a subpanel, and it won't display in the subpanel.  Is there an alternative way to ensure the front panel is loaded?


You just need to call the "Close FP" method on the VI before Inserting it into the subpanel (ignore the error-out of the Close method, as it gives an error if it is already closed).   It's OK to close a VI, as you only need to open it in order to load the FP (it doesn't unload when you close it).

Close FP before Insert.png

Message 10 of 11
(4,701 Views)