How to add indicators from subVIs to main VI

Hi,
I have a similar problem as well as a question or two about running subVI's.  Basically, I am trying to create a project that will use both syringe pump injections and the opening and closing of valves to transport a fluid.  As of now, I have a program written for the syringe pump that I was able to modify from an instrument driver from the manufactuer of the syringe.  The goal is to just have the operator press a single run button, as all volume and flow rate conditions will stay the same from trial to trial.  I created two separate syringe pump suvbVI's, one injects 1mL of fluid at 1mL/min and the second injects 2mL of fluid at 1mL/min.  
I want to use the flat sequence structure to run these two subVI's sequentially, which I am having some difficulty with.  I set this up so that the operator must press an "OK" button in order for the case structre to read "true" and begin the operations in the flat sequence.  Both subVI's work correctly if operated on their own.  However, when I use the highlight data flow function (lightbulb on block diagram) I can see that pressing the OK button causes the case structure to read true, and the program to engage the first subVI.  Upon opening the block diagram of the first subVI and using the same lightbulb tool, I noticed that the information is getting stuck in the first while loop and repeating itself endlessly.  Any suggestions as to why this may be the case?  (I did go into each subVI and changed the VISA resource name to the correct COM port)
Also, once I figure out how to get the information to flow correctly, I do want my main VI front panel to display some of the front panel indicators on the syringe pump VI's, such as the volume dispense and tank.  I would like to know more information about how to reference a wire to the subVI as previously mentioned in this thread.
Sorry this was such a long post!  I attached the main VI with the embedded syringe pump subVI's as well as both individual subVI's.  Any suggestions would be greatly appreciated!
Thanks
Attachments:
Test Project_Pumps.vi ‏9 KB
NE-50X Push Button Example-tester_1mL_3_30_1013.vi ‏289 KB
NE-50X Push Button Example-tester_2mL_3_30_1016.vi ‏289 KB

galXE1,
From my example you can use the invoke node method of "get all" and it will retrieve all the indicator names and values and then you can get the values you want. 
Sorry for not posting this originally but without modifying your code a bunch your quickest option is to use shared variables. If you have important vital tasks they aren't the best but if you're just looking to pass data between vi's then they are you're easiest option. 
Creating a Shared Variable - look at single process shared variable section. 
http://zone.ni.com/devzone/cda/tut/p/id/4679
So you basically call your subvi every time the loop iterates to perform some execution and then you can update your main front panel with the newest values. Calling the subvi with a loop in it. Nothing special but it gets the job done. Its not very good practice if you have a bunch of values you want to pass. 
See subvi calculations.jpg
A better approach to passing data between vi's is detailed in the document. Its called a Functional Global Variable. 
https://decibel.ni.com/content/docs/DOC-12876
Kyle Hartley
RIO Product Support Engineer
National Instruments
Attachments:
Subvi calculations.JPG ‏42 KB

Similar Messages

  • YouTube - How to add videos from youtube on jsf-adf

    YouTube - How to add videos from youtube on jsf-adf.
    when i using iframe i can't send data from beans.

    you can use a <f:verbatim> tag in your page and in it just write the HTML code for embedding a video.
    and can i send data from beans class in html components?
    i wrote this
    <af:iterator id="i2" var="row"
    value="#{MyBean.src_items}"
    varStatus="st">
    <af:showDetail disclosed="false" id="sd1"
    styleClass="AFStretchWidth"
    disclosedText="#{row}">
    <f:verbatim>
    <iframe id="ifv" src="#{row}"/>
    </f:verbatim>
    </af:showDetail>
    </af:iterator>
    but that were not worked .
    Edited by: Vakhushti on May 9, 2011 12:40 PM

  • HT1473 How to add music from macbook pro to iPad

    How do I add musci from Macbok pro to ipad2?

    Open itunes, connect ipad, select what you want, sync.

  • How to add name from text file to jtable?

    hello all,
    how to add name (string) from the notepad file(.txt) into jTable rows.
    I am not able to add it.
    try {
                 FileInputStream fis = new FileInputStream("Devices/Devices_Lst.txt");
                 BufferedReader br = new BufferedReader(new InputStreamReader(fis));
                 String line = null;
                 Vector data = new Vector();
                 line = br.readLine();
                 while ( (line = br.readLine()) != null)
                    int rowCount1 = nmsTable.getRowCount();
                    for(int i=0;i<rowCount1;i++)      
                        myTableInit();  // it initialize the table
                       /* nmsTable.setValueAt(i+1,i,0);
                        Table.setValueAt(line,i,1);
                        Table.setValueAt(" ",i,2);
                        Table.setValueAt(" ",i,3);
                        Table.setValueAt(" ",i,4);
                        Table.setValueAt(" ",i,5); */
                        int rowNo = nmsTable.getRowCount();
                        row.addElement((rowNo+1));
                           //row.addElement(ipText.getText()+"-"+nameText.getText());
                           row.addElement(line);   
                           row.addElement((String)" ");
                           row.addElement((String) "");
                           row.addElement((String) "");
                           row.addElement((String) "");      
                            row.addElement((String) "");      
                            rows.add(row);                                     //rows is the Vector for table row.
                            Table.addNotify(); 
                  br.close();
                 if possible give me some examples.
    thank you.

    For every row you need to create a new Vector and add the data to that Vector. Then the Vector is added to the TableModel.
    If you add 6 items to the single Vector, then you will get 6 columns. So you need to create 6 Vectors and add a single item to each Vector and therefore you will end up with 6 rows with 1 column of data.

  • How to Add Partner function in the main screen of the Sales order???????

    Hello All,
    I am working on ECC 6.00 SD module
    I want to add partner function in the main screen of the sales order, that mean add more partner function beside Sold to party and the ship to party to be in the order header, Is it possible and how?
    Regards
    Jacopo Françoise

    Hi
    If you want in the sales order , above the sold to party as the  box then you need to go for enhancements
    Regards
    Srinath
    Edited by: sri nath on Jun 11, 2008 6:56 PM

  • How to add users from person or group field in a sharepoint list to sharepoint group

    Hi,
    How to add users(single or multiple) from person or group field in a sharepoint list to sharepoint group programmatically?
    Any suggestions would be appreciated.
    Thank you,
    AA.

    Hello,
    Use SPGroup.AddUser() method to add user in group. I have just written sample code in notepad so it is not tested:
    SPSecurity.RunWithElevatedPrivileges(delegate()
    using(SPSite Site = new SPSite(SPContext.Current.Site.Url))
    Using(SPWeb Web = Site.OpenWeb())
    SPList list = web.Lists["ListName"];
    SPQuery query=new SPQuery ();
    query.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Test</Value></Eq></Where>";
    SPListItemCollection items = list.GetItems(query);
    if(items.Count > 0)
    foreach(SPListItem item in items)
    //Get USers from person or group column
    SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users");
    SPFieldUserValueCollection userFieldValueCollection = (SPFieldUserValueCollection)userField.GetFieldValue(item["Users"].ToString());
    SPGroup spGroup = spSite.RootWeb.Groups[groupName];//group name
    if (users.Count != 0)
    bool isUserInGroup = false;
    foreach (SPFieldUserValue user in users)
    foreach (SPUser item in spGroup.Users)
    string itemUserName = item.LoginName;
    string UserName = user.User.LoginName;
    if (itemUserName == UserName)
    isUserInGroup = true;
    break;
    if (!isUserInGroup)
    spGroup.AddUser(user.User);
    The above code will query list item and then get users from "Users" column. Now it will check whetehr user is already in group not, if not then add user in group.
    http://rajanijilla.blogspot.sg/2012/09/add-users-to-group-programmatically.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to add photo from Photos app as iCloud/user avatar?

    Hello,
    I would like to change my login and iCloud user avatar. I have photos in the new Photos app, but I can't import or drag&drop files on the settings screen from Photos.
    "Take a photo with your iOS device or manually add photos from the Photos app." - I would like to do that, but how?
    Thank you!

    Hello,
    I would like to change my login and iCloud user avatar. I have photos in the new Photos app, but I can't import or drag&drop files on the settings screen from Photos.
    "Take a photo with your iOS device or manually add photos from the Photos app." - I would like to do that, but how?
    Thank you!

  • How to add music from ipod to brand new laptop

    I just bought a new laptop and now downloaded itunes, i was needing to know how to add my music from my ipod touch to my itunes library?

    - Transfer iTunes purchases by:
    iTunes Store: Transferring purchases from your iPhone, iPad, or iPod to a computer
    - Transfer othr stuff with third-party programs discussed here:
    Best iPod to PC

  • How to add music from a second computer to my iPhone 5

    I just got an iPhone 5. I can manually control music from my personal laptop and put it on my iPhone. However I can't add it from my brother's lap top. When ever I try to click "manually manage" on his computer, it tells me to erase everything from my iPhone and sync his library. I did autherize  hi computer. How do I add music from his computer with still keeping all of my current music?

    Thanks AmishCake.
    While I'd prefer to not have to do this I suppose it's the only way with my current set up.
    Lots of hostile attention on this forum from people who claim to not care about what I do.

  • How to add folder from KM content to Portal Favorites for selected users

    Hi all,
    I have cretaed  a folder in KM content (In documents) for uploading implementation related ddocuments.
    how to add this folder in "Portal Favorites" of selected users only.
    Please guide.
    Thanks in advance.

    Hi,
    well one way could be the following.
    Go into KM-Content --> Repository "userhome" --> select the user you want --> navigate into his folder Favorites --> create a new internal link in this folder to the folder you want
    In the favorites of the user there is now a link to the desired folder and after clicking a new window will be opened. You can copy this internal link to the favorites folder of the other users you want.
    Regards
    Alex
    Edited by: Alexander Götz on Apr 16, 2009 5:12 PM

  • How to add Activity from ANE to AIR app

    I have developed some native Android code that will (in theory) allow me to play video using the Android MediaPlayer. There are some issues with streaming h264 MP4 videos with AIR on Android that is making this necessary. How do I go about displaying the MediaPlayer within the application? I know it is possible as it is done using this native maps ANE, but I can't seem to figure out how it is done or find source code for it.
    Could anyone shed any light on how you display content from native code in the actual app? I am perfectly okay with it behaving like a StageWebView in terms of sizing and positioning (as is said is necessary by countless people I have read/listened to over the last day or so).
    Thanks for any help

    This isn't available in the default .air install (other than a shortcut to the application.)  However, I would suggest taking a look at the captive runtime options and rolling your own installer.  This way you can do whatever you want on installation without restriction.
    http://www.adobe.com/devnet/air/articles/air3-install-and-deployment-options.html
    Thanks,
    Chris

  • How to add photo from iCloud Photo Library to Apple Mail?

    I have enabled iCloud Photo Library (Beta) and Upload to My Photo Stream on iPhone 5 iOS 8.1, but on OSX new photos are not showing under iCloud drive folder, also if I press Photo Browser button visible are only iPhoto & iCloud menu without new Photos. How to attach photos to Mail from iCloud Photo Library?

    Hi Salsalove,
    Welcome to Apple Support Communities.
    The article linked below will walk you through the process of deleting the photos and videos that you no longer want saved on iCloud, so you don’t have to wait 30 days for them to be delted.
    iCloud security and privacy overview
    Photos
    You can delete unwanted photos from My Photo Stream at any time. Learn about deleting your photos.
    You can delete unwanted photos and videos from your shared albums at any time. Learn how to delete photos and videos from a shared album.
    You can remove subscribers from shared albums that you created at any time. Learn how to move subscribers from your shared album.
    If you’re using Family Sharing, you will be automatically added to an iCloud Photo Sharing shared album with your family members. However, you're in control of what photos, videos, and comments you want to share. Nothing is shared automatically or by default.
    Take care,
    -Jason

  • How to handle event from subVI in the main VI?

    Hello,
    I'm doing some measurement. During the measurement I want the user to see some activity dialog - that's easy to do. Before the measurement starts I dynamically run VI (EX_Progress.vi) that shows some activity and then I do the measurement (in my example simulated by random number generation) . After the measurement is done (or error occurs) I can dynamically abort the activity indicator. But on the other hand I want to give to the user chance to abort the measurement manually via the activity dialog by STOP button. There are some ways how to do it via global variable and check every iteration in the main VI it's state but isn't there some better way? Would be nice to run event in the main VI when the user pushes the STOP button in the Progress VI. Is it possible to achieve this using register events? I tried but don't really now how I'm not familiar with this technique.
    Thanks in advance
    Message Edited by ceties on 11-26-2007 01:34 PM
    LV 2011, Win7
    Attachments:
    Ex.zip ‏374 KB

    OK, here's an example using User Events. It doesn't directly have the main VI listen for the Button press event in the subVI. Instead, it has the main VI listen for a custom User Event that the subVI fires every time there's a button press. You could theoretically directly listen to the button press directly from the Main VI, but you would have to somehow get that control's reference to the main VI. That would require storing a copy of it in a global or some such method. This method I will show here is very common and is definitely worth learning.
    For more info on User Events, refer to the LabVIEW help. You can learn more by clicking any of the User Event VIs and selecting Help from the shortcut menu.
    (I didn't set the subVIs front panel to open automatically, so you'll have to do that yourself to see anything from this demo...)
    Message Edited by Jarrod S. on 11-26-2007 02:51 PM
    Jarrod S.
    National Instruments
    Attachments:
    Example.zip ‏25 KB

  • How to build reference from subvi to vi?

    I have both vi and Subvi vi program, i try to link up the data "send data", "received data", "Listen to" boolean , how can i build references and use vi to control subvi
    Attachments:
    Machine_connection.vi ‏20 KB
    Semester2.vi ‏34 KB

    The code does not fit the way execution is controlled in LabVIEW, namely through data flow...Other key consepts to check out is locals, globals/functional globals...
    I would also recommend you to use a left to right design on all code; inputs to the sub-vi should be on the left side of the VI, outputs on the right side...but back to the problem at hand:
    There are a number of ways to solve this...the easiest is to simply not use a sub-vi, move the sub-vi code to the vi..that way the button will be read on each iteration and you can stop it...if the loop is in a sub-vi it will not read any new inputs nor output anything until it has finished (data flow).
    If you still want the listener in a sub-vi and control it from the main vi put the button in a loop and u
    se VI globals to share data (attached is an example for the button control; initialize it prior to doing anything else, then put the button in a while loop and wire it to the input of the global, with the function set to write...then replace the button in the listening VI with the global and set the funtion to read..wire the output the same way as the button used to be...You need to make similar globals for the send and receive data...a better option there htough would be to use ques, that way you will not loose any data.)
    Other options include making the listening sub-vi load dynamically so that the calling vi does not wait for it to finish..and then share data between the two using a send and a receive que...
    Search this site for functional globals to read more about the idea behind the VI global example...Also check out texts and examples on ques and client-server solutions...
    MTO
    Attachments:
    Listen.vi ‏17 KB

  • Update Indicator from SubVi in Main Vi

    Hi, I am new to labview and have recently undertood the concept of Control Refnum. Because all the examples online are related to passing controls to the subvi and triggerign an event there, I am able to do it and it works. I am here because I could not find any example where indicator values are passed back to the Main Vi. I have attached my two Vis and will appreciate if someone could help me understand and apply this concept.
    I am just pressing a button in Main Vi and want the LED and number indicator in my main vi to update from the sub Vi. Currently it only updates in Sub Vi.
    Thanks
    Attachments:
    Actual.vi ‏8 KB
    A_TRAILER.vi ‏18 KB

    lsbu wrote:
    I will have nearly 8-10 events in my final program and I find it easier to shift them to sub vi.
    That's very few events.  Did you not know the event structure can handle many events?  At that point, it is as hard to manage as a single case structure (which is dirt easy).  Trust me.  It will be a lot easier to manage a single event structure than trying to follow your references everywhere just to try to figure out who is handling what event.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Error while query execution - Query getting locked by another user execute

    Hi All, I am facing an issue .. When I execute a query I am getting an error message ie popping as blocked by some other user. And I able to see the lock when I go to SM12. If the other user logged off or if we unlock his entry, then both the workboo

  • Add a button in report selection screen

    Hi Experts,      I want to add a userdefined button in report selection screen....so far i have written code like this,... TABLES : sscrfields. SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010. PARAMETERS: P_ID LIKE ZBAPITABLE-ID,        

  • Single safari window doesn't open in Tab

    I just reformatted my system and installed all software again. My config is: Lion 10.7.3, Safari 5.1.5. In the past, when I opened Safari, even a single window opened in a Tab, now when I open just one window (i.e. only one Tab), it doesnt open in a

  • IPad2 using iOs 8 passcode problem

    I updated my iPad2 to iOs 8.02 and now I am having a problem.  It crashed and I got a message that it needed to be restored on iTunes.  I did and now I can't get into it again because it says that I am using the incorrect passcode.  I have tried so m

  • Urgent : Uploading an excel file to an internal table

    Hi All M problem is simple ..i have to upload an excel file from my PC which is containing 2 cols to an internal table which is having two fields .. I am using GUI_UPLOAD function module for this and using FILELD_SEPARATOR as 'X" .. But i am not able