03-09-2010 10:16 PM
I am working with 6 channels, from each of which I am obtaining voltage values ranging from 0.6-6 V. I am using the DAQ Assistant to acquire and write the data to a text file. However, I only want the data to be written to the text file when the difference in voltage (DeltaV) from one data point to another is greater than or equal to 0.04 V. I am acquiring the data at a sampling rate of 64 Hz. Any ideas on how to accomplish this? I have attached my current VI.
03-10-2010 01:03 AM
this logic might help you
03-10-2010 06:59 AM
03-10-2010 07:38 AM
Faizah wrote:I am obtaining voltage values ranging from 0.6-6 V.
I only want the data to be written to the text file when the difference in voltage (DeltaV) from one data point to another is greater than or equal to 0.04 V.
Your code does not do what you describe above..
I just want to make sure I understand your request...
Let's say you have the following signal:
0.00
0.01
0.00
0.03
0.02
0.01
0.03
0.04
0.07
0.05
0.08
0.03 < delta greater than 0.04, so start recording
0.11
0.21
0.45
0.93
2.87
5.85
5.86 < delta less than 0.04, so stop recording
5.87
5.89
6.00 < delta greater than 0.04, so start recording
5.85
5.86 < delta less than 0.04, so stop recording
etc..
Is the above what you are describing?
Right now, your code does this:
0.00
0.01
0.00
0.03
0.02
0.01
0.03
0.04
0.07
0.05
0.08
0.03
0.11
0.21
0.45
0.93
2.87 < threshold greater than 1 so reset timer
5.85 < threshold greater than 1 so reset timer
5.86 < threshold greater than 1 so reset timer
5.87 < threshold greater than 1 so reset timer
5.89 < threshold greater than 1 so reset timer
6.00 < threshold greater than 1 so reset timer
5.85 < threshold greater than 1 so reset timer
5.86 < threshold greater than 1 so reset timer
4.35 < threshold greater than 1 so reset timer
2.21 < threshold greater than 1 so reset timer
1.09 < threshold greater than 1 so reset timer
0.98
However, you did not provide a set start time to the Elapse Time (I never use Express VI's so I'm not sure what will happen..) However, something does not appear correct with the logic. I'd have to check.
03-10-2010 05:27 PM
Hello Faizah,
Ray is correct that your code logic doesn't follow the task that you described. Take a look at the attached image which compares the last value to the current value, and if it is greater than a specified threshold then the value is written to file. Let me know if you have any questions.
Regards,
03-10-2010 06:43 PM
Hi Brandon,
Your code example looks good. There are a few things that are not clear in the description way above. One such description is what gets written to file. Does the person want the value that crosses the threshold, all values when the delta is greater than 0.04, all values when triggered by the delta, all values if delta is reached, and the list probably goes on.
RayR
03-10-2010 07:09 PM
03-10-2010 11:53 PM
I had forgottent to attach the snippet yesterday(and got a kudo for that:)) ...here yu go. I guess this might be useful to you
03-11-2010 09:00 AM
Brandon,
Thank you so much for the help that you posted earlier. I am trying to build what you have, but there are a few parts that I have never used, and I dont know what they are. I am attaching a picture with the parts circled, and I would really appreciate it if you could help me out. Thanks!
-Faizah
03-11-2010 09:30 AM - edited 03-11-2010 09:30 AM
see attached: