DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Find specified coordinates of a channel

Solved!
Go to solution

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

0 Kudos
Message 1 of 6
(1,454 Views)

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

0 Kudos
Message 2 of 6
(1,430 Views)

Hello, Dia791

Thanks for your reply.

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.

 

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

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

0 Kudos
Message 4 of 6
(1,406 Views)

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

slf2022_0-1653544057382.png

 

0 Kudos
Message 5 of 6
(1,393 Views)
Solution
Accepted by slf2022

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

0 Kudos
Message 6 of 6
(1,378 Views)