DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

process interval between novalues

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.

Casey Lamers


Phoenix, LLC


casey.lamers@phoenixwi.com


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!

0 Kudos
Message 1 of 3
(5,323 Views)

Hi CaseyLamers1,

 

you need the following steps:

 

  • calculate relative time (in seconds)
  • create a channel which contains just NoValues or 1
  • calculate a channel with relative time and NoValues
  • accumulate the relative channel to get the all over time
  • accumulate the relative time with NoValues to get minus Novalue times
  • calculate the all over NoValue time

The script example is attached.

 

Greetings

Walter

 

0 Kudos
Message 2 of 3
(5,313 Views)

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.

Casey Lamers


Phoenix, LLC


casey.lamers@phoenixwi.com


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!

0 Kudos
Message 3 of 3
(5,300 Views)