DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

find first 5 values in a channel

how can i find the first 5 values of a channel where the channel value will be 6.5.. 

 

For eg: 

0

0.1

0.21

3.1

6.1

0.3

6.1

6.1

6.1

6.1

6.1

6.1

6.1

4.2

3.2

0.3

0.1

I want to the row where my channel value will be the highest(Peak search) and it continues for minimum 5 values(may be more also)

 

Thanks in advance,

Rsh

0 Kudos
Message 1 of 2
(3,991 Views)

Hello Rsh,

 

you have several possibilities to find a peak with DIAdem.

 

The command ChnPeakFind returns peaks contained in the signal. But I think the command ChnFind is better for solving your task. The ChnFind function searches a data channel from the beginning to the end, e.g. 

 

dim i, count
dim intMyResult, intOldResult

FOR i=0 TO ChnLength("Tabelle1/channel1")

  intMyResult =  ChnFind("instr(1,ch(""Tabelle1/channel1""),""6.1"",vbTextCompare)<>0", i) ' search 6.1 
  
  if ((intMyResult - intOldResult) = 1) then  ' Compare old position and current position
     count = count + 1 ' count the number of the value 6.1
     if (count > 4) then
        MsgBox(intMyResult) 'Display the position of the 5th 6.1 value
     end if
  end if
  
  intOldResult = intMyResult
  
NEXT

 

My code doesn't not exactly what you want to do, but I hope it helps you to find a solution for your problem.

 

Best regards

 

Heike

 

0 Kudos
Message 2 of 2
(3,962 Views)