02-21-2012 04:09 PM
I have the attached vi working as I need. The final piece I need is to save data to a measurement file. The only thing not happening with it now is getting a timestamp in the file for each element of the array. Any help would be appreciated. Thanks.
02-22-2012 07:41 AM
could you post a png of the vi as i cant view it as its saved in a later version.
but in programming -> timing. there is get time in seconds and then you could convert to julian (normal) format and add it to a cluster
hope it helps, will try to give a more informed answer once ive seen the vi
TD
02-22-2012 08:20 AM
The easy answer is that you can add another element to the top of your build array on the right of the while loop and wire the DBL representation of your timestamps to it. This will give you a timestamp in seconds from midnight, January 1, 1904. If you want a relative timestamp, you can subtract the start time of the experiment from it.
However, there are a few issues with your VI.
Good luck. Let us know if you have more issues.
02-22-2012 08:22 AM
All you have is an array of values. There are no timestamps. You are building an array of timestamps for the graph, but you are not using them for the data you are collecting, so I don't know what you are asking.
Your VI is confusing, and it does not match what you say in the comment at the bottom. The comment states: "This vi is designed to monitor a Digital Input in a while loop and run continuosly until a 1 occurs once. The array sum is used to detect a 1. " The VI doesn't do that. It keeps looping until you press the button on the front panel or an error occurs. There is also no "array summation" anywhere.
Parts of your VI can be simplified:
02-28-2012 07:51 AM
Thanks for the help. I took your advice I think and fixed issues 1, 2, and 4. Could you help me out with #3. I wasn't quite sure what you meant. Thanks.
02-29-2012 07:51 AM
When you configure your acquisition, you tell the hardware to collect ten points. When you fetch the data, you fetch one point. This is OK if this is what you want to do, but I suspect it is not. Unless you are doing continuous acquisition, your buffer size is usually the same as your fetch size.