LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with number of samples and huge output file size

Solved!
Go to solution

I am using the enclosed VI for thermocouple measurement with the strain gauge module (NI 9237). The normal DAQ assistance does not work over a long period of time due to buffer size error(Error -200279). So I am using daqmx instead of daq assistance.
I am having a problem when I decrease the "number of samples per channel" (please see enclosed VI) from 100 to a lower value and the program reset the values. However, when I use 100 or more, it works ok. The reason I want to use lower values is that I am having 20 thermocouples and given the number of samples the output file Huge. Would you please check and advise which part of the program has a problem and how can I reduce the number of samples and output file size?

Thanks in advance for your kind help.

0 Kudos
Message 1 of 8
(3,119 Views)

Hi Sinarez,

 


@Sinarez wrote:

I am using the enclosed VI for thermocouple measurement with the strain gauge module (NI 9237).
I am having a problem when I decrease the "number of samples per channel" (please see enclosed VI) from 100 to a lower value and the program reset the values. However, when I use 100 or more, it works ok. The reason I want to use lower values is that I am having 20 thermocouples and given the number of samples the output file Huge.


You set a sample rate of just 1 S/s, even for ~30 channels the resulting file will NOT be "huge" (with about 18kB per minute)…

 

Are you sure about that "100 samples per channel" read requests when you set such a low sample rate? It would take 100s to read 100 samples, far more then the usual read timeout of just 10s!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,108 Views)

Hi GerdW,

 

Thanks for your quick reply. 

Number of samples per channel is 100 and sampling rate is 1. Maybe I am using the while loop wrongly. The file size becomes 10 MB in just a minute when I just use 8 thermocouples. I am really not sure where I am making a mistake. Would you please take a look at the VI and see where I am making a mistake? Thanks again.

 

Best regards,

Sina

 

 

0 Kudos
Message 3 of 8
(3,090 Views)

Hi Sinarez,

 


@Sinarez wrote:

Number of samples per channel is 100 and sampling rate is 1. Maybe I am using the while loop wrongly. The file size becomes 10 MB in just a minute when I just use 8 thermocouples. I am really not sure where I am making a mistake.


Simple solution to this problem: the mistake is you didn't read the manual/datasheet of the NI9237 module.

Read it - especially the specs on the supported sample rates!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(3,060 Views)

My problem is getting a huge file. I can see the sampling rate for Ni9237 is 50 kS/s/ch. 

I appreciate your reply, however, it is not helpful. If I knew how to solve the problem by just knowing the sample rate I wouldn't have asked the question here.

I would really appreciate if someone could suggest the problem in the code.

 

Regards,

Sina

0 Kudos
Message 5 of 8
(3,039 Views)
Solution
Accepted by topic author Sinarez

Hi Sinarez,

 

I told you to read up the support range of sample rates!

 


@Sinarez wrote:

I appreciate your reply, however, it is not helpful. If I knew how to solve the problem by just knowing the sample rate I wouldn't have asked the question here.


That answer hints the source of your problem, so it should be helpful…

The NI9237 supports 50kS/s down to 1.6kS/s. You are requesting just 1S/s - but you still get 1.6kS/s. Now you wonder about "huge" files, but still you don't read about the support sample rate range!

 

Solution:

- set a sample rate of 2.5 kS/s

- read 2500 samples (resulting in a read operation each 1 s)

- get the average of those 2500 samples (resulting in 1 sample per second) and use it as intended…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(3,032 Views)
Solution
Accepted by topic author Sinarez

@Sinarez wrote:

My problem is getting a huge file. I can see the sampling rate for Ni9237 is 50 kS/s/ch. 

I appreciate your reply, however, it is not helpful. If I knew how to solve the problem by just knowing the sample rate I wouldn't have asked the question here.


No, read the data sheet more carefully.  Specifically, read page 8.  "When using the internal master timebase of 12.8 MHz, the result is data rates of 50 kS/s, 25 kS/s, 16.667 kS/s, and so on down to 1.613 kS/s."  So the minimum sample rate is 1.613kS/s.  So what I would recommend is sample at that low rate and read 1613 samples (1s of data).  You can do whatever you want with data from just keeping the last value or doing an average of the read data.  But you can then log that processed data.  This will give you the effective sample rate of 1S/s.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 8
(3,029 Views)

Thank you very much 

0 Kudos
Message 8 of 8
(2,996 Views)