Wave reference from "stringfromlist"
reepingk
The program simply finds the traces in the active graph window, chooses the first one. It prints the list and the chosen wave, just for debugging.
wl = TraceNameList("",";",1)
wn = StringFromList(0,wl)
print wl, wn
Wave wnWave = $wn
Display/N=FALSE $wn
numPoints = numpnts(wnWave)
print numPoints
wn = StringFromList(0,wl)
print wl, wn
Wave wnWave = $wn
Display/N=FALSE $wn
numPoints = numpnts(wnWave)
print numPoints
wl and wn both print out the wave name I'm looking for. However, the display fails, even if I change $wn to wnWave. Therefore the numPoints also fails.
Is it because the string contained in wn is surrounded by quotes? Is it surrounded by quotes, or is that just how it's displayed?
EDIT: This program is part of a larger program, hence why need to convert the string into a wave reference.
Use TraceNameToWaveRef to get a wave reference for a named trace.
March 12, 2015 at 09:57 am - Permalink
I tried the TraceNametoWaveRef command, but it didn't work, so I just ended up using "Wavelist("*",";","WIN:"), which returned wavenames, instead of tracenames. Don't know why I didn't do that to begin with.
March 12, 2015 at 10:07 am - Permalink