09-12-2016 02:33 PM
Good day
I am looking to find a way to trigger a loop to write to a spread sheet.
I have a vi that records to a spread sheet based on a Boolean, but what I want to do in every time a value increases by say 15GPM and is stable for within +-10% for say 10 seconds to then trigger a start for the loop to record X readings.
If input increases by 15GPM and is stable for 10 seconds; then trigger record input
Any ideas will be much welcomed
Thank You
Jay
09-12-2016 03:13 PM
Please attach your VI. Do not attach a tiny picture of the VI, but rather the actual VI, itself. It saves us unnecessary eye-strain, plus we can edit and even run code, but it is hard to do that with pictures.
Bob Schor
09-12-2016 03:46 PM
In order to check for a stable value, use the PtByPt Stdev vi in the Signal Processing pallete. This can calculate a running standard dev and if the value is within a certain threshhold, write the value to a spreadsheet.
09-13-2016 06:49 AM
if you want to do it in simple, check for the input data and and start time once the new value/Value changes then monitor the value as well as the time, if value changes before reaching 10 sec then reinitialize the timer if the timer reaches 10 sec then trigger to write.
Time can be calculated by "current time - Start time"
09-13-2016 12:47 PM
Here is the VI that I am starting with.
So when input 1 reaches a value then writes to the file, then increment to the next value being say 10 gpm more than the first. this is to occur till an end point value is reached.
The issue is how to get the increment portion to work.
I think I have been looking at it so long I may have missed the obvious.
Thanks again
Jay
09-13-2016 12:48 PM
Here is the VI that I am starting with.
So when input 1 reaches a value then writes to the file, then increment to the next value being say 10 gpm more than the first. this is to occur till an end point value is reached.
The issue is how to get the increment portion to work.
I think I have been looking at it so long I may have missed the obvious.
Thanks again
Jay
09-13-2016 11:45 PM
First of all if you need to modify your recent post you can use modify option instead of posting twice.
When it comes to your code, Ensure you are using Proper Design Patterns and Coding standards.
Hope Your Requirment can be done with Two Loops which runs parrallely, one is to Acquire data and the other is to Write to spread sheet.
Avoid usage of Sequence structure unnecessarily.
You can use shift register to increment.
Which is the input value from your code to checl whether the difference in input is 10gpm in the code.