01-24-2011 10:46 AM
Hello,
I'm stuck.....I am having some trouble figuring out how to make my attached VI behave as needed. The top level VI "EventStructure.vi" is a front panel UI interface to a label printing app (using ActiveX). When the VI is loaded it sits in the internal while loop until either the Print or Exit front panel buttons are pressed. If the "Select Product" drop down has a value change I would like it to go out to the particular label file for that product and read a Serial Number variable from the label file and report back the serial number to the front panel. I would like to have the VI front panel hold that serial number until there is another value change on "Select Product" but right now it only holds it on the front panel until the next time through the while loop. Also, the string containing the path to the label file only holds in memory until the next time through the while loop where it is cleared. Is there any way to have these values hold in memory and only change when there is a value change on the "Select Product" combo box? I do understand that this behavior is the general way Event Structures work but I am unable to figure out a better way to do this without using an Event Structure. The sub-vi "GetNextSerialNumber" calls an external application using ActiveX and it takes a while (4-5 seconds) for that application to load and process the ActiveX commands so I only want to call the external application when there is a value change on the "Select Product" combo box.
Solved! Go to Solution.
01-24-2011 11:00 AM
You need to store any values you want to retain in shift registers. This will allow you to pass the value from one iteration of the loop to the next.
01-24-2011 03:40 PM
Thanks Mark!.... OK I feel stupid now....I don't know why shift registers didn't 'register' as a fix to me for this problem originally. I was looking too far into the code and was thinking more complex than it actually is. Kudos!