03-22-2022 02:51 PM
I am trying to create something like a summary file for an experimental setup. The experiment is testing the turbidity tolerance of a fish that can freely swim between two tanks with varying levels of turbidity depending on the presence and absence of the fish in the tank. When the fish has been in one of the tanks for 5 min without moving to the other tank, I want several variables/data points to be saved before the turbidity levels in that tank increase. So each time the fish has spent 5 minutes in one of the 2 tanks I want to save only one data point (one row of data) of a couple of variables (my columns) into a text file. The amount of variables (columns) is always the same and they come from turbidity probes I am reading a voltage from and from some boolean conditions that tell me which tank the fish is in.
I have attached a simplified VI I have slightly modified from another post (https://forums.ni.com/t5/LabVIEW/Limiting-data-collected-from-a-loop/m-p/4218076#M1223128) and this is as far as I have been able to get.
Solved! Go to Solution.
03-22-2022 03:09 PM
Looks like you are writing to the text file every 100 mSec, regardless of conditions.
That seems nothing like what you describe you want.
If you only want to write a line when the conditions are true, then put your WRITE FILE operations in a CASE structure that detects the conditions you want.
If conditions are not right, then don't write the file.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
03-22-2022 03:30 PM - edited 03-22-2022 03:30 PM
Since we don't have any fish to observe, lets assume we simply want to write to the file every 5 minutes.
Some comments: