Clean using SubVIs block diagram

Hi guys and welcome to my first post!

I m a bit new to labview, so be a little patient, if I do not understand everything immediately

Im working on an existing program that is used to control an MCU on BabyLin on my front, although I have a visualization to see live changes to the system. The program works very well so far, but I m trying to clean up the block diagram. This should be done by subvis, right? I ve read a lot about the size of the block diagram should not increase my screen. Well, im at a length of about 3 x 2 screens (24 "!) after trying to use subvis and to shorten the distances between structures. The only things remaining are huge amounts of local variables and references (they existed already before I got to know the program), mainly for viewing. If I create a Subvi part containing the people of the country, it will change the references that does not make the program more readable (and small), and I guess I can't put a new Subvi on references + Subvi.

You have any ideas what to do? I hope that I forgot something, otherwise, do not hesitate to ask.

Kind regards

Leo

Bob_Schor wrote:

To get a handle on the structure of your high-level code, write down (as if you were telling your boss or tell your wife - who knows, they might be the same person!) that you are trying to do.  Keep it pretty General.  You specified a number of steps?  So maybe the top level should be a State Machine, or a message in queue manager.  Describe you something that works at a constant speed, generating data that you have to manage "on the fly"?  Maybe it's a design of producer/consumer.

You have a lot of initialization?  Put in a Subvi, bring the 20 son out in a bundle (it's "Boss-word" for a Cluster).  Your main program must have a few loops, with values that persist (possibly changing) during the program running in Shift Registers near the top of the loop, with tables and Clusters used to keep related items "consolidated".

Not too bothered by the size of your routine - I recently downloaded a monster 50-monitor the Forums (I did not even try to understand), up to 6 monitors is nothing!

Let "encapsulate the function" and "hide details" to be your guide in the reflection on the creation of the screws.

Bob Schor

To develop on the analogy of Bob, each talking point can be a Subvi.  In other words, code group associate subVIs.  The advantage of this is that it is much easier to solve problems because all errors will be localized to a Subvi.  Errors no longer Chase around the block diagram.  I guess you can use your current VI as an example of what NOT to do on the block diagram.

Tags: NI Software

Similar Questions

  • How to navigate in a running block diagram which is used in a high school?

    I have a Subvi called Servo.vi which is called several times (cloned) in my application. The façade of a selected Servo.vi is placed in a secondary school in my Main.vi so that Servo.vi can be controlled from the front panel. When the Main.vi is running, if I use the block diagram of Main.vi to access a clone running of the Servo.vi and double click it, LabView 2010 navigates me to the secondary running at Main.vi, instead of a separate Panel. But I am not able to show the block diagram of the cloned since high school running in Main.vi Servo.vi.

    How to navigate a diagram of block a VI clone running that runs in a high school?

    Main.VI - Servo.vi:1

    |

    -Servo.vi:2

    |

    -Servo.vi:3

    dbaechtel,

    Have you tried this ?

  • What is the best way to keep the block diagram / cleaning of façade?

    Hello

    I'm relatively new to Labview so I'm not able to say if I'm overloading my programs or make my too crowded block diagram. I was wondering if there was some ways to tell if I can simplify my programming just by looking (perhaps only experience contributes to these things)?

    I enclose my VI here. Currently, she is able to monitor the voltage and current of two engines. On the screen, you can see an indicator with the voltage and current values and there are cards that can display signals of different engines with a menu drop-down.

    The façade is pretty clean, in my opinion of novice, but the block schema seems messy to me, just at the first glance. I foresee a problem occurring in the future however. In the future, I will have the VI to monitor 50 engines globally. All of the programming will be the same as the one I have now, but it will have 50 indicators and unfortunately 50 times just about everything. I would like to avoid this, but I don't know how I did.

    I use a USB-6009. I use its four differential inputs to monitor the voltage and current of the two engines. In the future, I will get more units DAQ (25 in total because 2 motors can be monitored for each data acquisition). The new Renault will help will help with more resource space, but I think things complicate with the added option of 24 more Assistants of data acquisition (as used in my code).

    Thanks for any help you might be able to provide!

    Usually, it is above all the experience that will teach you the best methods for making your code to do pretty. I don't know anyone who is proud of his first application of claws. There are some resources out there to help with best practices, as that group on ni.com, but you will learn most of your own development.

    Your façade is superb. FPs in general really are to you. You can do it as ugly or pretty as you want. When you have a few controls in duplicate and the Group of indicators, you should use clusters and berries to simplify. You can use a bit of cleanup in this regard, but not much. In addition, I personally hate read red text unless it is a warning any.

    Your block diagram could use a little cleaning in a sense of modularity. You have a lot of repeated code, which you might consolidate in to a Subvi, which is used in multiple locations, or in a loop For. A general rule is to keep your block diagram within a single monitor. You should not scroll. Your application is quite simple, so it is difficult to BUMBLE

    Here are a few details on your block diagram:

    • Click with the right button on your devices on the block diagram and uncheck the "display as icon". You are welcome.
    • Operations on each waveform "(x*2-4)" / 16 in double ": create a Subvi and/or run the waveforms through a loop."
    • You do a lot of 2-element arrays and then indexing. Just replace the ones that have a Select node based on digital.
    • All your code runs every time, including the knots of your property at the bottom, which is not necessary. As you learn LabVIEW architectures, you will learn how to get around this with the initialization and the output of code, but for now, you should put a case around those structure for only when the engine numbers change.
    • I don't know how you're timing your main loop, but you should put a delay in there because you don't need the DAQmx node shoot as fast as your CPU will allow.

    There are videos of intro free that you can watch to learn what OR think in terms of coding and teach you some of the basic features and such. Here's a three-hour course, and here's a six-hour course.

  • area limit of block diagram to clean.

    Hello

    I would like to clean my block diagram, but I want to make the most possible condenced into space. Is it possible to insert inside a rectangle that adapt to the window of the screen and clean it without enlarging the rectangle.

    See you soon,.

    Zied

    Hey,.

    I don't know I 100% understand your question. In the future, it would be preferable to this post on the forum of LabVIEW, since it is a question of LabVIEW and not specificially on the switches.

    You can use the cleaning tool block diagram on a specific part of your drawing and pressing Ctrl + U.

  • exec Subvi system. Cannot access the positioning block diagram

    OK I'm back!

    My first question is that for some reason any I can reach is no longer here the files for you all to see...

    Second and more to the point, how can I know the exec.vi for open system where I want it too when the block schema access is password protected and I can't seem to make the nodes property for the vi either.

    I use this vi to call the OSK (on screen keyboard) for touchscreen.

    I have an example to show, but see number one...

    It seems to me that you want to position the osk and that means access to the block diagram is irrelevant.

    To position the program that you are a beginner, try this.

  • How to display the drop-down list box in MS excel by using labview report generation toolkit? pleasepost code block diagram?

    How to display the drop-down list box in MS excel by using labview report generation toolkit? Please post the block diagram of the code so that I can able to generate from the drop-down list box in excel with the menu drop-down...

    Like this. (edition, use the reference forms instead of the reference to the worksheet)

    Ben64

  • block diagram window becomes higher in win7 64-bit using LV2011 32-bit sp1

    I have a strange problem and I wonder if anyone has ever seen this behavior. Often, when I go to the block diagram window, it will become the top window that is it is located at the top of all other windows including LabVIEW non-windows! I have to close the VI and really open to fix the problem. I see this on 3 machines, all the dell of m6600 laptops so I think it's maybe a graphics driver issue. Any ideas?
    Thank you
    Michael.

    Tori,
    I confirm that this problem can be solved by removing the Dell Premier color utility that installs with the driver dell put on hardware compatible color first. The question of the window occurs when LabVIEW works so there is some kind of conflict. Anyway, problem solved for me.

  • Use the colors of the alternative type block diagram data?

    Options window 2016 LabVIEW to offer this new option:

    The help file, however, is not the document, and I have been unable to find anywhere in the options window where the data type of alternative block diagram colors could be defined.

    Any explanation would be welcome.

    I drop everything possible, but decimal color seems to be certainly changed, and it seems that the real colors have changed, too.  I'm color blind, so am not sure if the other fundamentals have changed.

    Option:
    Option ON:

  • Using Subvi under control?

    Hi all

    I have tried to create a custom two-boolean control where one is 'SAVE?' and the other is a "SCREEN"? The two buttons need to be bound by the simple logic that if the DISPLAY is off, turning SAVE on towers on SCREEN, and to REGISTER, the DISPLAY turns off power off record as well.

    I have been successfully implemented the logic in a Subvi. Is there anyway I can use this Subvi under my main VI control without having to do an xcontrol? I spent a few hours watching xcontrol and still have a poor understanding of how to make a. Can I get some general indications as to how I can 'port' this code I already work in the xcontrol?

    I need 16 of these controls on the main Board and so having to repeat the code 16 times in the main BD is not ideal.

    Thanks for your help.

    Hello

    I cleaned your VI for (attached you) and put control references so that you can use it as a Subvi, as suggested altenbach. I also replaced the controls that you use to store the previous values with shift registers. This is a better way to do it, then you must use this as an example for how to do things in the future. In this case, since it is a Subvi, I left the registers at offset uninitialized and it can work as a functional global variable (you can look this up for more on this topic - essentially it will store the previous values of a single passage from the VI to the other). I put the VI to have preallocated clone execution environment, which essentially means that a separate instance of it must be run for each time the Subvi appears on the block diagram so that it will store different values for each pair of save/display controls you have (if not sensible, try to find more info on re-entrant execution).

    In addition, you should think about what you want the initial values of the previous and previous screen record to be. Right now they are just set to false by default, but I don't know if that's what it takes to your logic to work right.  In fact, you might want to rethink your global Boolean logic. Maybe I'm on some complexity that you are responsible for, but it seems that you should not make much more sense. In fact, I don't know why you don't even have to store the previous values. You may want to consider only by comparing current values to another, because it would simplify greatly, and then the VI would not need to be a global functional and you wouldn't have to worry about reentrancy or whatever it is. Just a thought.

    -Hope

  • Reduce clutter in the control on my block diagram reference...

    Is it possible to reduce the amount of clutter on my block diagram when needing to enable and disable controls so that the tests are running? I know that I can place the instruction box in a Subvi, but I'm looking for the best method recommended to reduce clutter when listing references. Using LabVIEW 2015.

    Here is a small example of what I speak, there will be only for references to be added as the devlops of VI.

    Thank you

    Kellen

    rkmadse wrote:

    When you say I can clustor FP, say things that I did, and I have a group of controls such as those below in a clustor. I still have to generate reference constants, which are then placed in clustors. If I want to disable I would have then to consolidate each reference in the clustor, then ungroup and disable each control individually. I bet I'm really missing the point here and I'd love more explanation.

    Thank you

    Kellen

    My main problem is not being able to place real dangerous in a Clustor.

    You think about transportation, when I talk about the horse. Your façade elements can be in a cluster, and then you can use the reference to the pole to disable all. See:

    You will get a façade looking slightly different between the two options if you use disabled and Grayed out because when you grey on the whole cluster, the gray edges. When you gray unique items in the cluster, the cluster edges remain normal.

  • HOWTO call "n" independent instances of 'Decimate (continuous) .vi"without putting instances of"n"of the VI on the block diagram?

    I have a double 2D chart I want to decimate continuously using the ".vi (continuous) Decimate" located in the range of Signal Processing. This VI is set on reentrant preallouee clone because it uses a FGV to save the State of the call to.  What I could do, but do not want to, is having a huge index table and wire 20 + 1 table of DBL to 20 + unique VI instances decimate to ensure that each have their own data space and no 'cross-talk' doesn't happen, then 'picture of generation' all back after the fact.

    I'm almost certain, there is a much cleaner way to do it with only one instance of unique block diagram of the VI decimate using techniques of the call by reference.   I found my way to this link: Preallocated-Reentrant-VI-within-Parallelized-For-Loop that talks about something similar.  After reading pages of four and the detailed help about the function 'Open VI référence' my head is spinning again on what option I want to spend (0x08 or 0x40 + 0x100) to ensure that whenever a slna 2D table come in, each of them is decimated by using the same clone that was used the last time it was called.

    Although the DBL entry 2D array always has the same number of lines, now, it is not always in the future this number and ideal would not force me to create several references strictly typed in VI decimate that will have to change as grows the number of rows in the table 2D static DBL.

    Anyone ready to set up an example VI that takes an array 2D arbitrary of DBL as input, decimating each line using the same clone independent of the "Decimate (continuous) .vi" and outputs the newly decimated 2D Array of LDM?  Assume that each line uses the same factor of decimation and 'Sprawl' set to False.

    Necessity is the mother of all invention and since it upsets me when I read a post that has a similar problem with no resolution, I felt compelled to post mine here.   I'm sure it's better I can do within the current state of LabVIEW.   The only question I have is what happens if I put the call by reference for loop be parallelizable?  That trash completely the nature of 1 to 1 of what I intended?

  • Why the block diagram is disabled?

    What do I do now?  Please, look at the attached picture.  A VI that I use as a Subvi in various different programs suddenly started looking like I had used the application builder to create an exe out of it (but I don't have!).  The only options are Start and run continuously, and the block diagram is disabled.  What I did to get into this mess?  How to cancel everything that I did, so I can edit the schema-block again?  For any help or suggestion would be greatly appreciated.

    Thank you!

    You have somehow managed to record without a block.

    Go back to the last working back up and start from there.  You have backups, right?

    Lynn

  • Error reading the attached viSA-1073807339 using Subvi, but why?

    Hello

    First of all, thanks to all who respond!

    I read N9020A Agilent MXA Signal Analyzer data.  It is successful if a Subvi is used to playback VISA; otherwise "Read Error-1073807339 VISA' rears its ugly little head.»  The Agilent gives the message "REQUEST not COMPLETED" just as endearing.

    The on error-1073807339 OR Knowledge Base article talks about the need to put an end to the chain of command correctly and explains how to check it by double-clicking the control of chain of command on the front and changing the display of '-' Display Mode of the Codes.  I call the VISA Read VI in the block diagram; It does not have a chain of command of front panel control, so I don't know how to apply these tips.

    In any event using a Subvi to perform the Read VISA takes care of the problem, but I have no idea why.  The VI image that does not work is "Agilent MXA Sig Gen vi.png."  A big thank you to Mike on the Agilent forum which provided workaround.

    Nina

    Mark, Fan of the crows and any other interested person:

    I found the error in Agilent MXA GIS Gen.vi.  There is typo in one of the VISA WRITE commands.  Originally, it was

    : MMEMORYATA:? "D:\TEST. PNG"

    It should be

    : MMEMORYATA? "D:\TEST. PNG' (remove: before?)

    Your comments have been invaluable.  Thanks a lot for your help and your patience!

    Nina

  • a lot of Group of variables together on block diagram

    I was wondering if anyone knew a good way to organize a ton of variables on the block diagram? For example, I have 32 switches in this program and whenever I need to read or write from them that I have to use half of my screen just to install in.  I can't think of a way to make it work using bundles or subvis.  I have attached a picture of how I do things now, but advice on you guys how it would be greatly appreciated! Thank you

    Assuming that you do not use indicators and controls in the space of the façade, you can put a cluster around the controls on the Panel (would be helpful if you included a picture of the FP).  That's what I did, but I still need more controls half a dozen in the same group.

    Kind regards

    Michael Tracy

    Synergy microwave

  • Block diagram open

    Is there a way to tell if the block diagram is open when a VI?  I have a Subvi, which is defined in modal when it is opened.  When troubleshooting, if I run my application, but forget to disable modal for the Subvi forcing the system to lock upward.

    It would be nice if I could set the property of the VI not be modal if the schema has been opened.

    Any suggestions?

    I would try to do several things:

    1) go to the properties of the VI > appearance of window and click on the Customize button. From there, uncheck the box for "see the front when it is called.

    (2) when the VI starts, read the 'Front Panel Window.State' VI property - this will tell you if the window is already open, (IE, if the window is open, the State of the window will be 'standard', "Increased" or "Reduced"). Note: This is the visibility of the front, not the block diagram

    (3A) if the VI is not already open, set the 'Front Panel Window.Behaviour' property to modal and then open the front panel by using the node to invoke VI of "Front Panel.Open". It's basically imitating the behavior you describe this moment.

    3 (b) if the VI is already open, set the property to the default or floating behavior to allow you to click other windows.

    (4) when it is finished, if the VI is not already open, close it manually using the Panel.Close before invoking node (if it was already open, leave it open)

    I've attached a screenshot of that sort of thing. I hope this helps.

    Shaun

Maybe you are looking for