cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Find specified coordinates of a channel

I would like to know if DIAdem could find the specified point coordinates of a channel and record.

I need the coordinates for the following calculation.

And I also need these process can be recorded by the script

thank you

Message 1 of 6
(903 Views)

## Re: Find specified coordinates of a channel

Hey.

What do you mean with "coordinates of a channel"?

If you're looking for a specific value, you can search for this, from any points on (either from the beginning, or from point X), forwards or backwards...

For this the function ChnFind would help, just look in the help file (write ChnFind in Script, place the cursor there and push F1).

If you need to find max/min values, then the "Peaks" is the better keyword to search for.

The results you can "store" in variables and use them later in code.

Or is it something different?

Greetings,

Vassili

Message 2 of 6
(879 Views)

## Re: Find specified coordinates of a channel

Hello， Dia791

The function I need is like: I know the X coordinate of a point in a channel, and I want to find the Y coordinate of this point ,and store it .

Thank you.

Message 3 of 6
(863 Views)

## Re: Find specified coordinates of a channel

In this case you don't need anything at all.

For example, your data channel is numeric, on the third position in the first group, and you need the value number 17, you can get it in easy way:

``````'- reserve a variable as a link to the channel
'- and set this link
dim chan
set chan = Data.Root.ChannelGroups(1).Channels(3)

'- give out the 17th value of this channel
call msgbox(chan(17))``````

Instead of call a message box, you can put this reference in any other calculation.

Another way to get this value is just a line:

``call msgbox(Data.Root.ChannelGroups(1).Channels(3).Values(17))``

This would do the same, but the code is less clear, particularly if you have a lot of such calls.

Hope, it helps.

Greetings

Message 4 of 6
(855 Views)

## Re: Find specified coordinates of a channel

Hi, Dia791

For the XY channel (X channel is time, Y channel is Velocity), just like the picture below, I know the value of T2 in X channel , what function can I use to find the relate V(2) in the Y channel and store it.

It is not peek point or Max/Min point also.

Thank you

Message 5 of 6
(842 Views)
Solution
Accepted by topic author slf2022

## Re: Find specified coordinates of a channel

Hi Dia791,

Your X-channel is TIME and thus monotonically increasing. In this case you can use the PNO function.

``````dim oChnX, oChnY, dT2, iRow

set oChnX = Data.Root.ChannelGroups(1).Channels("Time")
set oChnY = Data.Root.ChannelGroups(1).Channels("Velocity")

dT2 = 15.3

iRow = pno(oChnX, dT2)

msgbox oChnY(dT2)``````

Greetings

Walter

Message 6 of 6
(827 Views)