06-21-2005 06:07 AM
06-22-2005 03:24 AM
06-22-2005 06:36 AM
06-22-2005 06:43 AM
06-22-2005 06:49 AM
11-14-2006 04:20 AM
@ingos wrote:
Hello Jürgen,
seems that the time- or reference channel you are using is not monotoneous, which is leading to the error.
If this is true you could create a new reference channel, for instance with the ChnLinGen function. Afterwards you can use the linear mapping (ChnMapLinCalc) to interpolate your original data to fit to the new reference channel (which now is monotoneous and can be used for the RMS calculation).
All calculations can be done manually in ANALYSIS or via script using the commands I mentioned.
11-14-2006 04:31 PM
Hi Kaan,
Yes, there is a much more efficient way, using the FormulaCalculator. Take a look at the attached example.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
11-15-2006 10:20 AM
11-16-2006 09:02 AM
Hi kaan,
I have been assuming that the "repeated values" are the time or X-axis values, is that right? If so, then all you need to do is first sort all the channels based on the X-axis values, then your repeated values will always be next to each other. You need to do this anyway in order to achieve the "monotone rising" X-axis channel that it looks like you need further up this post. Try the version below which has the ChnMultipleSort() addition:
CALCXChn = CNo("[2]/[1]")
CALCYChn = "'[2]/[2]' - '[2]/[4]'"
R1 = 1.0E-12 ' minimum difference that qualifies as a repeat
Call DataDelAll
Call DataFileLoad(AutoActPath & "Remove Repeats.TDM")
Call DataFileLoad(AutoActPath & "Remove Repeats.TDM")
GroupName(2) = GroupName(1) & " Repeats Removed"
GroupName(1) = GroupName(1) & " Original"
Call GroupDefaultSet(1)
Call ChnMultipleSort(CALCXChn, CALCYChn, 0, 1)
Call ChnDeltaCalc(CALCXChn, "Delta")
Call GroupDefaultSet(2)
L1 = CALCXChn
L2 = CNo("[1]/Delta")
ChnLength(L2) = ChnLength(L2) + 1
ChDX(ChnLength(L2), L2) = Null
Call FormulaCalc("Ch(L1):= Ch(L1) + NoValue*(abs(Ch(L2))<R1)")
'Call ChnDel(L2)
Call ChnNoVHandle(CALCXChn, CALCYChn, "Delete", "X", 1, 0)
Call View.LoadLayout(AutoActPath & "Remove Repeats.TDV")
Call WndShow("VIEW")
Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments