LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with axis- scaling of hidden graph indicator

Hello,

 

This is referring to the topic already mentioned here and quite similar.

I have a graph indicator, which I want to take an image from for report functionality. I want to adapt both Y-axis so that the zero-line has the same position. For this I set the range of both Y-axis via property node. Afterwards I get the controls image via invoke node.

When the graph is visible, all of this is no problem, the scales are set correctly and I get the image as expected. But in the case the graph is not visible, the axis are not set, only autoscaling is working correctly. The difference to the topic mentioned above is, that it doesn't help to have the front panel open with the graph indicator out of view. With LV2015 it is necessary, to have the plot area (a single pixel is enough) inside the panel bounds area.

It is clear to me, this is for performance reasons. But there should be a way to deactivate this behaviour.

To ilustrate the problem, I attach the VI  and its super-VI as a snippet:

Graph Axis Problem.png
 

Graph Axis Problem - Super.png

 

The second issue is the incorrect function of the "Get Image" invoke node. When the indicator is not visible, a part of the plot area is not shown correctly, the diagram lines are not plotted. See the following picture:

 

Graph- Image error (original Graph indicator).png

This is a screenshot of the actual graph indicator (btw. with incorrectly set scale ranges)

 

Graph- Image error.png

This is the the image of the graph indicator, delivered by the "Get Image" invoke node.

 

Does anybody have an idea, how to solve these problems? And I think, there must be another way than opening the front panel programmatically, flashing unexpectedly somewhere on the screen.

 

Greets, Dave
0 Kudos
Message 1 of 9
(3,094 Views)

Hi Dave,

 

I ran your code in LabVIEW 2015 and 2016 probably I didn't get your description right, but it worked for me. The only modification I did was take the image data in the 3rd sequence frame and attach a "write bmp file.vi" to it. This makes the calling VI irrelevant

This gave me always the same image. To answer your second question first:The frame is already there for me when I place the 2D Picture indicator. Is this not the case for you?

I.e. if I simply save it as image, the borders will never appear.

 

For the scaling problem you described, I attached two images from LabVIEW 2015 where in the first the Indicator was not visible in the front panel (somewhere below the visible area) and in the second it was visible. Can you create a project where there is one main calling vi and two subVIs that show the behavior you describe in the calling vi?

 

Ans for your last question: you don't need to open and close the front panel of a subVI. You can right click it in the main VI >> "SubVI node setup" >> uncheck the tickmark

 

I hope this already helps along for some of the problems. Please post the VIs were I can check for the behavior.

Cheers, Niko

 

Niko NR
Systems Engineer, National Instruments
Download All
0 Kudos
Message 2 of 9
(3,027 Views)

Hello Niko,

 

than you for your answer and sorry for the late reply. I think, I didn't brake it down to the actual problem.

The cause for my (first) problem is the axis of the hidden graph. I can set the range property and  get the right values back, but the graph axis itself isn't changed. I want to illustrate that by setting the axis with every call with a random value, to see the range- modification.

When you start the Super- VI, it will now open the VI "Graph Axis Problem.vi" with the graph out of view. Everytime the super-VI is started, you can see that the indicators, showing the axis ranges (before and after setting the random range values) are changing their values, but this has no effect on the actual graph.

If you pull down the window border of "Graph Axis Problem.vi" so that a part of the graph is visible, the axis ranges are adapted to the values set by the property nodes.

 

Greets, Dave
0 Kudos
Message 3 of 9
(3,002 Views)

And to point out the second issue: When the Super- VI is run with the graph hidden, it is shown in picture indicator, that a little part on the left side of the diagram area is not drawn, it's the X- range from 0 to 0.05. This all disappears, when a little part of the plot area is inside the visible part of the the front panel window.

Does anybody have an idea how to fix this?

 

Greets, Dave
0 Kudos
Message 4 of 9
(2,971 Views)

Why is nobody there with a hint to my problem?

Greets, Dave
0 Kudos
Message 5 of 9
(2,958 Views)

Hi Dave,

sorry for the late reply and thanks for the project. You are right, the graph right in the beginning is missing data, if the graph is hidden in the Sub-VI. The question is: does it matter in the SubVI, anyway? Do you want to pop the SubVI up and hide it there?

I will work on it and let you know as soon as i get something 😉

Cheers, Niko

 

Niko NR
Systems Engineer, National Instruments
0 Kudos
Message 6 of 9
(2,953 Views)

Since I want to get the control's image for adding it to my PDF report, it is necessary to have a correct image of the graph.

And as you noticed, the graph axis is not adapted to the values i feed into the property nodes, although the right values come back when I read the properties.

Greets, Dave
0 Kudos
Message 7 of 9
(2,951 Views)

I was able to get the correct axis scaling by calling your code as a sub vi and then setting the the front panel of the subvi to show when called, close after, and run transparently at 100%.  I don't see any popup flicker or anything.

Message 8 of 9
(2,942 Views)

This is a good workaround. Thanks for the idea.

Nevertheless I think it's a drawback, that the axis are not adapted when the plot area is not in view.

 

Greets, Dave
0 Kudos
Message 9 of 9
(2,927 Views)