05-24-2022 01:02 AM
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
Solved! Go to Solution.
05-24-2022 09:58 AM
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
05-24-2022 08:59 PM
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.
05-25-2022 12:25 AM
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
05-26-2022 12:56 AM
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
05-30-2022 12:23 AM
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