09-18-2017 03:03 PM - edited 09-18-2017 03:05 PM
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()
ParameterView.Actor Core()
Solved! Go to Solution.
09-18-2017 03:18 PM
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!
09-18-2017 04:31 PM - edited 09-18-2017 04:40 PM
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:
09-18-2017 05:01 PM - edited 09-18-2017 05:23 PM
Just to make sure I understand correct, is that code supposed to be at the front of my ParameterView Actor Core?
09-18-2017 05:28 PM
I tried putting this code into the being of my parameterView Actor Core and it didn't fix the issue.
09-19-2017 03:05 AM
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?
09-19-2017 03:40 PM
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.
09-19-2017 05:37 PM
Strange, 1001 is “the front panel is not open”, but you appear to be opening it.
09-19-2017 06:24 PM
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?
09-20-2017 03:11 AM - edited 09-20-2017 03:44 AM
@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).