LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger data recording to a text file for multiple channels for a certain voltage threshold?

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. 

0 Kudos
Message 1 of 25
(4,185 Views)

this logic might help you

 

 

 

Regards
Guru (CLA)
Message 2 of 25
(4,177 Views)
I cant seem to get it working.  Right now, all the data is being recorded to text file, rather than just those that fulfill the threshold requirements, and I cannot figure out why.
0 Kudos
Message 3 of 25
(4,168 Views)

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.

 

0 Kudos
Message 4 of 25
(4,160 Views)

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.

 

Faizah_compare.jpg

 

Regards,

0 Kudos
Message 5 of 25
(4,147 Views)

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

0 Kudos
Message 6 of 25
(4,136 Views)
I want the values from the point that that the deltaV begins to be 0.04 to the point that the deltaV stops being 0.04.  In other words, the values will get written to the text file as long as there is a deltaV of 0.04 from the previous data point. 
0 Kudos
Message 7 of 25
(4,134 Views)

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

 

 

1.png

Regards
Guru (CLA)
0 Kudos
Message 8 of 25
(4,125 Views)

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 

 

Unknown Parts.jpg 

0 Kudos
Message 9 of 25
(4,118 Views)

see attached:

 

Message Edited by Ray.R on 03-11-2010 10:30 AM
0 Kudos
Message 10 of 25
(4,114 Views)