DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

chnFind- To find the chnnel value

Solved!
Go to solution

Hi all,

 

According to DIadem Help, chd determines The first index specifies the channel row, the second index specifies the channel by the channel name or by the channel number.

 

for eg : ChnFind("Ch(2) > 300" ,250) searches from row 250 for a value > 300 and gives the row number in first column. Suppose answer is 4225 meaning in row 4225 we can find chnvalue > 300 in channel 2. 

 

But if i want to retrieve the 4th column value(instead of 1st column) as result depending on the 2nd channel condition, which command i can use? 

 

For more detail, 

 

I have attached a dat file and an incomplete script. 

 

All the details i have mentioned in the script only as comments.

 

 

Download All
0 Kudos
Message 1 of 2
(3,843 Views)
Solution
Accepted by topic author Rash.patel

Hi There,

 

well, you already now the Command: its Chd or Chdx (faster).

 Here I have your script:

 

 

Option Explicit  'Forces the explicit declaration of all the variables in a script.
Dim Row, FilePath
Dim intMyResult

Call Data.Root.Clear

Call DataFileLoad(AutoActPath&"C100225-1 CHEST.DAT","DAT","Load") '... DataFilename,FileImportFilter,ImportAction 

'differentiate these two channels
Call ChnDifferentiate("[1]/000000000000TI00","[1]/000000000000DS0D","/DifferentiatedX","/DifferentiatedY") '... XW,Y,E,E 

'search what is the value of differentiated Y channel at 300 mm in channel 2.
intMyResult = ChnFind("Ch(""C100225-1 CHEST/000000000000DS0D"")>300",250)

Call MsgBox (ChDx(intMyResult,4))

 When you run this code, you will get the value in Channel 4 in Row 6225. This only works if you want to get the same row (obviously 😉 )

 

Hope that helps, RMathews

 

Ramona Lombardo
Applications Engineer, NI Germany
Certified LabVIEW Developer
0 Kudos
Message 2 of 2
(3,836 Views)