11-25-2013 11:59 AM
I have a channel that has timestamp data while a test is running properly and NoValues when it is not. I want to find the total time between each set of NoValues in the channel. I have tried using conditional statements with the ChnSum command and the procssing NoValues dialog box but have not been able to produce the results I would like.
Phoenix, LLC
CLA, LabVIEW Champion
Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!
11-26-2013 01:26 AM
Hi CaseyLamers1,
you need the following steps:
The script example is attached.
Greetings
Walter
11-26-2013 12:13 PM
Walter,
Thank you for your response. You gave me the insight I needed to solve the problem. Below is the script that returned the values I needed from the test data you produced:
' calculate relative time (in seconds)
Call ChnOffset("[1]/TimeGenerated","/Offset",0,"first value offset")
' create a channel which contains just 0 or 1
Call Calculate("Ch(""[1]/Result"") = IIf( IsNull( Ch(""[1]/LinearGenerated"")), 0, 1)")
' calculate a channel with relative time and zeroes
Call ChnMul("[1]/Offset","[1]/Result","/Multiplied1") ' This is the starting point for my data for processing my data
' find all of the times right before there were NoValues
Call ChnPeakFind("[1]/TimeGenerated","[1]/Multiplied1","/PeakX","/PeakY",,"Max.Peaks","Time")
' add a zero to the first line of the generated channel
Call ChnGenVal("[1]/PeakY",1,1,0,0,0)
' calculate the relative time between NoValue occurrences
Call ChnDeltaCalc("[1]/PeakY","/Delta")
I will then pull this channel into a report with probably some statistics applied to it.
Phoenix, LLC
CLA, LabVIEW Champion
Check Out the Software Engineering Processes, Architecture, and Design track at NIWeek. 2018 I guarantee you will learn things you can use daily! I will be presenting!