08-31-2018 03:49 PM
I am trying to limit the amount of entries that are written to a text file in my code. It currently writes 12-13 entries per second. I would like to limit that to an entry every second or even better 3 seconds.
Any ideas on a good way to do this?
Solved! Go to Solution.
08-31-2018 04:24 PM
Without seeing any code it is difficult to see what you are currently doing. However, what you need is a parallel task which will handle your data logging which is separate from whatever is reading/generating the data. The logging task (the parallel loop used to actually write the data to the file) will be timed to only write data every 1 second (or whatever period you want). Since you didn't mention how you wanted to handle the data it is again difficult to say how you handle it in the logging loop. You didn't say if you wanted to write all of the data that was collected but write it at a slower frequency or if you are only interested in the data point at that time period. You would generally use a queue or notifier to send the data from your loop which is reading/generating the data and the loop that is logging it.
09-01-2018 06:33 AM
@Nack wrote:
I am trying to limit the amount of entries that are written to a text file in my code. It currently writes 12-13 entries per second. I would like to limit that to an entry every second or even better 3 seconds.
Without a better explanation of what you are attempting, and without seeing your code (the actual VI, not a picture of it), it is difficult to provide help. I can think of several ways such a problem could arise, each with a different sort of answer, including:
What do you really want to do? And, for curiosity, why (meaning why slow things down)?
Bob Schor