03-21-2009 09:35 PM
03-22-2009 12:55 AM
Two important things.
1. You need to wire the arrays you are maintaining on the shift registers through each any every event case or case of a case structure. In your code, there are events where the array is unwired and the output tunnel of those cases is set to "Use default if unwired". What happens if that case runs? The array becomes its default which is an empty array.
2. Don't put two event structures in the same while loop. You should actually be able to get by with one event structure such as in Dennis' example. Why doesn't yours work? In order for an iteration of the loop to complete, all code inside of it must complete. That means an event has to be fired on both event structures. If you only hit the submit button in one, the other event structure is still waiting for an event to happen to it.
03-22-2009 12:49 PM
03-22-2009 01:03 PM
Okay, so for some obscure reason, you decided to remove the event structure and use polling. While this is really bad style if you have the full version of LabVIEW, it works though you really should have a Wait(ms) in your loop. Silly to spin the loop that fast. The use of the local variables to initialize the loop does not make much sense either.
What else do you need? As I mentioned in my first post, it would be nice if you cleared the controls after the submit button was clicked and it would be nice to have some logic to prevent blank fields being entered. You mentioned difficulty saving the array values but you have not written any code to do that. Where do you want to save them? Text file, database, what?
03-22-2009 06:42 PM
03-22-2009 06:46 PM
03-22-2009 06:53 PM
03-22-2009 09:12 PM
03-22-2009 09:13 PM
03-22-2009 09:26 PM
Harold Timmis wrote:
so I can not save this data within my application because that is a major part of this application.
No. That would not be a good idea. It would be like Microsoft Word saving your last document by modifying its .exe file so that your data would be there the next time you open word.
Your program needs 3 major steps.
1. Look for your data save file. If it exists read the data from the file and put it in your shift register. If it doesn't exist, leave the shift register empty.
2. Your main part of your program like you have now.
3. When you want the program to end, save the data in your shift register to your data save file.
Look in the example finder for numerous examples on file I/O.