10-13-2010 11:05 AM
Hello
Can anybody help ?
I have a number of logs which contain peak events (see attached) is there anyway to identify these events by the particular waveform and perform a total count ?
Regards
AdeK
Note I'm currently running Diadem 10.2 professional but have 2010 on order.
10-14-2010 10:00 AM
Hi AdeK,
Yes, it looks like we can do a good job of counting the peaks in that data set. Is this by any chance a tachometer pulse? Are you also wanting to convert to RPMs? Do you want just a single number of events or do you want 2 channels, "Time" and "Events-up-to-that-point-in-time"?
Please post an example of this data set and your complete objectives, and I'll be happy to send you a VBScript that tackles the counting.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-15-2010 02:48 AM
Hi Brad,
Thanks for the reply, i've attached a sample tdms and pdf explaining my requirement.
I hope it makes sense !
Regards
AdeK
10-15-2010 04:40 PM
Hi AdeK,
This looks like it works well on my end with your data.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-18-2010 04:17 AM
Hi Brad,
I've tried the VBS and it works perfectly- the 254 count is exactly as the supplier data.
If I want to count peak events which have different properties,do I adjust the TimeCh ,TachCh,MaxThresh and FiltFreq values in the VBS script ?
Regards
Adrian
10-18-2010 07:43 AM
Hi Adrian,
The TimeCh and TachCh variables contain references to the time and data channels to use. Currently those are set to 1 and 2, respectively therefore assuming that the time channel is the first channel in the Data Portal and the data channel is the second channel in the Data Portal. You could also reference the channels by name:
TimeCh = CNo("Time")
TachCh = CNo("Event Data")
And if you have multiple Groups of data channels in the Data Portal you can add the Group name or index to the reference:
TimeCh = CNo("[2]/[1]")
DataCh = CNo("[2]/[2]")
TimeCh = CNo("[2]/Time")
DataCh = CNo("[2]/Event Data")
TimeCh = CNo("Group2Name/[1]")
DataCh = CNo("Group2Name/[2]")
TimeCh = CNo("Group2Name/Time")
DataCh = CNo("Group2Name/Event Data")
The remaining 2 variables, MaxThresh and FiltFreq, do indeed need to fit the details of the event data, regardless of which channels in the Data Portal it is stored in. The MaxThresh parameter is the maximum Y value to allow. All spikes (or data) that exceed MaxThresh will be removed before counting. The FiltFreq variable stores the highest allowable frequency. Any up and down movement of the curve that exceeds FiltFreq will be removed by the low-pass digital filter calculation prior to event counting.
So you will in general need to adjust MaxThresh to the Y amplitude of your signal. With a little luck (and constant sampling rates) you may not need to adjust FiltFreq much at all.
Brad Turpin
DIAdem Product Support Engineer
National Instruments