Subvi questions

I am very new to LabView, and I'm trying to chain several VI who wrote programmers better than me. I have problems, however some of them to work as the Subvi in my program, so I feel like I'm missing something.

The joint "Hand Controller.vi" translated just a cryostat vertically, so I joined 'SubVI.vi' to indicate the kind of things I want to try and do with it:

(1) I have power values "absolute" and "Relative Position,"

(2) wait for the Ready Master 'witness' to turn green, then

(3) press "Home at end of race.

Course, I need to translate the cryostat several times further in my program, but even this initial translation does not work. Where I'm going wrong?

vivianbritto wrote:

Thanks for the reply fast crossrulz. I understand what you are recommending that I do, but I'm curious to know why the VI hangs if it has structures of the event? If I am wiring a Boolean constant to a button, isn't the same as if the front panel opens and I hit the button? In concrete terms, what's not in VI that I downloaded? I ask because most of the VI I try to make use of as the Subvi is built the same way. Thank you!

Writing a control will NOT cause an event.  A local variable entry will NOT cause an event.  Writing a value of property node will NOT cause an event.  In writing to a property node Value (signaling) will cause an event.  But I seriously doubt you want to do it here.

As I said, your VI starts and sits there waiting for an event.  But given that the façade is not open, an event never fires.  The result is a frozen VI.

Tags: NI Software

Similar Questions

  • Question about the Manager of messages in queue and dynamically load/close Subvi

    Hi, my dear LV users

    I learn how to use the machine in queue Sate Architecture. I created a simple project, including a "main.vi" to dynamically load a sub vi 'sub_Vi2.vi' in the case of "initialize". The sub vi simply open a configuration file and load affecting some control and write these values in the configuration file. If the configuration file is not created, the sub vi creates until the user closes the Subvi.

    In the case of "Get out" of my "main.vi", I send 'true' to the Subvi stop button to stop running it. But the sub vi did not write these values back to the configuration file, or created a new when I delete the configuration file.

    There is another vi I made 'main1.vi', which loads dynamically and close the Subvi. And it works as well as I expected: create the file and write data!

    Can someone help me understand the code? I've also attached the front of diagrams and source code. It's in 2012 LV.

    Best regards

    Li CQ


  • FPGA Subvi Multiple Instances

    Hey,.

    It is sort of a basic question, and I don't know how at the height, I'm on the vocabulary of LabView FPGA. I did a machine States that performs a task, and I want two of these state machines is running at the same time. So, I created a Subvi with the state machine and placed two calls to them in the top level VI.

    The problem is when I run the VI of highest level in interactive mode, the initial contributions are locked, and subsequent changes to the entries does nothing. So, basically there is something I don't understand. I imagining me signals propagating VI of highest level for two instances of the subVIs instead of the initial values being stored.

    What I am doing wrong?

    Thank you

    Kevin

    Hello kevin.key,

    The difference between the two parts of the code that you fixed is that the code in the while loop will run several times until it stopped while the code without the loop will only run one and then stops.

    Your Subvi begin values based on the values of input passed your top VI. These values will be updated every time your Subvi is called from your albums VI. To do this your top VI has a loop for continuous data and your Subvi should independently of your albums looping VI. The reason why the values in your front panel are not getting updated is because there is no loop in your top VI. If you include a loop that values will update each time the loop runs, which occurs only after the entire interior of the loop ends, including the Subvi.

    If you have access to a computer with LabVIEW on it try to start live using the run culminating to see the behavior of your Subvi.

  • A few questions on the framework of the actor

    Hi all

    I tried to get my head under the actor and begins to see the light at the end of this tunnel-no need of sunglasses right away, because I have a few questions remaining:

    1. data transfer :

    So far I've had a quick glance the evaporative cooler model and actor model, as well as worked through the LabVIEW actor Framework Basics by labvolution. These examples are pretty clear for me now. What I don't understand though, is how you are supposed to provide "real" data These examples use only references and then update using the "value" property This may not be very fast, but is probably still enough for user interface applications. But what happens if I have a player who generates data by reading example of a card and I have, let's say, want to detach this far from the data backup process in a file. How I would pass large amounts of data between stakeholders effectively.

    2. using the framework of the actor with RT:

    In presentations to the AF, I saw that they always mentioned that it was completely "capable RT. While this may well be true for the RT itself system, yet once I wonder how to transfer data from an actor of the RT of a player in Windows. Yet once again, suppose I want to generate data on a cRIO and save that data on the host PC. I will establish a channel of communication between the target myself by network flow or similar? It defies any sort of encapsulation of the AF in my opinion...

    3. set the actors:

    However, what worries me the most, is the definition of the actors. How can you know what is a player in your system? Each card set as an actor? Define you each device as an actor and consolidate all I/o to the breast? Is there an easy way to know how to set the actors?

    4. technical support:

    While working with the examples, I found that the debugging can be quite difficult. I had several cases of "Not executable Subvi" this point through several other live who finally call something dyynamically and from there, you discover that one of your screw is broken. Is there an easy to know what is the problem? I know there are modules for LabVIEW that are designed to turn on debugging part of the actor, but who would not be available in a review of the CLA, where you will have only a base installation of LabVIEW.

    5 root and nested actors:

    Finally, I wonder what root and nested average actor. So far my understanding is that the actor root is the parent actor you cast in the launch of VI and nested the actors are all children who serve the actor parent and are, most of the time, launched since the actor-actor of parent nucleus. Is this correct? Is there a better definition of it?

    Any help on this is greatly appreciated. I'm looking forward to the discussion and interested if you frequently use the framework of the actor or if you have abandoned it even once after using it.

    See you soon,.

    Pete

    A good place to ask the question in the framework of the actor is in the community:

    https://decibel.NI.com/content/groups/actor-framework-2011

    And Yes, I've used and uses the framework of the actor.

  • A generated within a loop in a subvi output data can be transferred to the main program for each iteration of the loop?

    Hi LV users,.

    I have a very basic question, I have not succeeded to asnwer using basic considerations.

    I made a sub - vi that performs a scan of current-voltage using a unit of measurement-source Keithley and a loop FOR.

    The subvi outputs 2 tables with my data (essentially an array of voltage and the corresponding current table). I also defined a Terminal at the exit of a group of these 2 tables in order to plot a graph XY - output. Specifically, I indexed this cluster to update after each iteration of the loop FOR, in my sub - vi (the indicator is placed outside the loop, of course).

    My problem is that I want my main program to display the XY-graph in real time, with an update after each iteration of the loop FOR which is in my sub - vi.

    I have a problem because my sub - vi output terminals are available for the main program concluded as soon as the sub - vi has completed its own execution (which is what we expect of sub - vi to do).

    How can I use a sub - vi (because it's handy) and get in the main program in the course of its performance data that are generated from the loops of sub - vi?

    Thanks in advance for your help,

    Yoyo87

    Elements of the queue in the Subvi them put your main VI where you want to display the data and the.

    It is similar to the architecture of producer/consumer. There are examples of it in LabVIEW. The examples work with 2 parallel loops, in your case a loop (the producer) will be in the Subvi.

  • back to zero 'loop' for Interior "Subvi.

    Hi guys,.

    Silly question perhaps extreme but fast. I have a fairly large VI with several of the Subvi. Inside of these sub - VI, there are some for loops that do not seem to whenever the Subvi is called. While making the analysis of the data, it basically accumulates the data of the previous file as well. For example:

    folder a. gives 4 results of loop for the Subvi

    file B gives 5 results of loop for the Subvi

    Not appear in the final as having 9-results and not the 5 that I expect.

    I've been playing with deletion of points of interest, but I was wondering if there was an easier option?

    your

    Patrick

    Initialize works the cordoning off of the node as a first call, and since it is always in memory it is reset only once.

    (correct me if I'm wrong)

    /Y

  • pass-through of a Subvi to the next level with continuously running loops

    Hi all

    It is a very simple question, for some reason, data available as a Subvi indicator doesn't it up level vi. I think it might be something to do with the while loop I use, but I cannot understand, any help will be appreciated. I don't think I quite understand how data comes out of a loop constantly running.

    GPSdisplay runs a driver called GPS.vi (im not worried for my event structure immediately, which could be bad, but I am yet to test this bit yet) 1 probe should have the values of GPSCluster

    Loop in GPS.vi. GPSCluster (sensor 2) is updated correctly

    I can't work on why the data is not passed to GPSCluster at the top of page vi

    Hi bennymacca,

    I think that you are on the right track with a FGV. You can do quite easily with GPS vi you have.

    Before going further, your GPS while loop will return only the last reading and because the Boolean value of "Read" output state is set to FALSE, it will not stop. You see it out at all? The logic, I read, once entering this while loop, that he will not stop until said.

    There are 3 options you can try.

    (1) use a FGV, because you are looking in. To do this, you need to change the boolean TRUE State and set records in the GPSCluster - to analyze the information around, holding each time the vi is called and you leave. Outside the while loop you will thread to the top of the cluster to the indicator that you want to collect (OR you can have it inside the case statement where you read - be careful here, if).

    (2) in the main code, above the frame of the sequence, you can place the GPS vi while loop (the ' read' a), given the State of the boolean connected to a local variable of the Stop button. This while loop will start depending on how feels LV, wire, one line error for the two while loop and Frame (indicating that the two are to run in a parallel mode), OR you can put it in a case statement and say 'go' when you want to start playback. In this while loop, you can then copy the data to read directly in your variable Cluster that it is generated.

    But with (2), you move yourself away from the purpose of the GPS vi, which would be to bring all the features of the GPS functionality in a vi - which is a good idea.

    (3) put a condition on the State of the Boolean case "Read" statement - just make it TRUE when you want to stop reading the data (do you have a time or a condition, you can check here?). Even by doing this, you would / may still need to shift on your lease registers loop to keep the data for each iteration.

    I hope that all of this help. See you soon. David.

  • Subvi with while loop + event structure works is not in multi tab VI

    Hi all

    I'm developing an interface for the control of a prober using Labview 2012, and I'm stuck with a question.

    First I provide you with a simplified version of my VI control interface and the sub - VI used to generate and manage the mappings of wafer.

    The VI is composed of several tabs: Prober initialization, manipulation of Wafer, Wafer map, status, error.

    The sub - VI can:

    1 / initialize the grid to display the map (Subvi Init grid not provided here)

    2 / coordinates XY for import a txt file (Subvi Wafer map Import)

    3 / view contact information and the index of the sector under the cursor

    4 / and what position die is double clicked and the Boolean 'Edit Wafer map' is true, then the user can change the State (color) of the matrix between die on platelets and selected Die

    My question:

    If I use the sub - VI by itself, it works fine. However, when I use it as a Subvi in the 'Wafer map' tab, the plan does not rise and I can use any features incorporated into the Subvi.

    I suspect that the while loop + structure of the event of sub - VI the bottleneck here.

    However I do not know which way to go, that's why I'd be happy to have some advice and help here.

    Thank you.

    Florian

    The question arises because your hand loop 'for' cycles of 33 times.  In the loop of 32, appears your Subvi and execution is passed to your Subvi.  During this time your main VI expected Subvi in the end, she never does.  You could spend your Subvi out of the main loop of the program and run in a separate process, in order to pass data using queues, but you have to find a way to close the Subvi (i.e. a queue).  By moving the Subvi on the main process, it is independent and you can do what you want to do with the events and others.

  • reentrant VI copies the entire structure VI (of Subvi) when it is called?

    Hello world

    I would ask each of you about the reentrant VI.

    I have a VI (Thread.vi), which is set to reentrant (Preallocated clone reentrante execution) that is called from the main vi using the method run a VI. Reference of vi is open with all of the option 0 x 8.

    When I call the Thread.vi, the original vi clone is created.

    My question is, when the clone of the first level vi (Thread.vi) is created, all the Subvi contains the Thread.vi is also the Subvi originally clones?

    Going to queue named in the Thread.vi when it is called by using the control property value node and using this queue within the Thread.vi (in sub - VI) to control the Thread.vi.

    My problem is that when two clones are created, I can run, stop, and close the two together. But when I want to close the second clone, the Dequeue function reference to queue the first clone. I do not understand what the queue has been obtained with the name in the main vi and spent in the clone of Thread.vi. When I want to close the first clone, it works as it has reference to the appropriate queue.

    I thought that LabVIEW creates entire hierarchy of the Subvi the reentrant VI so when it is called.

    Thank you for your answers and help.

    Tukan

    I'm using LabVIEW 2014 32 b, Windows 7

    You use named queues, so unless you call your clones several times (rather than, say, calling a clone and get running code in a loop for a "long time"), I would recommend not worrying to pass a reference queue for the Clone, but rather the name of the queue.  Get the Clone of its own queue - if the hand is already done, get queue of the Clone will not allocate a new queue, but returns the reference to the queue already created.

    Screws that are used by the Clones can be "specific clone" (if they are, themselves, marked as Reentrant) or 'universal' and shared by all of the Clones.  There is really nothing wrong with that, as long as you realize that while A Clone uses void-VI X, Clone B will be "blocked" when it tries to use the Subvi, if you want to run in a mode of the Subvi '-and-out ", without blocking.  In particular, not to put any function, for example a Dequeue, who must wait in a common Subvi.

    Bob (who has learned this "rule" with the sad experience) Schor

  • Using the table as a MATLAB script for entry into a Subvi - labview crashes

    Hello

    I have problems in creating a Subvi, which includes a matlab file that has a table as input.

    I created a VI, who runs a simple matlab script, with a table as an input and a table as output. It worked well, until I assigned the terminals in order to to use as a Subvi.

    After that the terminals have been assigned, labview crashes instantly when you run the file.

    I also created a VI to test the Subvi, but I couldn't make it work at all, labview always crashed...

    Does anyone know a solution to my problem? They only thing I can think is to not use it as a Subvi, but then my master file will get huge as all the matlab code would be in there...

    attached are two files, so that you can better understand my problem. (test_... is the main file)

    any help will be greatly appreciated!

    -Jarno

    Edit: I'm using labview in 2013 with windows 7 and matlab 2014

    Hey, Jarno,.

    This is indeed a bug, unfortunately. Currently followed by using identification number of the 446431 cause. The question arise when moving from an array of doubles in the Script node. The only 'solution' at the present time is to use an array of singles instead. We are currently looking to identify a fix.

  • Unit Test Framework: Inline Subvi test coverage

    Hello

    does anyone know if the Unit Test Framework considers inline subVIs recursively during the measurement of coverage?

    Consider following the example:

    f(a:int) {}

    g() ;

    }

    g() {}

    If (false) - return 1;

    else return 0;

    }

    Obviously, there is no test for g() with coverage of 100% (branch), and any trial for f() reaches 100%.

    My question is: given a test for f(), UTF gives a different cover if I set to be (Inline g()<100%) or="" not="">

    Thank you

    Peter

    Peter,

    No, the Subvi cannot be analysed for coverage of the code if the value inline.

    Fact is, that this feature requires the option 'Allow debugging' must be disabled (Yes, I hate double-negation!), but if it is not allowed to debug, the code coverage will result in 0%.

    See Help:

    "You have to allow debugging for each VI under test to measure the code coverage. If VI a VI under test properties have not checked the checkbox allow debugging , the result of code coverage will always be zero. »

    Norbert

  • How do I know if a wire is connected to a control (in the case of the Subvi)?

    Hello

    I know if it is possible to know if a thread (calling VI) is connected to the Subvi control or not.

    -There is any function to test a control for whether or not it is connected by calling VI?

    OR

    -J' I test the values of the control's default settings and determine if a wire is connected?

    I hope that my question is understandable =)

    Rob


  • Control an event in a Subvi

    Hi all

    I have a main VI and a Subvi (somewhat complicated one) that works with a structure of the event.

    I need a way to bind a button (the trigger) in this case VI to a button in my main VI.

    I know there isn't an easy way to do it, and I'm a newbie when it comes to references.

    I tried globals, but that doesn't seem to work...

    Can someone help me by telling exactly how can I combine two buttons together (from different VI), so that this will change the specific event (the button is a value Boolean btw)

    THX in advantage!

    What a mess!

    1. try to keep the size of your diagrams in a single screen.  Scroll around to see what's going on is understand (and troubleshoot) a very difficult VI.

    2. get rid of local variables. They break the flow of data, can create race conditions and it is difficult to say what the program does. The WIRE is the variable.  Controls and indicators (and local variables associated with them) are simply the user access point to the value of a variable (the WIRE).

    3. the main program has 3 endless loops running in parallel.  At least one of them has no delay or expected and likely to monopolize the CPU resources.  How to stop this program?  Someone on this Forum said, "Stop a VI using the Abort button is like stopping a car by running it in a tree." It works, but it has (unintended) consequences.

    4. the AVS_Main.vi has a 10 sec wait in the tiny structure which runs in parallel to the structure of the event.  This will make things very insensitive to events.

    5 sequence structures are almost always useless. Stacked sequence structures must be avoided because they hide code, are difficult to extend or change and lead to a right to left wiring.  Use the data flow.  Use a state machine.

    Now to the point of your question.

    6. If it is possible to put in place a structure of the event in a Subvi to respond to the actions of the user on the main façade, it would probably be best for you to have the structure of the event in a loop of its own in the main VI.  Look at the design of producer/consumer model (events).

    I can't be sure that your program is supposed to do, I think it can be done with two while loops in a producer/consumer model, without sequence structures, local variables and not larger than a screen of diagrams.

    Lynn

  • Select variables in a Subvi

    How to choose selected & indicators subVIs controls and manipulate the main VI?

    Is another question, possible to hide some controls in the façade of a VI?

    You should 'thread' them to your connector pane (right-click on the icon-> view Conector pane).

    Yes, you can hide the controls. Go to the block diagram and right-click on the terminal-> Hide Control.

    Felix

  • Stopping Subvi and returns a value of Subvi to MainVi

    Hi all

    I have a MainVI that calls a Subvi. The call in sub - VI of the MainVI is done inside a while loop. If the necessary calculation in Subvi time exceeds say 1 second I want to stop the Subvi and at the same time I want to feed a default value to the MainVI which is supposed to given by the Subvi. With the next iteration, I must call the Subvi again to accomplish my task. Please let me know how this is possible thanks in advance.

    Kind regards

    Magi

    Magi,

    The Subvi terminals will always have a value when the Subvi back.  If you do not set any other value, the value will be the default value. Add a Boolean result to the Subvi to indicate if it has expired or it terminates normally.  That test boolean in primary VI to see if the data value is valid or not.

    The questions you are asking are quite fundamental to how LabVIEW. I suggest you sepnd online some time with the tutorials on getting started with LabVIEW. What you learn, it will be over for the time spent to ask fundamental questions.

    Lynn

Maybe you are looking for