06-18-2014 08:22 AM
Hi,
I want to count the number of peaks a particular channel has above a certain limit defined by me. For example, If i define 35 as the limit, then it should give me the sum of all the occurences everytime a peak occurs with a value greater than 35.
Thanks
Akash
06-18-2014 08:51 AM
You should be able to go to Analysis, Channel Functions, Calculate Peaks
Set your x channel, your y channel and lower limit value.
It will return two channels of data. Position and Amplitude. The Length of the channel is how many peaks you have.
I used 40 as my min in the example below.
dim peak
Call ChnPeakDetect("[1]/Time","[1]/Speed","/Position1","/Amplitude1","Peaks",40,3)
peak = Data.Root.ChannelGroups(4).Channels("Position1").Properties("length").Value
call MsgBoxDisp (peak, "MB_OK")
06-18-2014 10:12 AM
Hey,
Thanks for the reply. I have already tried this and I understand the length of the channel is the number of peaks in the channel, but how do i put that value in a table in a report? Please help!
Thanks & Regards
Akash
06-18-2014 10:39 AM - edited 06-18-2014 10:40 AM
It depends on how you want your table to look
If you just want to add text that staes the number of peaks
Change from
dim peak
to
globaldim "peak"
Then in your report set up a text feild and where you want the value to show up type
@@peak@@
and it will grab the number from your script and place it in the report.
Sorry I can't help more. I don't use too many tables in my reports.
06-19-2014 06:58 AM
Hi,
place 2D table to the REPORT. Then move (drag&drop) channels into tabel a set parameter of the table:
Table Definition -> Scaling -> Table length: Automatic maximum.
Simyfren
06-19-2014 12:15 PM
There is a simpler way to show the number fo peaks in your report:
You can do this with any property from the dataportal.
If you double click teh text in the layout, a dialog will open which shows you how DIAdem created the reference to the property