12-21-2011 10:43 AM
I am describing the functionality that I am trying to achieve via the attached VI.
I am having following problems with the execution of the VI:
I would really appreciate if you would tell me how to fix these bugs with the VI. I would really appreciate your help.
Have a happy holiday season.
Thanks,
Dinesh
12-21-2011 01:53 PM
Dinesh,
I gave up on trying to figure out your VI. The diagram takes mutiple screens. Wires run all over the place including behind nodes where you cannot tell whether they are connected. You have duplicated code, code which does nothing (outputs not connected), code constructs which are probably eligible for the Rube Goldberg page, and others.
Your sequence structure could be eliminated by simply wiring error cluster wires in a few places. A state machine architecture would be better.
You repeatedly open and close the .dat file. This might contribute to your problem.
You do not check the errors from the .dat file VIs. They might help you figure out what is going on.
You did not save any data with the VI, so we cannot see what is happening with your averaging.
Lynn
12-21-2011 08:01 PM
Lynn, he may actually not be to blame for the diagram size. It does not change if you "clean" it, which leads me to believe that this is what he did. But a very entertaining diagram it is. A true case study 🙂
Now, the strange thing is that stuff like this remains in it:
As Lynn said, the reason why the file is updated only once is that there must be an error after the first acquisition completes. The only way to figure out which one it is (in order to avoid or correct it) is to debug your code in situ (using a probe on the error wires). It might be because you try to restart your acquisition within the loop (you probably should stop it first if you really want to restart it anyhow). I would put the start out of the while loop and try this way. The error might occur elsewhere though or for another reason...
Since you recreate your dat file at each iteration, the second giving you nothing because of an (unknown) error, will essentially erase your first successful iteration.
I don't understand the truncation statement.