Control to subvi

I am trying to send a numeric control input to a sub vi.  going from other examples I have created a reference (digital) in the main vi.  then i create a control refnum in the sub vi.  but i cant figure out the proper way to connect this to a property node of the control input in the sub vi.  their types are different, and unlike in the examples i have found there is no wire for ref input?

Right-click on the reference in the main VI and select "Create Control". Copy that control onto the subVI's front panel. In the subVI, place a property node from the "Application Control" palette. Or if you already have a strict property node, right click it and select "Disconnect from control".

Similar Messages

  • Mouse down event handling of table control in subvi

    Hello Everyone.......
    I have created a vi which has a table control and xy graph... the function of the vi is to plot the data of two particular column of table into xy-graph after user selects the data from table....  In this vi , I have used mouse down event for selecting data set so that the color of selected row get changed for user reference.......  the vi is working fine..... 
    My problem is that this vi is a part of main vi.. and I want to use this vi as a subvi.... So, in my main vi I have a table control which is connected as input to the subvi...  I come to know that I need to register event for triggering a event in a subvi.......
    (1) How to register Mouse down event of table control which is on Main Vi to trigger mouse down event of table in subvi.... Another Important thing is... how to link every property of table control of subvi to the table control of main vi... so it just act as single control adapting every property like when user selects a particular row its color changes in subvi....so it should be reflected even if user selects a row in main vi... I mean table control of main vi and subvi should be a single control...is it possible?
    I hope I am clear......Thanks ..

    See the modified version of the VI. I use the 'Point to Row Column' method to get the cell that was clicked on - your method also worked using 'Selection Start' but I thought I'd show you an alternative.
    I've used a single event structure to update two table controls - the point is that if you have the references to the controls you can update the control from anywhere. You can also 'register for events' to allow you to register for events from a different VI (again, using the references) that doesn't have the control on the front panel.
    Couple of things about your VI:
    You don't need to put a wait node if you have a timeout on your event structure.
    You don't need the for loop for the columns/rows - if you look at the help for the 'Active Cell' property you can use a value of -2 for the row/column to select all cells in the row/column.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets
    Attachments:
    Highlight Selected Row in Table Control_lv2009.vi ‏13 KB

  • Send name and value of control to subvi

    Hi all
    I am trying to send the names and values of controls to a subvi. 
    I know that I can extract the name and value of the control using a property node, but I was looking for a way to make is easy to use for the programmer.
    I am thinking of some kind of bundle function, it saves the name and value of the control, but I would like the programmer to be able to connect a random number
    of controls to this subvi without having to specify the number of controls anywer.
    I know there is configuration file stuff in labview, but it looks a bit more complex then what I want to do.
    Also i know that I can use the OpenG toolkit, but I'll rather not use any add-ons to labview, as this VI might be running on many different computers.
    Hope I made my problem clear enough! 
    Have a nice day
    Regards
    Tommy
    Running LabVIEW 2009 32bit SP1 on Windows 7 64Bit
    Solved!
    Go to Solution.

    tombech wrote:
    Hi all
    I am trying to send the names and values of controls to a subvi. 
    I know that I can extract the name and value of the control using a property node, but I was looking for a way to make is easy to use for the programmer.
    I am thinking of some kind of bundle function, it saves the name and value of the control, but I would like the programmer to be able to connect a random number
    of controls to this subvi without having to specify the number of controls anywer.
    I know there is configuration file stuff in labview, but it looks a bit more complex then what I want to do.
    Also i know that I can use the OpenG toolkit, but I'll rather not use any add-ons to labview, as this VI might be running on many different computers.
    Hope I made my problem clear enough! 
    Have a nice day
    Regards
    Tommy
    I am not sure what you have in mind Tommy but lets rule out the rediculous.
    You can find a Nugget I wrote here that explains how I managed to write an Save/Restore function that will automatically adapt to a type-def'd cluster. THat Nugget include my original source code as well as a full description of what where why and how.
    I have used that code in multiple applications and it has demonstrated that it works.
    No not all data types are supported! I left that as an exercise for the reader.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Problem with one control in Subvi to use in MainVi...

    Hi,
    I'll try to explain easy. I have my application with main window, where I do calculates and have one graph data. I use subvi to open the serial port and when I close the subvi, the data is drawed in the mainvi graph. Now I am trying to implement one option to do several test from serial port automatically. I want to have one Control Bottom in subvi, that when I active it, When I close the Subvi acquisition data, automatically active the save bottom and save the file and THEN open again the subvi ready to acquire another run of data. So I only need to start/Finish the data entry and it will going save diferent test in file.
    I tried several things, but I have the problem when I active the option. In the first time, appear me BEFORE the execution of Subvi than the option to save the file. In the second run it seems works well, so 3rd,... the problem come when I disable the option in the Subvi and when I close the window in the mainVi the values aren't changed and appear the new save option and Subvi several times, until the iteration change and put 0 value and it works normally again. I am trying to retard the for/else 1 or 2 iterations but I dont know to do it, since The iteration value is increasing from starting the program and when I open the Subvi it only stops to count and when I come back again to Main continues with the last value. I would need the iteration of loop reset to 0 to say to the for/else to wait 2 iterations or use any counter... I tried to do it, but I spent my ideas.
    I tried to do one example program in Lv7.1. 
    It have the same structure and the same problem that in my program. In this example even I can't close the subvi between it is saving and re-openning it. I suppose since It is so simple, the active value do the subvi open directly.
    I hope you tell me any idea to do it.
    Regards, Fonsi.
    Attachments:
    Main.vi ‏55 KB
    Subvi2.vi ‏14 KB

    The reason why you seem to need that "extra run" is due to a race condition. If you watch your code in highlight mode you will see this. You have 3 independent case structure. Let's say you start the VI and then press the "Start Test" button. The main VI is now executing the True part of the top-left case. Meanwhile, the other two case structures are executing since there is no data dependency. They see the values of the local variables as they were when you pressed that "Start Test" button. You set the "Active Multiple Runs" to True. The top-left case ends, and now the loop can go to the next iteration since all code has completed. In this iteration "ActMultiple" is True, so in the bottom case structure you execute the True case where you delay for 0.5 seconds, and then set "NewRun" and "MultSave" to 1. Meanwhile, the other two cases have already run. You now finish this iteration and move to the next. In this iteration the top-left case evaluates to True since "NewRun" is 1. So you get the dialog. While the dialog is up, the other two cases have already finished. You set the "Active Multiple Runs" control to False. The subVI ends, "ActMultiple" is set to False. and the loop iteration completes. Next iteration. Even though "ActMultiple" is False, you are probably thinking that you will get the "NewRun" and "MultSave" set to False because of the bottom case structure, so the top-left and top-right should see the values. This is not what happens. LabVIEW will read the values of the local variables before you enter the bottom case structure to set them. This is the race condition.

  • Set control in subVI

    I would like to set programmatically a control in a SubVI via VI server - how can I do this?
    Thanks
    Urs

    Zip the attached to a folder.
    Run the main.vi
    Sub.vi will be called and opened
    Change settings from within main.vi
    (Observe changes to the controls in Sub.vi)
    Best regards
    ian.f
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    VI_Server_example.zip ‏47 KB

  • Controlling a SubVI with while loop from another VI

    Dear All,
    this might be an easy Question but i couldn't catch an answer for it.
    first of all i have a VI which i will use as a subVI , this VI  is simply as shown in the "test_out of scope.vi" attached file
    now i will use it inside another VI called "Main VI" as shown in the file "Main_VI.vi"
    i'm just wondering , why couldn't i control the "Frequency" and "Stop" as i can do so while running the SubVI only without accessing it from another VI ?
    isn't it possible to access objects inside a while loop from another VI if i just connected them in the connection Pane terminals ??
    Thanks in advance to everybody
    Message Edited by Mohammed.Ashraf on 06-09-2009 10:27 AM
    Eng. Mohammed Ashraf
    Certified LabVIEW Associated Developer
    InnoVision Systems Founder, RF Test Development Engineer
    www.ivsystems-eg.com
    Attachments:
    Main_VI.vi ‏10 KB
    test_out of scope.vi ‏30 KB

    Do you need the sub-vi to run iterations for an undertermined period of time? 
    If so, then why not implement it as a parallel loop to the main one.  Maybe part of a consumer loop.
    If not.  Where the main loop would take care of each iteration and call the sub-vi in one shot. Then no need for a loop in the sub-vi.  
    It's all a matter of how you want the software to behave.  Have you looked at Event Structures?
    R

  • Creating a full VI controling several subVIs

    Hi everybody,
    I've now almost finished my project and I have to control all my VI thanks to a single VI in order to make VIs run one after the others.
    I've looked at the section "creating subVIs" in the LabView help but there is a step I don't manage to do. They write about the connector pane for each subVI and how to set inputs and outputs from the mother VI but I didn't find the way to do that.
    Can you help me with this ?
    I you have any idea about how choose and set inputs I want for each subVI in the mother VI and how to recover ouputs in the mother VI let me know...
    Thanks a lot
    PS : I work with LabView 8, windows 2000, the Base Package...

    It's quite straightforward.
    1) remember that any control in your subvi can be an input and any indicator can be an output, so if you don't already have  all needed controls/indicators, create them
    2) right-click on the subvi's icon and choose Show Connector: you will see the icon area probably divided into small rectangular areas; each area, named terminal, can be choosen for an input (wire to the sub-vi) or an output (wire from the sub-vi)
    3) if you are not satisfied with the current connector (very probable), you may: add a terminal, delete a terminal, choose a specific terminal pattern, etc.: all this is accomplished right clicking on the connector and choosing functions from the context menu
    4) once you have your preferred pattern, assign terminals to controls/indicators by clicking on an unassigned terminal and then on the choosen control/indicator
    5) save the sub-vi
    6) add your subvi's to your main vi and wire inputs and outputs accordingly to the program's logic
    Paolo
    Paolo
    LV 7.0, 7.1, 8.0.1, 2011

  • Execution conflict between a SubVI and a while loop

    Hi,
    I have wired the conditional terminal of a while loop with a boolean control. The same boolean control is responsible to terminate a SubVI (not inside the while loop) which also contains a while loop (I am using a reference to the control here). When I first use the boolean control, the SubVI is being terminated, but the while loop in the main VI is not. In order to terminate the main VI, I have to use the boolean control once more. In order to avoid that, I created a "status"-indicator within the SubVI, which is set to true once the SubVI is terminated, and wired that from outside the main VI's while loop to its conditional terminal. Of course, now the while loop does only execute once the subVI transmits the status value.
    The thing is, I want both the while loop to execute before the status value is being transmitted (so, only the conditional terminal is supposed to wait for the value) and use the boolean control only once in order to terminate the VI.
    Any ideas?

    Ok.  I kind of expected to see this.
    First of all, change the "Control: Mouse Down" event into "Control: Value Change".  DO NOT USE  A LOCAL VARIABLE!!!  Wire the result straight out to the termination terminal.  You want something like this:
    Your writing to a local is a race condition.  The control was read before you wrote to it.  Therefore the loop was going an extra time around.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Stop loop.png ‏13 KB

  • Multiple subvi's in main front panel

    Hello and welcome (it is my first post here),
    sorry if such subject was already risen, however I don't know how to specify it exactly in terms of LV nomenclature (I'm a beginner in LV) what makes it quite difficult to search the forum.
    I need to create an interface with user specified number of input channels (specified during application work, so dynamic loading is necessary). Each channel is to be controlled by subVI. I'd like to load panels of all running input subVI's into some container in a main front panel (similarly to subpanel, but loading multiple VI, not single one). Is there a container capable of this? Is it at all possible in LV?
    Regards,
    kaolpr
    Solved!
    Go to Solution.

    You can use multiple subpanels. Unfortunately the number of subpanels must be set during development. You could create a method of cycling through your various channels. This would involve loading and unloading the multiple subpanels that you do include in the UI.
    Another alternative would be to use a table or something similar. Have your subVIs post updates to the UI code via queues, notifiers or user events. Tables are much easier to manage when your number of elements varies. If you need to have the UI pass information to the subVIs it can also use queues, notifiers or user events.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Can strictly type refnum control do type coercion?

    Hi all,
    Can strictly type refnum control do type coercion? NI says yes:
    A control refnum terminal that is strictly typed can only accept control references that are strictly typed to a compatible type. For example, if a subVI expects a control refnum of type Slide(Int32), you can wire a control reference of type Slide(Int32), Slide(Int8), or Slide(DBL), but not of type Slide(Cluster of DBLs). Wiring in the Slide(Int8) or Slide(DBL) will result in type coercion (no error) and thus a coercion dot as these representations are being coerced to Int32. Wiring the Slide(Cluster of DBLs) will result in a type conflict (error) and thus a broken wire. This is because the Int8 and DBL are numerics like the Int32 and can thus be coerced to be of Int32 representation. The Cluster of DBLs however, is not a numeric, but a totally different data type. Therefore, a cluster being of different data type than the numeric will result in a type conflict if wired together. Strictly typed references are most beneficial when you know exactly what type of data you will be using.
    http://zone.ni.com/devzone/cda/tut/p/id/3159
    I have seen this help file for long time, and been confused by it for long time. I don't think strictly type refnum control can do type coercion. If I put a U8 Enum refnum control on subvi's front panel, I can't connect it with a U16 Enum refnum control.
    I don't know if I am right. 

    What is an "enum refum control"? Can you attach a small VI containing the various controls?
    steady wrote:
    Besides, I don't know what Slide(Cluster of DBLs) is. I can't generate such data type.
    A slide control with multiple sliders is a cluster datatype. One cluster element per slider.
    Just place a slide, right-click it...add slider. Voila!
    LabVIEW Champion . Do more with less code and in less time .

  • Save, edit boolean controlled stopwatch

    Hellow Fellow LabVIEW users
    The attached is a stopwacth corresponding to this earlier forum post.
    http://forums.ni.com/t5/LabVIEW/Reentrant-Boolean-​Array-Controlled-stopwatch-SubVI/m-p/1334916#M5427​...
    I want to add to the solution and make my VI do the following 
    a) With each iteration, I want the VI to save the values in each individual stopwatch, so even when the program closes and is reopened the values are intact.
    b) When I press the "Edit B4" boolean an "Edit Time" control and "Edit and Save" boolean control array comes up. I want to be able to change the values of the original indicator array when I press the "Edit and Save" Boolen as well as revert back to the original array with the new values. 
    c) I want these new Array values to be saved with the new iteration. 
    I believe I should use an event structure.I also plan on using the SubVI 12 different times. Please let me know how I shuld proceed in this regard. Your help as always is greatly appreciated and needed. Please let me know if you need further clarification.
    Thanks
    mhaque
    Attachments:
    timer snapshot arrayMODsubVI.vi ‏247 KB
    CallTimerSubVI.vi ‏247 KB

    Drew answered the question about saving between runs, but I think your problem is much simpler
    mhaque wrote:
    a) With each iteration, I want the VI to save the values in each individual stopwatch, so even when the program closes and is reopened the values are intact.
    What do you mean by "intact"? Should the program continue at the times where it stopped of or should it account for the time where the program did not run? For example if you close the program for one hour and start it again, should all active timers be one hour higher?
    In this case you simply want to write the current contents of the start ticks feedback node and the boolean states to a flat binary file whenever they change (probably not very often). Use a file with a fixed name right next to the executable. Open the file once, then use lowlevel file IO for the duration of the program run and close when the program ends.
    When the program starts, you can use the "first run?" primitive to reload the data into the shift registers as needed.
    Make the subVI a proper action engine with several modes (init, normal run, overwrite timers, end, etc.). Remember, to customize the timers, you need to overwrite the shift regsiter contents inside the subVI.
    Your use of property nodes is a bit clumsy. You don't need to write to all these property nodes with every iteration of the loop, they only need to be written when the boolean input changes (property nodes are relatively expensive because they force synchronous execution). Instead of the property nodes, you could just use a tab control with two tabs (e.g. run|edit) one containing the timers and one the edit time array. This eliminates the boolean switch and all property nodes.
    What's the maximum duration of a program run? If it exceeds 10^32ms, you probably need to switch to timestamps instead.
    Use a simple event structure in the toplevel program with the bulk of the code in a 1000ms timeout case. Add cases for "stop:value changed" and "edit time: value changed". 
    LabVIEW Champion . Do more with less code and in less time .

  • Link between multiple subvi

    I am programming an application to control two differents instruments. My applications has to be modular, so I created multiple subvi. I have problem when I passed the parameters between the differents subvi. Because I have a lot of controls and indicator, I use cluster to pass them between my subvi. But, I have a problem because when I do changes in a cluster, I have to modify all the subvi than include this cluster. I was wondering if there was a better way to pass indicator and control between subvi.
    Thank you

    Initially, you will need to replace all the control clusters in your app with the type def control cluster (using All functions - select a vi..'). No way around this (i think).
    Then, if you wish to add a control to the typedef, right click on the type def, select 'Open type def', add the control to the cluster then Save. This will update all the clusters in your app.

  • Disabling further events until subVI closes

    Hi All.
    I'm having an issue regarding mouse down events that continuing to register altough another control is on top.
    As can be seen in 1.vi attached
    when I press the control "1" , subvi 2.vi opens, but if i continue to mouse down the control (on the same place) and then closing 2.vi I get that that 2.vo pops up again
    It's like the String doesn't cover the 1 and 2 controls.
    after pressing 1 or 2 and 2.vi pops I would like to disable further events until I stop 2.vi execution
    Modal is not an option for me sue to graphics issues
    I have also tried to "cover" 1 and 2 control with boolean but witout success.
    Any ideas?
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    1.vi ‏16 KB
    2.vi ‏7 KB

    KJmaster wrote:
    I can't use modal because when u run a modal window it gets a 3d frame unlike float window who has a flat look.
    I'm not seeing this at all.  What settings were you using?  Can you post a screenshot?
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • SubVI design

    I am currently designing a testing phase for a program to control a motor that I can runMotor.vi.  Given a set of parameters, I can run the motor and record its characteristics.  I've wrapped runMotor.vi into another new vi called testMotor.vi which calls runMotor.vi several times, but with different parameters defined within testMotor.vi.  Now I want to include this testMotor.vi into my main code as a diagnostic test prior to running the motor in a normal routine.  I want to control the subVIs from the main front panel so that when I press the stop button, the message is conveyed to the subVI.  This is a design question in terms of how to lay out the subVIs to provide for greatest control from the highest VI.  Should I create an occurence in main, testMotor.vi, and runMotor.vi so that upon clicking STOP in main.vi, there's an immediate response in the subsequent subVIs? I'm trying to avoid using global variables.
    Any comments would be appreciated.

    Duplicate thread, see: http://forums.ni.com/ni/board/message?board.id=170​&message.id=242599&jump=true
    LabVIEW Champion . Do more with less code and in less time .

  • Re: exit from a while loop in sub vi

    I think the mail didn`t get through first time. Repeat posting - Sorry if
    this occurs twice
    Shane
    Hallo,
    Can the use of occurrences solve this problem?
    The Main program can create an occurrence which can be passed to the
    sub-VIs. Upon pressing the button to cancel the loop, the occurrence can be
    set, instantly transmitted to all other VIs sharing which were passed the
    same occurrence. Of course a small handling routine has to be written (say
    a sequence parallel to the executing while loop waiting for the occurrence
    and then setting the exit parameter to "true") but this is trivial.
    I have checked this with a small program splitting an occurrence to three
    seperate VIs and it works.
    If you want, I can send a cop
    y of it.
    It may well be possible with notifiers or something else, but I have far
    less experience with them.
    Hope this helps
    Shane
    >pcu schrieb in Nachricht
    ><[email protected]>...
    >>Main vi has several sub-vi's. Each sub vi has a while loop and Boolean
    >>button. When program runs, sub-vi front panel appears, and I can
    >>stop/continue the while loop. But when I stopped a while loop in a
    >>sub-vi, I cannot control other while loops in other sub vi.
    >>I need exit function from a while loop, not stop function of entire
    >>program.
    >>Thanks.
    >
    >
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

    The notifier is probably better than occurence at this case - than it is not neccessry to write a parallel sequence.
    The use of notifier is very simple, just follow an example in Help/Search example -> Advances -> Execution control -- Synchronization -> SubVI notification.
    Good luck
    Ferda

Maybe you are looking for

  • Questions on heat, hard drive, graphics 1.5GHz

    I am considering a new Powerbook 12 inch to replace the 15 inch TiBook I just traded in at Powermax -- stretching the budget to the current 15 is tough, especially when there still seem to be at least some firmware questions if not hardware -- and th

  • After update to itunes 9 video podcast don't work

    Hello together, after updating itunes to vers. 9 my saved video podcast with dhe filetypesMPEG-4 Movie don't run. Also in Quicktime in the filefolder the files cannot be found as a video file. Quicktime itselve says, that it cannot read this filetype

  • Where is the error ring constant in LV 8.2?

    Where is the Error Ring Constant in LabView 8.2?  It was in the block diagram numerics panel in 7.1.1.

  • Wait while loading

    Hello All,      I created a BSP Application and the output is shown on a table view. But while execution it's taking quite amount of time. Finally the output will be displayed. But during this period the page footer says "DONE". So it leaves a impres

  • Error: object expected in WAD-javascript

    hi all, i have written a .js file which i am using in WAD templates. there are certain functions which , when i move to the .js file i get the error: object expected. if i keep those functions in the template i do not get ne error. i just can't figur