DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Automating Time Domain Scaling

Hello,

 

I'm trying to automate report generation. I am plotting channal data over time. First I am converting from date & time to seconds:

   Dim timeChanName : timeChanName = oLeadingCurve.XChannelName
    dim timeChan : set timeChan = Data.GetChannel(timeChanName)
    dim iXmin : iXmin = int(timeChan.Size * BandLimitInRatio_Xmin)
    dim iXmax : iXmax = int(timeChan.Size * BandLimitInRatio_Xmax)
    oActiveSheet.Cursor.Type = "Band"
    R1 = timeChan.Values(iXmin) 'R1 is needed to convert from date&time to seconds which is expected by X1 and X2
    oActiveSheet.Cursor.X1 = R1
    R1 = timeChan.Values(iXmax) 'R1 is needed to convert from date&time to seconds which is expected by X1 and X2
    oActiveSheet.Cursor.X2 = R1

This is fine if I want to manipulate data in View, but as I said, I want to automate straight to Report. The result is as follows: 

 example.JPG

 

The first and last data point are not of interest and cause the time scale to be poor. I am not a programmer and I'm having a difficult time thinking of a way to programmatically delete this data so that the time scale does not require adjusting. 

 

Does anyone have a suggestion for this process?

 

Thank you very much!

0 Kudos
Message 1 of 3
(546 Views)

Hello MustBeWorking123,

 

This is a very interesting problem as I've been thinking for a bit about it. My intuition is to do some statistical analysis with respect to time and remove anything beyond a threshold.

 

I think "StatBlockCalc" on the time domain axis could probably work for you and then set a threshold of of values that you want to keep.

 

Hope that helps!

 

JY
AE Specialist, RF and Communications
National Instruments
0 Kudos
Message 2 of 3
(504 Views)

Hello MustBeWorking123,,

 

If you set the first and last values of your time channel to NoValue (Null), that would clear up the graph you showed, using autoscaling.  Is it always just the first and last points, or is it sometimes more?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 3 of 3
(484 Views)