LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Force Events

I have an application where I need to save and restore the front panel to and from a .INI file. I am using the "Read Panel From INI" and "Write Panel From INI" functions I got from the OpenG Toolkit to save & restore my panel settings.  I am able to read the settings and have the panel change to the new values contained in the .ini file but this does not cause a Value Change Event for each of the controls to occur.  I have a lot of controls that I am loading values for (80+) and would like to have all the controls that get changed force a Value Change Event so that the underlying hardware gets updated (each control value change calls an external dll to do this).  The OpenG Toolkit functions are using the Control Value:Set and Get Method to change the panel settings which does not cause an event to occur.  Since I have the source code I could modify these functions if need be. 

Any suggestions/help/better ways to do this would be greatly appreciated.


Dan
0 Kudos
Message 1 of 12
(4,344 Views)

Dan,

If you have the source code, you can change the value assignment to assign to the "Value (Signaling)" property.  This will fire an event.

-cb

0 Kudos
Message 2 of 12
(4,339 Views)
Thanks for the response - I've included the source code for the Read Panel From INI VI.  As you can see in the block diagram the VI is using the Control Value:Set [Flat] Method to set the control and passing it the Control Name. It does this in a loop passing it all the Control Names for the panel.  How can I do this using this refrences instead of doing a discrete value[signaling] for each of the named controls?
0 Kudos
Message 3 of 12
(4,327 Views)
rt_dan,
 
I think you will have to iterate through the Controls collection of the front panel.  For each control, you can then use the Value property to set the Value (Signaling) property if it is a control you want to signal.  You can sort out the controls by using the label.  (See attachment).
 
-cb
0 Kudos
Message 4 of 12
(4,317 Views)
 You
0 Kudos
Message 5 of 12
(4,301 Views)
 You may
0 Kudos
Message 6 of 12
(4,300 Views)
oops.
 
You may even be able to just use the Value (Signaling) property directly with your variant data in the loop and skip your code that does the assignment first.
 
-cb
0 Kudos
Message 7 of 12
(4,298 Views)
Thanks!  I'll give this a try.


Dan
0 Kudos
Message 8 of 12
(4,296 Views)
Worked perfectly!


Thanks,


Dan
0 Kudos
Message 9 of 12
(4,288 Views)
I've been using the method mentioned by 10Degree above (see Iterate Front Panel Controls.png) to force a signaling event for all my controls just after reading them from a .INI file.  This works great as long as all my controls are all on the front panel.  If I take a few of my controls and put them on various pages of a Tab Control the signaling fails to work any longer for these controls.  Is it because the Tab Control pages are treated like a sub-VI?  Anyone have any suggestions for a work around?


Thx
0 Kudos
Message 10 of 12
(4,137 Views)