From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot n-systems [linear] in Report?

Solved!
Go to solution

Hello,

Is it possible to have a image of plots made in View using n-systems [linear] in Report?

In View I have two 'independent' y axes with nice scaling like this: -

View1.PNG

 

I report I have this, where the y axes have a somehat strange scaling: -

View2.PNG

I get the same result whether I use script or manual means (File -> Transfer to report) to create the image in report.  In report, I find only one y axis to edit, and this with no obvious way to scale both axes independently....

 

I have played with the D2AxisYscaleType variable without success.  Also, I fail to manually adjust the report Y axes independently of each other. 

 

I have Diadem 2012.  Script details attached.  Any help is much appreciated.

 

Thanks

Thomas

 

 

 

 

 

0 Kudos
Message 1 of 11
(4,174 Views)

Thomas,

 

I tried a couple scaling configurations and was unable to reproduce the scaling issue that you were seeing on my end from the View tab to the Report tab. I transferred the data from each tab by using the File >> Transfer to Report. Can you please save the entire DIAdem project that you have and post that so we are able to reproduce the issue that you are seeing from the View tab to the Report tab?

 

In general there are a couple things that I would like to have you try:

  • When in the Report tab, can you right-click on each axis and click on “Scale Axis Automatically” and see if the axis will go back to the one in the View tab?
  • If you right click on the scale and click on “Display” there is an Axis Parameter tab, can you click on the X-Axis and then Scaling and then manually scale the report and see if that works, the same concept can be applied to the Y-Axis.

 

Please let me know if these work and have a great day!

Sarina
Applications Engineering
National Instruments
0 Kudos
Message 2 of 11
(4,132 Views)

Hi Sarina,

Thanks for the response.  In Report, there appears to be just one Y axis.  I cannot select each Y axis independently.  The scaling is set to automatic.  If I change to manual, I can modify the scale (begin / end) but it affects both Y axes so I lose one plot. 

It appears that in Report, Diadem is using the range of the whole channel, not just the part shown in View.  Is there a way to edit the Y axes independently?  This is what I get when I click on a Y axis:- 

 

EditReport.PNG

 

By the way, I've just found that this issue was raised before in 2009....but that's a while ago and maybe there is a solution now.....

https://forums.ni.com/t5/DIAdem/How-can-I-adjust-separately-the-Y-axes-of-n-plots-in-DIADem/td-p/961...

 

Thanks for the support.

Thomas

0 Kudos
Message 3 of 11
(4,120 Views)

Hi Thomas,

 

In REPORT you can create up to 20 different Y axes, which you can configure to display whatever Y range you want.  The one caveat there is that the first Y axis has to stretch from the bottom of the graph to the top of the graph.  All other Y axes can be whatever size you want.  Note that size and range are independent here.

 

Brad Turpin

DIAdem Product Support Engineer

National Instrument

0 Kudos
Message 4 of 11
(4,111 Views)

Hi Brad,

But how can I access these y axes in order to edit them?  Even manually, I see only one y-axis which I can edit....at least for 'n-systems [Linear]' plots.  I have for example this: -

Report2.PNGClicking on any y-axis select all of them and there is just one axis (Y1) in the edit box.  Should I see more?

Thanks

Thomas

0 Kudos
Message 5 of 11
(4,094 Views)

Hi Thomas,

 

Go to the "Axis Position" tab (the middle one) and add one or more new Y axes there.  Thereafter they will appear as new options in the "Axis Parameters" tab and also in the "Curve List" tab.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 11
(4,088 Views)

Hi Brad,

Thanks for the fast response.  Yes, I can get the extra axes, but I lose the possibility to have them in an 'n systems [linear] format. 

Background:  We scan and examine our data in View.  We made plots of various channels using the n-systems format which is quick and fast.  Then we would like to export these plots to report, keeping the layout (ie: the muliple axis arranged vertically, just as in View). 

Would I be correct in saying that this is not possible?  We can export n Y-axes [linear] but not n systems [linear] into report and keep the layout?

 

Thanks for the help (and patience!)

Thomas

 

 

 

 

 

 

0 Kudos
Message 7 of 11
(4,084 Views)

Hi Thomas,

 

You can construct the new Y axes in any combination of vertical size and location.  If you assign each of your curves to its own Y axis (other than the first Y axis), then each Y axis (other than the first Y axis) could take up roughly 50% of the vertical size of the graph for two curves, or roughly 33% of the vertical size of the graph for three curves, etc.  There is clearly a non-trivial amount of configuration work involved to set this up each time, but it can be executed programmatically, and you can put that VBScript behind an icon in VIEW to make a custom transfer button.

 

My guess as to why the scaling is off in your first posted screen shot is that you had zoomed into a time region of the overall channels being graphed.  If you cut out just the subset you're graphing and put those in new channels, the built-in stacked graph available in REPORT might look good enough for your purposes.

 

Brad Turpin

DIAdem Product Support Engineer

National Instuments

0 Kudos
Message 8 of 11
(4,081 Views)

Hi Brad,

 

I will make a script for the plots as you proposed.  I will try cutting out the subset as you propose.  An easy (I hope) question...

I am using the limits from the View..eg:

Xbegin =View.Sheets("Home").Areas(1).DisplayObj.XBegin

Xend = View.Sheets("Home").Areas(1).DisplayObj.XEnd

 

Is there an easy way to find the channel indices associated with these points?

With the indices, I can use DataBlCopy to create channels which are subsets between these limits and use them plot in the report.

 

Thanks for the very helpful support.

Thomas

 

0 Kudos
Message 9 of 11
(4,060 Views)
Solution
Accepted by topic author mrme

Hi Thomas,

 

It's fine to use the X axis begin and end positions.  If you instead want to use the X1 and X2 cursor positions, you can insert the corresponding 2 lines from below.  Either way, the rest of the code below shows you how to convert from X1 and X2 values to P1 and P2 values for the channel(s) associated with the first curve in that graph.

 

  Set Sheet = View.Sheets("Home")  
  Set Graph = Sheet.Areas(1).DisplayObj
  Set Curve = Graph.Curves2D(1)
  Xch = Curve.XChannelName
  Ych = Curve.YChannelName
  X1 = MinV(Sheet.Cursor.X1, Sheet.Cursor.X2)
  X2 = MaxV(Sheet.Cursor.X1, Sheet.Cursor.X2)
  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

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 10 of 11
(4,056 Views)