LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to file

Solved!
Go to solution

I am taking eight analog input measurements and would like to log the data. Sounds simple but I have tried to log the data using the write to measurement option but the file is huge, and it's also logging way more data than I need. The sample rate is 1K and samples to read is 1K (default settings). The results is one sample logged in the file every 1/10th of a second. I am just interested in logging 1 sample every 60 seconds.

 

 

0 Kudos
Message 1 of 25
(6,024 Views)

Hi,


Can you post your code. You may use the array size function and check for the number of samples, then if the size is a multiple of your required size, write it to the spread sheet by using a case structure. I can explain it better if i see your code.


Regards,

Nitzz

(Give Kudos to good Answers, Mark it as a Solution if your problem is Solved:smileywink:)  

0 Kudos
Message 2 of 25
(6,017 Views)

I have attached a copy of the block diagram. I hope this helps.

0 Kudos
Message 3 of 25
(5,993 Views)
Solution
Accepted by topic author pistonbones

First, your math is wrong. With 1000 S/sec and 1000 samples, you will have results in the for every .001 sec.

 

Second, you are wiring an array of 1000 samples to a scalar. Dynamic data allows that but why? It would make more sense to take the mean of each channel and wire that to the indicator.

 

Third, you can simply use the Elapsed Time function set for a 60 second timeout. Wire the Time Has Elapsed Boolean output to a case statement. Inside the True case, place the write function where you pass the mean of all channels.

Message 4 of 25
(5,982 Views)

 


 Third, you can simply use the Elapsed Time function set for a 60 second timeout. Wire the Time Has Elapsed Boolean output to a case statement. Inside the True case, place the write function where you pass the mean of all channels.


I did not change the dynamic data to a mean before displaying, however I have attempted to log minute data following your recommendation. Please have a look at the code and see if this is what it should look like. I may be missing something because the data is not logging every 60 seconds.

0 Kudos
Message 5 of 25
(5,960 Views)

Do you have the Express VI set to automatically reset the timer?

Message 6 of 25
(5,955 Views)

Ravens Fan,

I do not have the vi set to reset the timer. At least I don't think so..That I mean is besides what you see on the block diagram the only question the timer wizard asked ( at least that's what I remember) is the value for the delay. It must be simple to set the reset, right?

0 Kudos
Message 7 of 25
(5,952 Views)

In the dialog box is a setting to allow the timer to reset itself.  Make sure that is checked.  Alternately, wire a True boolean constant into the input that says Auto-Reset

0 Kudos
Message 8 of 25
(5,945 Views)

In cases like this, it's so much better to post the actual VI or a snippet. These Express VIs hide so much code and we have to resort to guessing.

0 Kudos
Message 9 of 25
(5,940 Views)

Thank You Dennis for the help, in addition thanks to all who contributed to the solution. After converting the data to a mean and then input the signal to the write file (as you suggested). I was able to get one sample to write every one minute. I also wired the Boolean True constant to the Reset which took care of the elapsed timer issue.

Also thanks for correcting me on my math and other mistakes.

Thanks again!Smiley Very Happy

 


@Dennis Knutson wrote:

First, your math is wrong. With 1000 S/sec and 1000 samples, you will have results in the for every .001 sec.

 

Second, you are wiring an array of 1000 samples to a scalar. Dynamic data allows that but why? It would make more sense to take the mean of each channel and wire that to the indicator.

 

Third, you can simply use the Elapsed Time function set for a 60 second timeout. Wire the Time Has Elapsed Boolean output to a case statement. Inside the True case, place the write function where you pass the mean of all channels.


 

0 Kudos
Message 10 of 25
(5,915 Views)