10-19-2009 10:44 AM
Hi, I am having some trouble with references. The LabVIEW Wiki reads that control references (http://labviewwiki.org/Control_References) are the proper way to pass UI elements into subVIs. So that is the route I took.
I have this UI ActionEngine (see attached) that I want to handle specific tasks. One task is to add system messages to a simple text field that resides on the UI. I want to use this same UI ActionEngine in several subVIs to add messages to the same text field. So what I tried to do was to have an initialization operation for the UI AE that saves a reference to the text field in a shift register. This did not work. Every time I have to call UI AE to add system messages in any of the subVIs I have to pass in the reference again. This defeats the purpose of using a shift register, because I still have to wire the reference into every single subVI that uses the AE, when in reality I only want to do it in the initialization part.
My guess is that the reference somehow gets released. How would I solve this though?
Solved! Go to Solution.
10-19-2009 10:54 AM
You have the reference input wired to the shift register. It gets reset to the wired value every time the AE is called. You should put the reference control in the 'initialize' case and leave the input to the SR unwired (for an uninitialized shift register).
10-19-2009 12:13 PM
You are absolutely correct. I could have sworn I already tried that, because I had seen it before. I confused it with a while loop where the wiring to the shift register only initializes it the first time. Thanks jack!