10-28-2011 05:07 PM
hello all,
i would like to start and stop saving to file depending on input scenarios.
i would like to take a mean of the input value for say 5 seconds, compare it with the ranges, if found within the range, start saving the file.
i have the follwoing conditions:
1. when input is between 95-105, start saving to file.
2. when input is between 145-155, append the data to SAME file without stopping the code
3. when input is between 165--175, append the data to SAME file without stopping the code..
and so on... the input value range can be fixed/or should be re-configurable by the user.
1 more thing, i have a control over input, ex: if the input needs to be held steady to value -- 102, then i can maintain the input fairly constant near 102.
can anyone please tel me how can i acheive this task?
10-28-2011 06:56 PM
Sounds like a good candidate for a state machine.
Lynn
10-31-2011 07:54 AM
hmmm... any good examples???
10-31-2011 12:11 PM
Hello,
There is an example on the Example Finder called State Machine Test Sequencer that may help you to get started. You can locate this in your VI by going to Help -> Find Examples... And then enter State Machine Test Sequencer in the search box. In this example, a case structure is used to handle each "state". Each case also contains information about which case should be executed next. Hope this helps!
10-31-2011 01:54 PM
alrght, will try tat and let you guys know...
thanks