10-24-2005 05:27 PM
10-25-2005 09:03 AM
Hi shefalika,
There is no pre-built DIAdem function to do this, but you can create your own VBS function. If you want to look at all the channels in the Portal, you would do this:
MatchChNum = MatchChnComment("Vapplied = -100 mV")
MsgBox MatchChNum
Function MatchChnComment(MatchComment)
Dim MatchStr
MatchStr = LCase(Trim(MatchComment))
FOR i = 1 TO GlobUsedChn
IF LCase(Trim(ChnComment(i))) = MatchStr THEN Exit For
NEXT ' i
IF i > GlobUsedChn THEN i = 0
MatchChnComment = i
End Function ' MatchChnComment()
If instead you wanted to search only in a particular channel group (by index), you would do this:
MatchChNum = MatchChnComment(2, "Vapplied = -100 mV")
MsgBox MatchChNum
Function MatchChnComment(GroupIdx, MatchComment)
Dim ChNum, MatchStr
MatchStr = LCase(Trim(MatchComment))
FOR i = 1 TO GroupChnCount(GroupIdx)
ChNum = CNoXGet(GroupIdx, i)
IF LCase(Trim(ChnComment(ChNum))) = MatchStr THEN Exit For
NEXT ' i
IF i > GroupChnCount(GroupIdx) THEN ChNum = 0
MatchChnComment = ChNum
End Function ' MatchChnComment()
Let me know if you have additional questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments