How to use a static reference to maintain a VI in memory, but then call it in parallel?

Hi all

I have a MainVI and I want to call him a Subvi in parallel so that I can have both windows open and sensitive at the same time.  The Subvi can be closed and then reopened any number of times, but only one in existence at the same time.  I know how to do it using the reference VI opened, offering a path relative to my Subvi, check to see if its already running and if so bring window to front (using front panel: open with entries True/Standard method) and if not run it using the Invoke method: Run (and eventually open its façade by program).  This method worked very well.

Now, I've added functional global variables in my Subvi, and I want to keep in memory inbetween opening Subvi window.  I can do this by placing a copy of the functional overall in my MainVI, even if I do not here for nothing.  It works very well.

By chance, I came across a reference to a static reference of VI, which resembled a great improvement in my method, for the following reasons:

1) Subvi keeps in memory all the time, eliminating the need to put the functional overall in MainVI when it is not used it.

(2) tells the LabVIEW to include the Subvi when I build my executable, rather than me having to specifically mark as always include in the build specification.

(3) eliminates the need to continue the path and the name of Subvi updated in a constant string in my code, in order to use the open VI reference.

However, in trying to implement this solution, I ran into the problem that once you put a reference of VI in strictly typed static (strict typing is necessary to keep in memory) on the block diagram, that VI is reserved for execution.  This means that I can't run it using the Invoke method: Run.  I did not just put it on the diagram directly as a Subvi because I need it to run in parallel to the MainVI.  I searched through these forums extensively, and although there are several references to a static reference of VI, none of them say explicitly how to actually run this 'thing'!  : PEI

I greatly appreciate any insight into my problem.  If I have to go back to the old way it works perfectly, but I really like the apparent elegance of this solution.  I hope that it will be technically possible, and I'm not bad understand something.

Thank you for your help,

-Joe


Tags: NI Software

Similar Questions

  • How to save a password changed in Firefox? I rescued him, but then I changed the password and it doesn't give me an option to save the new password. Help, please. Thank you!

    How to save a password changed in Firefox? I rescued him, but then I changed the password and it doesn't give me an option to save the new password. Help, please. Thank you!

    The Web site may use autocomplete = off to prevent Firefox to record the name and the password.

    You can remove autocomplete = off with a bookmarklet to register the name and the password of Firefox.

  • How to use a static const variable while loop collection ArrayCollection?

    Hello

    I have an arraycollection collection which I get to main system, that has two columns named, 'Id' and 'Desc '.

    I created a static const variable:

    public static FIELD_DESC_NAME:String const = 'Desc ';

    I have been using this variable const everywhere in my code, for example:

    super.dataProvider = model.acVariants;
    super.labelField = FIELD_DESC_NAME;  instead of using super.labelField = "Desc";

    But unfortunately, there is one place where I'm not able to use it. And it's all in the loop as shown below:

    for (var i: uint = 0; i < model.acVariants.length; i ++) {}

    If (value.label is model.acVariants [i]. DESC) {/ / I want to use the FIELD_DESC_NAME variable, instead of using 'Desc' model.acVariants [i]. / / DESC}
    super.selectedItem = model.acVariants [i];
    break;
    }

    }

    Can you please let me know how can achieve us?

    Appreciate your help...

    <! - Deepak - >

    Can you put a debug statement and draw the value returned by model.acVariants [i] [FIELD_DESC_NAME] and value.label

    Hope that there must be a difference.

    If this does not solve then please let me know

    -Vikash

  • I'm trying to learn how to use the "Add spamming" and the "list of Manage spammer" but can not find any reference material?

    I need to learn to use correctly the spammer 'Add' and 'Manage the spammer list' functions and can find no documentation/explanation of these functions. Sites I list with the function "Add spamming" keep coming in my mail box.

    Thank you for your help

    Use the built-in junk e-mail filter Thunderbird.

    http://KB.mozillazine.org/Junk_Mail_Controls

  • How to use Switch in reference to a table?

    Hello

    I have a table that changes with a pop and a push on the button clicks:

    var nextLoad = ['img0'];

    It will contain always img0 or img1, img2, etc.

    Then I'm trying to control another element on the stage by checking what img# is in the table:

    trace (nextLoad); This correct displays the new value in the table

    switch (nextLoad) { }

    img1 case:

    trace ("img 1 load");

    break;

    img2 case:

    trace ("img 2 load");

    break;

    img3 case:

    trace ("img 3 load');

    break;

    by default:

    trace ("default");

    }

    }

    I think I write one of the "BOLD" rows incorrectly. The nextLoad updates, but I always end by default.

    What I am doing wrong?

    Thank you!

    nextLoad is an array.  you want to use nextLoad [0] for the string in your switch argument.

  • VI static references in an application using

    Hello to you all, useful forum fans!

    I use 4 different static references of VI hung directly to "Run a VI" invoke nodes, with the waiting "until" and settings "Auto have Ref" both false, run the four screws dynamically, which each does nothing except call my serial port returning from input/output VI with a different index of COM port number.  Overall it works pretty well.  However, I have a few questions concerning the improvement of my installation.

    (1) is it possible to somehow set an input parameter to the serial port environment VI and thus be able to invoke it directly four times in a loop for, each with a different input value?  I don't know how I would do that, except that I heard that you can set the value of a control on a VI by using a reference to it.  I also fear that the use of the same reference VI static to invoke the VI 4 times somehow re - start the same instance of dynamic VI 4 times, instead of spawning 4 copies of it.  However, this solution would allow me to remove the 4 screws that do nothing except call the reentrant VI, and my code would be simpler and more extensible (e.g. making it easy to interact with 8 ports in the future series just by increasing the number of for the iterations of the loop).

    (2) it seems to be necessary for me to add the 4 screws that I dynamically invoke in my lvproj file and add to the section "Still included" my generation of application properties in so that they can be included in the executable file of my application.  It was what I had to do in previous versions of my code when I've referenced via a path on the screw name, but now I've changed using static references of VI, I thought they would be included automatically.  LabVIEW already knows to automatically load them into memory (for example, when I do a search it finds them even when they are not open), and they are included in the list of dependencies in the LabVIEW project, so why they would be built to my executable?  I would prefer not to have to add explicitly, as it is one thing to forget if I change it in the future.  Is there a setting or something somewhere that I can change so that they will be included in the executable file automatically?

    I thank very you much for your time and your help as always!

    -Joe

    Hey Joe,

    Answer to Q1: Yes.  Wire one '8' (type of data I32) entry 'options' function 'open VI Reference.  This indicates 'Reference open VI' that the VI is re-entrant.  It will look like this:

    Use the resulting table of references to follow your screws laid throughout the rest of your application.  Don't forget to close them when you are finished with them.

    For the 2nd quarter... I certainly built executables by using code similar to what I show above and did not have to explicitly include the screw called statically in the build.  You're right, they should be automatically included in the compilation - mine were always, including modules that reside in a different lvproject (called by a main control VI).  Sometimes I felt it necessary to develop modules in a lvproject and then call them from different main screws that reside in other projects.  If I used a static reference, they are always included.  What LV version do you use?

  • static reference with the global variable

    Hi, I used a static reference to a Subvi where I change a global variable before (3-4 years ago) and do not remember how I did it.

    It was something like these attachments, but now I'm using LabView 2013 instead of LV 8.6.

    The change in the overall operating system sees only not in the main vi (looks like the invoke node run vi does not work with globals).

    In addition the vi close with the invoke node close vi but not if I put the custom in the Subvi properties to automatically close.

    dkfire wrote:

    Why not call the sub vi as usual, just with the setting to display the front panel, when it is called?

    Use the connector pane to transfer the value of the sub vi Ok button when done.

    That's what I recommend.  If this is not possible for some reason, then you will need to use a flat Structure of the sequence to force the reading of the global variable after the Subvi is complete.

  • Static reference of VI VI reentrant

    Is it possible to use a static reference of VI to dynamically launch a VI on the way home?

    I found this old post, http://forums.ni.com/ni/board/message?board.id=170&message.id=120367, the user can find a work around, but it of ugly, isn't it

    The last snapshot in your link shows the best way to invoke an instance of a reentrant VI dynamically. The only thing I would change from that is to use the Name of VI property instead of the Path of VI property to wire open VI return. You can simply use the name of VI if the VI is in memory, which is more effective. Since you have a static reference of VI, the VI will certainly be in memory.

    I agree that it's a bit ugly. Personally, I created a Subvi to hide the ugliness and make him feel more simple!

  • I downloaded the trial version but I don't understand how to use it

    I have trial version of creative cloud, but do not know how to use it

    Reference:Adobe TV

    I hope this helps.

    Concerning

    Megha Rawat

  • How to use the capture and the print button

    I tried to figure out how to use the capture and the "print" button, or add or what you call. I press it and the whole page of a different color changes, so I try to cut the section I want but I don't know how to send it to the printer. Can someone help me with this. I'm not at savvy with tech stuff, but when I find a recipe or something and it doesn't have an option to print a certain area, I can't understand how to use it?

    Thank you

    Andi Starbuck

    That happens to me is, I click and drag to make a rectangle of yellow selection, and as soon as I raise my finger on the mouse button, the part I've selected is captured as an image, a new tab opens and preview before printing, the image display. I can use the installation of the Page or simply print. But if I close the preview, this temporary image vanishes and I'm back on the page where I started. You see something different?

  • HO OfficeJet Pro 8600: how to remove a static ip address on my HP 8600, using mac 10.7.5 work with wifi

    I have trouble printing through my wifi network. How to remove a static ip address on my HP 8600, using mac 10.7.5 to work with wifi?

    With the help of my NetGear N900 / CG4500BD modem/router with DHCP, there are different IP addresses of the printer, if the printer is connected is 192.168.0.13, when the printer use wifi IP is 192.168.0.20, and on the printer, it shows 192.168.1.142 I think is a static IP address, because it can cause the confussion.

    I appreciate your help, thank you, the Job Dr.

    Hello

    Please go to system-> Network Preferences. Select the airport on the left, and then click Advanced in the bottom right. Switch to TCP/IP and select "using dhcp". Click ok, and then click on apply. After a few seconds, you should get an IP address from the router.
  • How to use ACS 5.2 to create a static ip address user for remote access VPN

    Hi all

    I have the problem. Please help me.

    Initially, I use ACS 4.2 to create the static ip address for VPN remote access user, it's easy, configuration simply to the user defined > address assignment IP Client > assign the static IP address, but when I use ACS 5.2 I don't ' t know how to do.

    I'm trying to add the IPv4 address attribute to the user to read "how to use 5.2 ACS", it says this:

    1Ajouter step to attribute a static IP address to the user attribute dictionary internal:

    Step 2select System Administration > Configuration > dictionaries > identity > internal users.

    Step 3click create.

    Static IP attribute by step 4Ajouter.

    5selectionnez users and identity of the stage stores > internal identity stores > users.

    6Click step create.

    Step 7Edit static IP attribute of the user.

    I just did, but this isn't a job. When I use EasyVPN client to connect to ASA 5520, user could the success of authentication but will not get the static IP I set up on internal users, so the tunnel put in place failed. I'm trying to configure a pool of IP on ASA for ACS users get the IP and customer EasyVPN allows you to connect with ASA, everything is OK, the user authenticates successed.but when I kill IP pool coufigurations and use the "add a static IP address to the user 'configurations, EzVPN are omitted.

    so, what should I do, if anyboby knows how to use ACS 5.2 to create a user for ip address static for remote access VPN, to say please.

    Wait for you answer, no question right or not, please answer, thank you.

    There are a few extra steps to ensure that the static address defined for the user is returned in the Access-Accept. See the instuctions in the two slides attached

  • How to use references from web third party service with service Cloud Computing to Oracle database schema

    APEX 5.0

    Cloud Computing service for the Oracle database schema


    I'm in the middle of do a proof of concept.  Basically, I need an application with security of the stored data, UI, user, data loading, and able to post data via an external web service said.  It seems that with the database schema Oracle cloud service, it is not possible to use web service references that are not in the field.

    If I try to use a service via http reference, I get:

    ORA-20987: APEX - the requested URL was forbidden. Contact your administrator. -Contact your administrator of the application.

    If I try to use the same reference service via https, I get:

    ORA-29273: HTTP request failed

    ORA-06512: at & quot; SYS. UTL_HTTP & quot; line 1130

    ORA-29259: end-of-input reached

    I read somewhere that cloud services only https can be used.  Is this true?

    And then I read somewhere to use the protocol https, the portfolio must be configured to store certificates, etc.  However, I read somewhere else that the portfolio cannot be configured because there is no access to the instance database with the Oracle Cloud Computing database schema service.  Is this true?

    If both are true, how can I make a call to post data to an external web service?  Or do I need to use a different Cloud Computing service?  Or do I need my own instance of Oracle DB?

    Any help would be great.  Thank you!

    It turns out there was a problem with the remote rest service.  After successfully calling a rest service that was created using SQL Workshop, I tried different remote rest services and they all work.  Sorry for the confusion.  I thought it was very strange that the schema of database service wouldn't be able to do it easily.

  • SQL how to use a variable and use the result as a reference for the name of the table

    Hi all

    I have new in the declaration of Oracle, sorry in advance if something is easy for you all. BTW, I have this scenario:

    I have a table OL structured in this way:

    Date - it contains dates, for example 11/01/2015

    TableName - it contains strings, for example, OL1, OL2, OL3 and so on...

    Then I have a different table, the name of these tables are of the same name in the table of the OL, so I have table table, OL1, OL2, OL3 table and so on. The structure of these tables is the same. And Yes.

    table OL1

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

    ID LAST NAME FIRST NAME PHONE

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

    1 JOHN DOE 12345679

    2 PAUL 111111122 TIBBS

    table OL2

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

    ID LAST NAME FIRST NAME PHONE

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

    1 ANNA KRAIG (NULL)

    NATHAN FRESHMANN 111111133 2

    If the scenario is clear, I would like to retrieve the value (null), research in all the OL * tables by using the value of the OL table (tablename) max.

    If I'm going to do these simple steps, I got the result:

    Select max (TableName) OL

    the result will be OL2

    # I know not how to use the option set to avoid changing the table name in the sql statement all the time.

    set mytable = 'OL2.

    Select Name, family name

    of & mytable

    When the phone is null

    Any idea?

    Thank you very much in advance.

    Hello

    run immediately "select dt.log_id, obj.presentation_name, dl.begin_time

    bulk collect into v_result_set

    of ' | v_ol |' dt join internal ol_object obj on

    DT.object_type_id = obj.object_type_id

    inner join ol_chunk_log dl on

    DT.log_id = DL.log_id

    where dt.data_value is null';

    dbms_output.put_line (v_ol);

    end;

    Correct the code such as:

    run immediately "select dt.log_id, obj.presentation_name, dl.begin_time

    of ' | v_ol |' dt join internal ol_object obj on

    DT.object_type_id = obj.object_type_id

    inner join ol_chunk_log dl on

    DT.log_id = DL.log_id

    where dt.data_value is null' bulk collect into v_result_set;


    for i in v_result_set.first ... v_result_set. Last

    loop

    dbms_output.put_line ('LOG ID: ' | ) ( v_result_set.log_id (i)) ;

    dbms_output.put_line (' NAME CLOSELY: ' |) v_result_set.presentation_name (i));

    dbms_output.put_line (' START TIME: ' |) ( v_result_set.begin_time (i)) ;

    end loop;

    end;

    Kind regards.

  • How to use a function switch box to the reference that is used several times in the previous drop-down list options?

    I use JavaScript coding in LiveCycle and development of dependent drop-down areas, but I find it difficult to write correct code. See the example below. I'm trying to use a multiple box function that refers to an option that is listed several times in the previous pull-down menu. The problem I am running into is that when I refer to any color or Nissan and Chevy, it returns the results of the color in the "Ford" column only. I'll always see color (blue, black, green and purple) options in my second drop-down list and it seems fine, but then the third drop reference only the options and colors 'Ford '. (I don't have the code for the third menu list drop-down).

    I want the client to choose Chevy or Nissan and have her drop downs (based on the color they chose)-dependent, but I can't seem to make this work.

    I hope it is clear enough (probably as mud...). I would appreciate help!

    Form1. #subform [0]. #subform [1]. cboModels::exit - (JavaScript, client)

    cboColor.clearItems ();

    {Switch (this.) RawValue)}

    case "Ford":

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    case 'Chevy ':

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    case "Nissan":

    cboColor.addItem ("Blue");

    cboColor.addItem ("Black");

    cboColor.addItem ("Green");

    cboColor.addItem ("Purple");

    break;

    }

    Form1. #subform [0]. #subform [1]. cboColor::exit - (JavaScript, client)

    cboPrice.clearItems ();

    {Switch (this.) RawValue)}

    case "Ford":

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    case 'Chevy ':

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    case "Nissan":

    case "green":

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    cboPrice.addItem ("blah");

    break;

    }

    You can use '\n' for newline in a string, so

    "Option 1, \nOption 2, \nOption 3;

    Put each on its own line.

    Bruce

Maybe you are looking for