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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Block diagram won't scroll. Need to bring back to (0,0) origin

Solved!
Go to solution

I noticed that I couldn't scroll the block diagram anymore to the left. Then I saw the coordinates, and it shows (-32172, -4250).

I must be way too far to the left. Then I right to scroll to the right, but putting the mouse cursor on the horizontal scroll bar, and that didn't work.

 

Then I Shift-right-clicked to get the little hand to pan to the right. Not even that was successful. My BD is not that big. I used the Clean Up Diagram

tool and I don't see any control or indicator that is way to the right or left. Why can't I scroll to (0,0) origin?

 

On a side note (possibly related), does having Tab Control on the FP cause strange behavior? If so, why Tab Controls exist?

0 Kudos
Message 1 of 12
(2,967 Views)

I would have expected the cleanup tool to recenter the diagram. Curious... Can you attach the VI?

0 Kudos
Message 2 of 12
(2,944 Views)

The coordinates are the problem. When diagrams get that big or that far from the origin, LabVIEW gets confused. It may not be possible to recover once the diagram has been corrupted.

 

Can you go back to the version before you used Diagram Cleanup? Then Select All and drag everything closer to the origin. Select parts of the block diagram which can be converted to subVIs and convert them. The subVI icons will take far less space than the original code. Everything which goes into one subVI should be logically related - it should perform only one function or procedure.   Next use Diagram Cleanup on (relatively) small portions of the block diagram. The combination of creating subVIs and cleaning up small portions at a time should allow you to tame the beast.

 

Lynn

0 Kudos
Message 3 of 12
(2,937 Views)

I manually moved everything to the right and now the coordinates are fine. But I am sure the VI is somehow corrupted because of other strange things.

For example, sometimes when I right click on a control (like Enum) to create a constant, I can't see where the constant is...

Anyway, I copied my code into a new VI and changed the  structure from a flat sequence to a state machine. Much better now.

 

But I do have a question that I am pretty sure the answer is no, but I'll ask anyway. In my code, I have over two dozen plots. For each plot I have an XYGraph.

Each XYGraph has multiple curves on it. I know I can format the plots through property nodes that I have placed inside a for loop and feed the for loop

the reference to each XYGraph. So I have created one reference for each XYGraph and put the references into an array and feed the array ino the for loop.

 

Question: Is there a clever way to create only one reference (a generic one) , maybe put it inside a for loop, where with each iteration it associates with a different XYGraph,

and the for loop would build an array of references that can then be fed to the other for loop containing the property nodes? 

0 Kudos
Message 4 of 12
(2,915 Views)
Solution
Accepted by topic author murchak

@murchak wrote:

I manually moved everything to the right and now the coordinates are fine. But I am sure the VI is somehow corrupted because of other strange things.

For example, sometimes when I right click on a control (like Enum) to create a constant, I can't see where the constant is...

Anyway, I copied my code into a new VI and changed the  structure from a flat sequence to a state machine. Much better now.

 

But I do have a question that I am pretty sure the answer is no, but I'll ask anyway. In my code, I have over two dozen plots. For each plot I have an XYGraph.

Each XYGraph has multiple curves on it. I know I can format the plots through property nodes that I have placed inside a for loop and feed the for loop

the reference to each XYGraph. So I have created one reference for each XYGraph and put the references into an array and feed the array ino the for loop.

 

Question: Is there a clever way to create only one reference (a generic one) , maybe put it inside a for loop, where with each iteration it associates with a different XYGraph,

and the for loop would build an array of references that can then be fed to the other for loop containing the property nodes?


Hey,
check out the Traverse for GObjects.vi (Programming -> Application Control -> VI Scripting )

 

Traverse.png
Regards,
CMW
Message 5 of 12
(2,900 Views)

Not too many years ago, block diagram positions were saved internally as I16s. Your diagram position is very close to the maximum of an I16 (32767). It was not until the advent of scripting and other automatic changes to the block diagram that this was an issue. 32767 is a lot of pixels. My guess is that you have stumbled onto a case where old I16 code was not quite all cleaned up. If you still have the original code and can post it, I will file a corrective action report.

 

For most cases, moving your code back closer to the origin of the block diagram should clean up the issue. It may not. If not, I would recommend selecting all code in your block diagram and pasting into a new VI. This should clean it up. If this doesn't work, let us know.

0 Kudos
Message 6 of 12
(2,881 Views)

Thanks CMW.

 

 

Suppose I have a SubVI that plots Y1 vs. X1 and Y2 vs. X2 on the same XYGraph. See the attachment.

The XYGraph property node is linked to the XYGraph. It sets the line width and point style for each curve on the XYGraph.

 

If I call this SubVI 4 times in another code (to make 4 diferent XYGraphs (XYGraph1, XYGraph2, XYGraph3, XYGraph4, each containing two curves for Y1 vs. X1 and Y2 vs. X2)), 

why would I need to create 4 different references for the 4 different XYGraphs? 

 

The question really is this: if the property node is explicitly linked to the XYGraph in the SubVI, why would the property node need to be updated via a reference if the SubVI is called

multiple times to make multiple XYGraphs? Wouldn't the SubVI take the inputs, plot the curves the XYGraph, update the property nodes and then produce a final XYGraph with

updated properties?

 

 

 

 

0 Kudos
Message 7 of 12
(2,856 Views)
This seems to be a new problem and you should have started a new thread for it.
0 Kudos
Message 8 of 12
(2,850 Views)

Agreed. I'll copy and paste under a new subject line.

0 Kudos
Message 9 of 12
(2,845 Views)

Thanks CMW.

 

A few questions: I have a control tab containing multiple pages on my FP, and each page contains several XYGraphs.

How can I tell which reference is associated with which XYGraph? what is the order that Traverse for GObjects.vi follow

when it enumerates the objects on the FP on control tab? For the Target Input, do I choose "Other" because I have

a control tab on the FP? If I have a text ring and a enum, they are both from class Ring, how does Traverse for GObjects.vi

distinguish between these two types? 

0 Kudos
Message 10 of 12
(2,788 Views)