In the Subvi VI main event

Trying to raise events from a main vi.

I created an example vi as a basic unit of a much larger program.

The high level vi called a Subvi that contains a structure of the event.  The Subvi works permanently and will close when the program is stopped by the user.

The upper level has controls that are passed to a global and overall can be read in the Subvi, which should trigger an event.  (it is not)

The Subvi should be able to run as a Subvi or higher.

For context:

The project, of which this comes is a test system.  The Subvi prepresents the control panel main for the test system.  We want to automate the test system and so to use as a Subvi main control panel so we can automate a number of individual test.  (Frequency response, gain of linearity, etc..)

See below for additional attachment that contains the file project and global variable (can attach only 3 files at a time)

The overall is just a stop button and a cluster that contains 3 Boolean values.

It does not work, I was hoping someone could explain to me how to do this without making many changes to the existing Subvi.  If necessary, a case statement could be added which is active when the program works as a Subvi, which would contain the code to raise events to the occurrence can cope.

I'm looking at the code, now, I'll update the congratulations if it works

Tags: NI Software

Similar Questions

  • Crashes Subvi VI main

    I have a main VI with a front with several indicators.  I unloaded several indicators to a Subvi to my main table less frequented.  I want to start this sub - VI when the user clicks on "more" on my main VI.

    To do this, I created a new event and recorded for a mouse, an event on the button "more".  Inside this event, I put only my Subvi.  I right click and choose the Subvi node installation, then checked the "display front panel, when it is called ' and 'close while initially closed then' check boxes.

    The Subvi launches as planned when I click on "more".  The problem is, once I close the Subvi, my main VI is locked.  I can't do anything at all.  It nothing happens in the Subvi... No loops, no logic... just now, it's just a collection of flags.  If I click on the button "cancel execution of ' in my Sub, and then he quit as my main.

    My suspicion is that - as far as my main VI is concerned - my Subvi never stops running.  How to achieve this?  There is no real indicators user interaction just the Sub... the user it would be watching and then close the window under VI.  So I guess what I want to do is abort only the void VI when the user clicks on the X in the pane of VI.

    Thanks in advance for the help.

    I see exactly what is in your sub - VI of the image.  But I do not see a queue and a Structure of the event.  Or the other of these situations could cause a situation of 'wait infinitely.  The Structure of the event is the likely culprit here however.  In fact, I like to handle the event before narrow Panel if you already have the structure of the event.

  • Control a Subvi VI main using the event Structure

    Hi all

    I'm moving hand Vi VI Sub values...

    However, my Subvi works with a structure of the event. (Change in value).

    So when I run my main VI and I press the highlight (yellow bulb), the sub vi does not run...

    I'm sure... I m missing something very basic.

    My main and the Subvi operate with a structure of the event.

    Please see my attached files.

    Each event structure listend to a button to calculate different: one on the respective fromt Panel. (Even if they have the same label, they are completely separate!)

    Events are mainly for any user, they won't be triggered if a terminal is written by program. If the front panel of the Subvi is closed, you cannot press the top button.

    Can you explain the purpose of your exercise? You seem to confuse you upward in some misunderstandings based on the flow of data and events.

  • Reference to the control on the main façade fails the Subvi front is closed?

    Hi all

    I meet a strange bug. In my code, I use a Subvi to control a piece of hardware. The Subvi has commands for all functions of my hardware.

    I changes the value of one of these controls in my main façade by running a reference to a button on my main façade in the Subvi, grabbing the value of the button with a property node, then update the value of the Subvi control using a node property signage.

    This works very well when my Subvi front is open, but does not work the Subvi front closing.

    I am new to labview, so any help is appreciated.

    Thank you

    Rachid

    This event triggers a series of writing for the real hardware. The material is sent only a command when something changes.

    My code is made up of handlers inside functional global variables. In this way, I can send different parts of code of different orders (example: reset and reset) with the events generated by programming.

    The value of the wheel of the page main itself, according to my probes, getting through. It's the Subvi button that is having a problem.

    I work under a certain pressure of time pretty important, so I managed to convince the boss that the front panel of the Subvi open does not violate the requirements of the application. I guess this has solved my isse.

  • How do to update and refresh the main panel image appears inside the Subvi?

    Hello world

    I have an image to display the command that is in my main draw, and I have a Subvi making some process works inside.

    But what I did inside the Subvi cannot be seen in the main panel.

    I used the image session controls than nodes input/output for Subvi.

    If I use the view control image as input for Subvi node,

    I see that the actual time appears in the Subvi Panel,

    but this isn't what I wanted.

    someone at - it wise?

    aricn wrote:

    BTW,

    inside the Subvi, I pass the transformed result the Vale to property node or the Vale (signal), even I call the metheod "refresh view", nor have the effect.

    Strange.

    For example, it is your main VI (where is placed the Image display):

    It's your Subvi, where poster Image is updated by reference:

    Now, image display updated in Main.vi Subvi:

    Project (LV2012) as an attachment.

    Andrey.

  • How can I display a variable evolution in a Subvi on the face before of the main vi as the Subvi is excuting

    In the attached document the vi on the right is sub to the vi on the left. On the Subvi on the right of the variable "playing field" is continuously updated on the façade of the Sub - VI as the loop 'for' is executed, but only the last value of the variable is updated in the table main before vi which is what is expected. My question is how can I display the evolution of the value of 'Playing field' on the main façade of vi that the loop 'for' in the Sub - VI is running?

    Thank you.

    I don't have the drivers you are using. But here's an example of how update an indicator of a Subvi. To create the reference control in the Subvi, select control refnum in refnum palette and drag a numeric (or other) on the refnum control.

    VI the appellant

    Subvi

  • Main table according to the Subvi indicator

    Hi all

    I have a Subvi, reading of files and make a multi-terrain with data XY Chart. Part of the Subvi code also puts some properties of the graphical indicator XY, using a property node, such as styles and names of the plot. When run as a stand-alone, it is fine. But then I have to run the VI in the frame as a larger program. XY graph indicator is an output of the Sub - VI, and in the main program, I have a light connected to the output of the Sub - VI generate the graph.

    But it does not work. The data is there, as expected, but none of the properties that I put in the Subvi, which is also logical because they act on the light located in the Sub - VI, but not that of the main program.

    Is there an easy way to have all the properties of an indicator within a Subvi be transferred to the indicator to which he is connected in the main program?

    Thanks for your help,

    Sam

    You pass a reference to the curve that you want to assign to the property.  You could make the graph on the Subvi by default so that it still works as a stand alone.

  • Structure of the event does not clear the queue after his release from the Subvi

    OK I'm not sure if this is a stupid question or not...

    I was trying just a few tips and stumbeled on this problem...

    So I created a sample (not exactly)

    In qqq_Main.vi just press PressMe

    (it opens a Subvi qqq.vi)

    There are two buttons to stop "Alt1" and "pylone2".

    To close the Sub - VI press either on "pylone2".

    or press "Alt1", then "pylone2".

    with the latter method of the value of closing change pylone2 is registered outside the while loop and after the closure of the Subvi should not it be erased? (Or should manually clear us it?)

    For this reason not clear, the second time I press 'PressMe' change the value of pylone2 even goes off before you press anything

    I can't look at your code at the moment, but according to your description, it seems that the system works as expected. I guess you do a completely static record of events (open the event configuration dialog box and select the controls and event).

    The first thing to clarify is your use of the term "registered". In this case, it's a problem, because the registration in the context of the protests means asking to receive the event when it happens.

    Now that you know it's important to understand where the recording is happening, because that's what determines which events are stored in the queue. When you use this type of static record, registration happens from the VI the event structure is in run mode (Note: this does not mean that the VI is actually running, but just that it's the of running or reserved for the race) and the cancellation of registration only happens when the VI mode of execution. Who is right for which you get the events in the queue of the previous run of the VI - the VI is still in run mode, then the event is added to the queue and still waiting in the queue until the structure of the event to run again.

    You can work around something like that by switching to dynamic registration of events, where you can unsubscribe to empty the queue at the end of the VI, but requires more code. Also, in 2013 LV there are a few features added to events that could allow to do this statically (I don't study all the additions, so I don't know if this is possible for static recording).

    There is a good presentation on the events of NIWeek 2013 by Jack Dunaway. You can find details of how to download the video here - http://lavag.org/topic/16091-ni-week-2012-videos/

  • The main events in AWR report

    Hi all

    11.2.0.1

    AIX 6.1

    I had this big event awr report.

    Can you help me how to interpret this please. Or what is the value of looking here?  Thank you very much

    The main events in AWR report

    I have

    n

    Snap              s       Snap                                                                                                    A

    Snap the t hard event time start Avgwt DB A

    Time event ID # (m) expected grade (s) (ms) % S waiting class

    ------ --------------- --- ---------- ---------------------------------------- ----- -------------- -------------- -------- ------- ------ ---------------

    13902 13/09/16 09:00 1 60.05 os thread start 1 140,00 11.08 79,11 56 0,0 Concurrency

    13902 13/09/16 09:00 60.05 1 CPU time 2 0.00 0.00 9,45 48 0.0 CPU

    13902 13/09/16 09:00 1 60.05 log file parallel write 3 1506.00 1.84 1.22 9 0.0 IO system

    13902 13/09/16 09:00 1 60.05 control file parallel write 4 1291.00 1.41 1.09 7 0.0 IO system

    13902 13/09/16 09:00 1 log file sync 60.05 5 721.00 1.03 1.43 commit 5 0.0

    13903 13/09/16 10:00 1 60.05 os thread start 1 138.00 10.36 75,10 47 0.0 Concurrency

    13903 13/09/16 CPU 60.05 1 10:00 hour 2 0.00 0.00 10,28 47 0.0 CPU

    13903 13/09/16 10:00 1 60.05 log file parallel write 3 1575.00 1.73 1.10 8 0.0 IO system

    13903 13/09/16 10:00 1 60.05 direct path read 3 486.00 1.73 3.56 8 0.0 IO user

    13903 13/09/16 10:00 1 60.05 control file parallel write 4 1285.00 1.51 1.17 7 0.0 IO system

    13903 13/09/16 10:00 1 log file sync 60.05 5 823.00 1.08 1.32 commit 5 0.0

    13904 13/09/16 11:00 60.05 1 CPU time 1 0.00 17,06 0.00 CPU 32 0.0

    13904 13/09/16 11:00 1 60.05 os thread start 2 145.00 10,65 73.46 20 0.0 Concurrency

    Thanks, I just tell the users, there is no problem in the comic book, and the stats is normal and no suspiscious activity and that the problem is in the minds of users only.

  • Open and close the Panel the Subvi front

    Hi all

    Run LabVIEW 2011 on Windows 7 x 64.  I am trying to get a Subvi front to open from my main PC with the touch of a button, then close with a button press in the Subvi.  Here's the piece of my main FP who calls the VI and opens the FP

    Locations is defined in another loop and all loops are in a flat order.  I made this way because I want to start with the first press and not stop my main loop to run.  So I don't know if I can run in the same line as the event or not, I've moved the element to the left loop around a lot.  Anyway the VI of openness seems to work very well.

    The problem arises when you try to close the Subvi for the SECOND time.  The code is here:

    As I said, the first time I open and close the VI everything works as it should, hopefully.  Then, I am able to reopen but now 'empty' button does not work and I can't close the window or even to open the block diagram to probe anything.  I tried to understand this point for a while, any insite would be greatly appreciated!

    Thank you

    Found my problem, I had the wrong boolean on one of my other events.  If this seems to be a good way to open/close a Subvi if anyone is interested!

  • Read the indicators continually the Subvi execution

    Greetings,

    Number of previous threads about this problem. However, it looks like all the need of huge changes to to the Subvi.

    Now, we have a bunch of Subvi programmed by different programmers, but at the end it is difficult if we combine all the indicators in each Subvi and display the values in the façade of a single main vi, without big changes for each Subvi.

    Control reference using will be a solution, with some changes in the sous-de VI, but it seems that the main vi and Subvi need to run at the same time. We cannot run only a Subvi himself then.

    Variable overall is another station, however, we have a huge amount of indicators, creating global variables for each indicator in each Subvi seems like redundant procedures.

    '

    I wonder if there is a way to create a main vi shell-like read these indicators permanently without needing to touch the inside of each individual Subvi. Or please let know us if you have better ideas.

    Thanks in advanced for any comment.

    -chen

    I was not involved in all this other discussions that you mention, so I can only go off of what you have described in your post. So the questions I ask are:

    -Don't the SubVIs run continuously (called) before the end of the application?

    -How to stop the sub live? You are reliant on the controls on the front panel (for example, a stop button)?

    If you'd rather not touch the sub live, you could put the sub sub-panels in the main vi screws. This would allow you to expose their facades, hosted in the main vi. Search for Sub panels using LabVIEW or online. It would also expost controls too, but you can customize the front of each to hide these off-screen, so to speak. There is also a VI properties that allow you to programmtically re - locate originally and resize the front panels in order to ensure the proper display.

    If this does not work for you then I think you should take a hard look at your architecture. Sometimes you can get so far from Shoemaker to things together. Look closer at all misconceptions of what a VI is actually and what calling a VI in an another VI means in fact (you're basically calling a function with some extras added as a front panel). There are ways to get what you want by programming, but they are hard work, not very easy to manage and can be more effort than other solutions.

    My strategy of choice? Use a messaging system any to communicate between your objects in your system. You have your items (hand UI, each Sub VI is a small entity of independent work of others) and you can use one of the buildings available to you through LabVIEW base (notifiers, queues, events user Global Variables (yuck), FGVs etc.) to allow these objects communicate with each other.

    But I guess you've heard all this before. All I can say is that "they are right". Sometimes there is no better solution for the bad design to re-design.

  • stop Subvi nonstop main VI

    Hello

    I a Vi that has a Subvi within a structure of the event, and this sub - VI runs a measure, and to stop it that I have implemented the code for that ater the measure that ends the program stops, by using the STOP button, which is the same as pressing the run button abandon.  But which also stops the main VI.  What I want to know is y at - it a way to stop this Subvi without stopping the main VI

    You should never use the node to STOP unless you use it for debugging.

    Your code should follow the best practices of data flow and you can stop all your curls using Boolean logic. Within your Subvi, you will need to find a way to stop the strap using Boolean values. This can be done 1 million different ways according to your code.

    Looks like maybe you must specify the Subvi to prevent outside the Subvi? This can be done by using an architecture of the queue waiting, a notifier, or similar. I suggest that take a look to different architectures if you aren't familiar.

  • indicate the end of the loop to the Subvi state information user

    I hope that I can adequately describe this as an example would take time.

    I have a test that implements a chip by using a scheme of control in series. This takes place in a Subvi. When the control bits that all entered the chip, a flag is asserted. I want this indicator to display on the front of the parent company of VI. The parent VI runs the Subvi iteratively until all the test cases are covered. A user dialog box interrupts this main loop to give time for the user to physically move a probe. I would like to indicate to the user that the test conducted in the Subvi is over and he can move the probe to the next test point.

    If I do a link with the flag in the Sub - VI the indicator on the main façade follows the status of the indicator in the Subvi through the first iteration, but then stays like that, even if the flag is disabled in the Subvi at the beginning of the iteration.

    How can I get an indicator in the main VI to display the status of the indicator in the Subvi?

    As Dennis said, it's a matter of data flow.  The Boolean value is passed out of the Subvi that once completed the Subvi.  At this point, your GUI indicator is defined with the value coming from the Sub - VI.  What I suggest is to erase this GUI indicator just before running the Subvi.  I does not affect the Subvi at all, only the indicator is on your main façade.

  • Pass data to Image update Subvi VI main

    I try to get under VI containing a for loop to pass data to an indicator on the main VI update. I followed this explanation...

    http://digital.NI.com/public.nsf/allkb/0F4EA104660C0AF38625726F0069B27E

    .. .and am able reproduce the example with a digital command, but I was not able to extend the example to an indicator of image output. I suspect that I use the control bad, Refnum reference or property. Can anyone suggest corrections?

    Details:
    I use a control reference [line] to a [Picture] indicator of my main VI [Center of manufacturing] to the Subvi [SUB mask display].

    I placed a Refnum control on the front of the sub - VI, he linked to a property on the block schema node, selected the property "Value" and hooked up the output of the image of a VI IMAQ to this property.

    If 'Run of Images' on the sub VI is set to FALSE, a static image 'test0.jpg' must be returned to the main VI. If 'Run Images' is set to TRUE, a loop is supposed to pass 'test0.jpg', "test1.jpg", etc. to the main VI at regular intervals. Instead, the indicator Image is empty.

    Hi MaryamAli,

    I think you are doing everything correctly but you are having your image inside the Subvi so the will of image ever seen in the main VI. Try to remove the IMAQ dispose VI in your TRUE and FALSE cases and see if it works.

    Tim O

  • Graph XY what yscale.namelbl. Text does not update when vi is called the Subvi

    Software Lab that we wrote, use us (with a worm 7.1.1) a Subvi, set up to print at the end to print the results of four charts XY. Units selected in the main vi Engr is passed into the Subvi through the connector pane. I extracted the EU text here and write to YScale.NameLabel.Text using nodes property. It works very well in development by operating its own front panel, but not when the Subvi is called from the main vi. Maybe it's a known bug? With a workaround? I tried delays, separating the operations with the structures of the sequence, etc.


Maybe you are looking for