SignalExpress

cancel
Showing results for 
Search instead for 
Did you mean: 

cycle count

I am trying to find a way to add cycle count to my data file in SE.  I am aquiring an analog load signal with an SCXI -1001 chasse on an SCXI-1100 32 channel analog input module through an SCXI-1600 data aquisition module.  The signal is a sinwave with a copnstant amplitude of about +/- 2.5 volts and a frequency of 1Hz.  Is there an easy way to identify each cycle and add a cycle counter to my exported ascii data file?
 
Also, since I am recording at about 100x the cycle frequency (100Hz) and since I am running almost 500K cycles, I would like to try to record only 10 cycles of every 4000 cycles.  Do I have to just aquire all of the data, or is there a way to just capture these snippets of data?  I am also recording 30 strain channels at the same time, so the files will get pretty large.
 
Any help on this would be REALLY appreciated!!
Thanks!
0 Kudos
Message 1 of 5
(7,205 Views)
Hi,

I'm assuming that you are using LabVIEW SignalExpress and not the older version of SignalExpress, so I'll gear my answer towards the newer version.  The way that I would go about determining how many cycles have occurred is to perform a frequency analysis on the acquired sine wave using the Tone Extraction step.  From the frequency that this step calculates, then implement a Formula step that can calculate the number of periods based upon the sample rate, number of samples, and frequency.  The formula would be as follows:
# of periods = ((samples to read) * (1 / (sample rate))) / (1 / (signal frequency)).

For limiting how many cycles are actually stored to your log file, you could use the Subset and Resample step to pull only a section of the total samples read.  I have attached a sample LabVIEW SignalExpress project that hopefully should get you started.  Let us know if you have any other questions.

Regards,
Andrew W
National Instruments
0 Kudos
Message 2 of 5
(7,180 Views)
Andrew,
Thanks so much for your speedy reply.  I have tried to impliment your suggestions into my latest SE 2.0.0 project, but I am running into a couple of problems.
 
1.  With samples to read set to 4000 and the rate set to 100 hz, the Data View plots are only updating every 40 seoncds.  Is there a way to get them to update in realtime?
 
2.  The data view for the number of periods only reads ~42.  The ascii file updates every 40 seconds and also has a value of 42.8 (see exaple below).  Can I find a way to make this a cumulative counter (ie. cycle 16,254 )?
 
channel names:
9/14/2007 11:15:00 AM - number of periods
start times:
9/14/2007 11:16:21.198926
dt:
40.000000
data:
4.283887E+1
4.283534E+1
4.283685E+1
4.283943E+1
4.283230E+1
4.282673E+1
4.283167E+1
 
 
3.  The subset data file pudates with a new header every 40 seconds as well, but does not contain any data (see beloe\w):
 
channel names:
9/14/2007 11:15:00 AM - subset signal
start times:
9/14/2007 11:16:21.198926
dt:
0.010000
data:
channel names:
9/14/2007 11:15:00 AM - subset signal
start times:
9/14/2007 11:17:01.198926
dt:
0.010000
data:
 
If I have to do away with the periodic data snippets, I could live with it, but it would make my life alot easier.  My first run would have 3.6 million lines of data.  I have attached my modified project file.  Is there anyway you could take a look and let me know your thoughts?
Thanks!!
J.B.
 
0 Kudos
Message 3 of 5
(7,160 Views)
Hi J.B.,

Sorry for the confusion, I guess I should have explained the reasoning behind my choice of value for the samples to read.  I chose 4000 samples to read as a demonstration based around your requirement of logging only 10 cycles out of every 4000.  I configured 4000 samples (which equals out to 40 cycles of a 1Hz waveform sampled at 100Hz) so that when those 40 cycles were collected the Subset and Resample step could extract a single cycle out of that set.  For your application you would need to configure 40000 samples to read to get 400 cycles per read iteration, but this would take 400 seconds before the data view plot would update, per iteration!

The "number of periods" calculation takes place after every read happens, so the log file would need to be parsed afterwards to sum all of the period measurements together (because LV SignalExpress is not flexible enough to do this).

A new header is created on each iteration currently because we are writing the Subset data to the log file on each iteration, and it thinks of the subset data as a new waveform with new timestamps.

If the "number of periods" calculation is a more critical piece of information to have, I think you will have to sacrifice and acquire all the cycles rather than 10 out of every 4000.

I guess the overall conclusion here is that LV SignalExpress may not be flexible enough to give you the results you are trying to get.  SignalExpress is intended to provide the ability for simple data acquisition and logging applications, but LabVIEW may be a more suitable development environment based upon your requirements.  If you have LabVIEW at your disposal I could make some recommendations that could get you up and running pretty quickly. Smiley Wink

Regards,
Andrew


0 Kudos
Message 4 of 5
(7,156 Views)
What about using the Statistics step to sum the cycle counts and then use the save to ASCII in overwrite mode to write last summed value?
 
Also, if you need to extend SignalExpress's cabilities and do not want to rewrite you whole app in LabVIEW you create a VI that does the custom analysis and then use the "Run LabVIEW VI" step to perform your custom analysis.  And if you want to have a better integration than the Run LabVIEW VI you could sign up for the SignalExpress Step SDK at www.ni.com/beta.  This allows you to create custom plugins to SignalExpress that should make it as flexible as you need.
 
0 Kudos
Message 5 of 5
(7,146 Views)