Hi everyone,
I am using labview 7.1 to write a program which would need some expert help. It starts off with a very simple logic but got expanded to a very complicated situation (as least to me). And I am sorry about the length of this message due to the complexity of the situation.
Here is some details about my program.
My program consists of two major parts. The main program is a stand alone program, which can run on its own, and it performs a series of procedures. This program lasts for about an hour. During my experiment, I also need to record all the temperature and pressure in my system, probably every 2-3 seconds, therefore, I also have another program that consists of a big while loop to measure and save all the data. I got the combine program to work by simply putting my main program VI outside of my measurement loop.
Now, I want to improve my program in order to embed it to my field point controller. To fit my purpose, this improved version should be able to
1. stay in my controller memory practically forever (unless I physically stop and remove it).
2. this program should also has the ability to stop by a user via a toggle button (without termination of the program) and start the experiment (from the beginning of the experiment) via a toggle button.
I had an idea of putting all my existing program within a big loop that runs forever, but this creates some practical problems when I actually run it. Since the real program is too big, so I include a simplify version here in the attachment, and below is a brief summary of what I was intended to do. Hope somebody would be able to help me solve this program.
1. The while loop B resembles my data recording loop. It refreshes every 2-3 second to read the measurements, and then save them to a text file. This should last forever unless the user stops it. Within this measurement loop B, I have a case structure (structure C), which should only be run ONCE everytime when loop B starts (to create the file name and header information for my data file).
2. The rectangle represent my main program, and it comes with all the complexity. This main program lasts for an hour. And I need it to be actuvated TOGETHER with the measurement loop (loop B).
If I were to put the main program within loop B, loop B does not loop any more because it has to wait until my main program finishes. But when my main program finishes, loop B does not resume and was stuck. If I were to put my main program outside of loop B, the main program won't starts because loop B has not finish. I tried to use local variable and didn't get much luck.
Can I really do what I want to do? Does anyone has a good suggestion for me?? Is it my logic of thinking has a problem? Many thanks in advance.
tak