DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I find at what index the max value occurs for a channel?

I may be overlooking something very simple here but I need to find out at what index the max value occurs for a channel.  I need the index so I can look up other data at the same index in a script.  Sorry for asking what is probably a newbie question.  Thanks.

0 Kudos
Message 1 of 3
(6,342 Views)

Hi ric.winters,

 

Please use the function PNO, which returns the index of a given value in a channel.

 

Greetings

Walter

0 Kudos
Message 2 of 3
(6,333 Views)

Hello ric.winters,

 

As an example to explain the recommendation made by Walter, here is a little bit of code:

 

L1 = PnO("Speed",CMax("Speed"))
msgbox(L1)

 

L1 is a user variable (longinteger) provided by DIAdem

PnO determines the row in a numeric channel or a text channel, of which the contents are closest to a specified value or text

CMax is a variable that contains the maximum value of a channel

MsgBox generates a message box

 

The code above will store the index number of the maximum value of the channel called "Speed" in the varibale L1 and subsequently displays that value in a message box.

 

 

Otmar D. Foehner
0 Kudos
Message 3 of 3
(6,327 Views)