Find which graph a trace is on

Returns a string containing the name of the topmost graph that contains the given trace
Function /S FindTrace(trace_to_find)
    String trace_to_find
    String wins=WinList("*",";","WIN:1")
    Variable i,j; String win,traces,trace
    for(i=0;i<ItemsInList(wins);i+=1)
        win=StringFromList(i,wins)
        traces=TraceNameList(win,";",3)
        for(j=0;j<ItemsInList(wins);j+=1)
            trace=StringFromList(j,traces)
            if(StringMatch(trace,trace_to_find))
                return win
            endif
        endfor 
    endfor
    return ""
End

Forum

Support

Gallery

Igor Pro 9

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More