DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic scaling on 2D chart in report

In my report, I am displaying the first 3 minutes (of a 10 hour recording) for a channel on a 2D chart.  I've set the scaling mode to Completely automatic.  The chart is scaled according to the overall peak value (around 40000), not the peak value for the 3 minutes (around 200) being displayed.  Is there a way to auto adjust the scale for just the first 3 minutes through a config setting?  

0 Kudos
Message 1 of 5
(5,411 Views)

Hi ric.winters,

 

You could create a new Data Channel that just has the first 3 minutes of data in it. Then you could plot that instead of the entire 10 hour recording. This way the auto-scaling would be more meaningful.

Kelsey W.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(5,373 Views)

Hi ric.winters,

 

I'm not aware of a graph setting to autoscale the Y axis to just the values displayed by the current X axis.  I think your only option is to use the StatBlockCalc() command to calculate the Ymin and Ymax values of the row range that corresponds to the displayed X axis region.

 

I can help with this if you need it,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

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

I thought about doing that, but I can't create a new channel with the same name right?  I use the channel name on the Y axis, so it wouldn't be the same as the original name.

0 Kudos
Message 4 of 5
(5,370 Views)

Hi ric,

 

You don't have to create a new channel to do what I'm suggesting.  The StatBlockCalc() command in DIAdem is one of the few that takes a row range parameter, so you can calculate the max and min values of a particular (X-axis) time range by providing the corresponding row range to the StatBlockCalc() command.  The min and max values are placed in global variables-- no new channel needed-- in fact I'd recommend you avoid creating any channels with the StatBlockCalc() command, like this:

 

IF Xch <> "" THEN
  P1 = PNo(Xch, X1)
  P2 = PNo(Xch, X2)
ElseIF ChnWfKey(Ych) THEN
  Start = ChnPropValGet(Ych, "wf_start_offset")
  Delta = ChnPropValGet(Ych, "wf_increment")
  IF Delta = 0 THEN Delta = 1
  P1 = CLng((1 + X1 - Start)/Delta)
  P2 = CLng((1 + X2 - Start)/Delta)
ELSE
  P1 = CLng(X1)
  P2 = CLng(X2)
END IF
Size = ChnLength(Ych)
IF P1 < 1 THEN P1 = 1
IF P2 < 2 THEN P2 = 2
IF P1 > Size-1 THEN P1 = Size-1
IF P2 > Size THEN P2 = Size
FOR i = 1 TO 23
  StatSel(i) = "No"
NEXT ' i
StatSel(4)  = "Yes" ' Min
StatSel(5)  = "Yes" ' Max
StatResChn = FALSE
StatClipCopy = FALSE
StatClipValue = FALSE
RowRange = P1 & "-" & P2
Call StatBlockCalc("Channel", RowRange, Ych)
MsgBox StatMin & " ... " & StatMax 

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 5 of 5
(5,354 Views)