SignalExpress

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9237 and SignalExpress

Solved!
Go to solution

I have a NI cDAQ-9174 with NI 9237 modules along with SignalExpress 2011 for strain gage measurement. After having some problems and doing some reserach on this forum I found out that the minimum sample rate for the NI 9237 is 1613 samples/second. However, I need a sample rate of about 1 - 5 samples/second as my tests will be on the order of 4 - 5 hours and recording 1613 samples every second will make my data file too large. From the forum, I have found these workarounds:

 

Subset and Resample (http://zone.ni.com/reference/en-XX/help/371268M-01/expresswb/subset_and_resample/) seems to be the most recommended, however I do have some questions on this. I chose a subset range of 0 s to 1 s, and then chose a resample of 200 ms. This seems to make the sample rate more manageable, but then I have a problem with exporting the data collected. I get a message that says I cannot export to Excel as the data is "not continuous" and can only convert to text. However, the text file is not really helpful as it breaks up the data into the individual sets and puts the time in terms of dt. For small data sets it seems like it would be possible to manually determine each time point per data point but I will be getting large numbers of data sets. I have tried unchecking the "optimize for run once" but still get the same type of data file. What makes it kind of aggrivating is that the Data View tab in SignalExpress can display a graph of Strain vs. Time, which is what I need in Excel.

 

Another recommendation is to use the "Statistics" option to average samples collected and then changing the number of samples to change the rate. However, I would prefer not to use this method as it seems to imply "at x time, mean of past strain is y" rather than "at x time, strain is y" and I just want the strain value at every 0.5 s, 1 s, 1.5 s, and so on (although then I guess how does that differ from the subset and resample method?).

 

The last recommendation I found suggested to use an N-sample acquisition, set the samples to read to two, and then set a post acquisition delay to 1000 ms. This would have been a nice solution, but it appears that SignalExpress cannot compile all samples read into one log file, as I only saw two data points when I opened it in Excel.

 

I would appreciate any help, thanks.

0 Kudos
Message 1 of 9
(10,028 Views)

Hello MAF101,

 

I would prefer to use the subset and resample step. I built a quick test just configuring just the subset tab, I could take just one point from an specified period adjusting the start position and the subset lenght and returnin the subset. However if you are using the resample function it works a little different. Please try to use just the subset option, if you want to use the resample option, you could share with us an example code, "only" to reproduce the bahavior and let you know what could be going wrong.

 

Regards

Frank R.

0 Kudos
Message 2 of 9
(10,010 Views)

I didn't know that you have to activate the resample function. I think I'm having a little trouble understanding how the function works. I thought how it works was that you would get data from the buffer (input signal), specify a small time range of when to collect data, and then get an output. Such as, at the start of every second, record only 100 ms of data. However, I do get an error message saying that a parameter value was coerced an that I needed to make the subset length a multiple of dt (which I only see in the resample area).

 

In addition, I still cannot export my data in a useful format, as I get an error message when trying to export to Excel. Converting to text gives me a file like this:

 

channel names:
10/16/2013 12:18:05 PM - subset signal - cDAQ1Mod1_ai0
start times:
10/16/2013 12:18:09.503931
dt:
0.000600
data:
2.152175E-6
-2.931191E-7
7.717655E-7
-9.354293E-7
-9.748694E-7

...

-3.394107E-8
-3.100220E-7
-1.448150E-6
channel names:
10/16/2013 12:18:05 PM - subset signal - cDAQ1Mod1_ai0
start times:
10/16/2013 12:18:11.439531
dt:
0.000600
data:
9.182578E-7
-6.818859E-7
-8.464983E-8
1.442250E-6
-6.086400E-7

...

 

and so on but it's not really usable to me in that format as I want to have a graph like it shows in the data view.

 

I've attached pictures of the errors I've been getting as well as uploaded my sample project file.

 

Thanks for the help, this is my first time using SignalExpress or even just performing data acquisition.

0 Kudos
Message 3 of 9
(9,996 Views)
Solution
Accepted by topic author MAF101

Hello MAF101,

 

I ran your own project and it worked for me. I just used the values below:

 

subset.PNG

 

It ran fine, I was able to enable logging. Then, I tried logging the information to a txt file using the step below:

 

log.PNG

 

I got the file attached below using a relative timestamp. It logged two samples per second. 

 

Regards

Frank R.

Message 4 of 9
(9,979 Views)

Wow that was what I was looking for, thanks! 

 

As a corollary, I also am using a NI 9205 to gather voltage data from LVDTs in addition to using the NI 9237 for strain at the same time. As the 9205 doesn't appear to have the minimum sample rate limitation as the 9237, I was simply using the "record" button to create log files for that module. The problem is that the strain data will log to the text file as soon as I press the "run" button and there will be a gap of time for me to press the "record" button.

 

The obvious solution was to also have the voltage data write to text as well, so both started to record when the "run" button was pressed. However, I was wondering if there was a way to further time sync the data, as the strain data's time seems to be a function of the buffer size and the subset length while the voltage is a function of the sample rate directly. Would it be possible to get the modules to use a common time so that both strain data and voltage data values are obtained at the exactly the same second, or is the only option to alter the buffer length for the strain data so that the samples are taken at approximately the same time?

0 Kudos
Message 5 of 9
(9,966 Views)

Hello MAF101

 

I was confused with your last question, the strain data's time is not a function of the buffer size... It is a relative time, when the acquisition starts, it is cero, later, it is increasing the value according to the time.

 

Regards

Frank R.

0 Kudos
Message 6 of 9
(9,946 Views)

I'm sorry, I meant sample rate time. For example, with a subset length of 500u seconds, if I change the samples to read (what I meant by buffer) in the DAQmx Strain Acquire to 800, the time intervals between samples in my text output is 0.48 seconds. However, if I use 1613 for samples to read, I get a time interval of 0.986 seconds. I was just wondering if there was a way to get the time interval between samples to be an exact number (e.g. exactly 0.5 samples every second) like I can do with the NI 9205 or if I just have to play around with the samples to read number.

 

I have attached an Excel spreadsheet of the two test runs with the different time intervals shown.

0 Kudos
Message 7 of 9
(9,941 Views)

Hello MAF101

 

As you said, you need to play with those numbers. We are doing all this because we have this limitation with the minimum rate. with the 9205 we can set the value desired directly however in this case we need to do it this other way.

 

Regards

Frank R.

0 Kudos
Message 8 of 9
(9,930 Views)

That's what I was thinking, thanks for all your help!

0 Kudos
Message 9 of 9
(9,924 Views)