Configure the priority/execution system of Sub-VIs

Hi,
I wonder if it is possible to configure a VI to run with different priorities or in different execution systems when called on different occations. It seems to me that the only way to influence this is by changing the properties of a VI and then saving it. That would leave me having n just slightly different VIs for n settings.
Sören

Hello,
VI server exposes properties which allow you to change the priority and execution of a VI dynamically.  However, these properties cannot be set while the VI is running, and therefore a VI cannot set its own priority or execution system.  This means that you have to use a plug-in architecture (dynamically called VIs) in order to dynamically choose the priority and execution system of VIs.  I've attached a short example written in LV 7.1.  If you are unfamiliar with VI server or dynamically calling VIs, the LabVIEW Intermediate II course covers these topics and I'm sure there is also plenty of good content on these forums and in the developer zone.
Regards,
Ryan K.
Note:  You should be careful when adjusting the priorities and execution systems on a VI, as you can often end up with undesired results due to priority inversion.
Attachments:
Priority Demo.zip ‏20 KB

Similar Messages

  • Is this roughly how the labVIEW Execution Systems work?

    I've not taken a class in OS design, so I don't know the strategies used to implement multitasking, preemptive or cooperative. The description below is a rough guess.
    LabVIEW compiles Vis to execute within its own multitasking execution environment. This execution environment is composed of 6 execution systems. Each execution system has 5 priority queues (say priorities 0->4). Vis are compiled to one or more tasks which are posted for execution in these queues.
    An execution system may either have multiple threads assigned to execute tasks from each priority queue, or may have a single thread executing all tasks from all priority queues. The thread priorities associated with a multithreaded execution system are assigned according to the queue that they service. There are therefore 5 available thread priority levels, one for each of the 5 priority level queues.
    In addition to the execution queues, there are additional queues that are associated with tasks suspended in various wait states. (I don't know whether there are also threads associated with these queues. It seems there is.)
    According to app. note 114, the default execution environment provides 1 execution system with 1 thread having a priority level of 1, and 5 execution systems with 10 prioritized threads, 2 threads per priority queue. NI has titled the single threaded execution system "user interface" and also given names to the other 5. Here they will be called either "user interface" or "other".
    The "user interface" system is responsible for all GUI actions. It monitors the keyboard and mouse, as well as drawing the controls. It is also used to execute non-thread-safe tasks; tasks whose shared objects are not thread mutex protected.
    Vis are composed of a front panel and diagram. The front panel provides an interface between the vi diagram, the user, and the calling vi. The diagram provides programmatic data flow between various nodes and is compiled into one or more machine coded tasks. In addition to it own tasks, a diagram may also call other vis. A vi that calls another vi does not actually programmatically branch to that vi. Rather, in most cases the call to another vi posts the tasks associated with the subvi to the back of one of the labVIEW execution system�s queues.
    If a vi is non-reentrant, its tasks cannot run simultaneously on multiple threads. This implies a mutex like construction around the vi call to insure only one execution system is executing the vi. It doesn�t really matter where or how this happens, but somehow labVIEW has to protect an asynchronous vi from simultaneous execution, somehow that has to be performed without blocking an execution queue, and somehow a mutex suspended vi has to be returned to the execution queue when the mutex is freed. I assume this to be a strictly labVIEW mutex and does not involve the OS. If a vi is reentrant, it can be posted/ran multiple times simultaneously. If a vi is a subroutine, its task (I think there is always only one) will be posted to the front of the caller's queue rather than at the back of the queue (It actually probably never gets posted but is simply mutex tested at the call.) A reentrant-subroutine vi may be directly linked to its caller since it has no restrictions. (Whether in fact labVIEW does this, I don�t know. In any event, it would seem in general vis that can be identified as reentrant should be specified as such to avoid the overhead of mutexing. This would include vis that wrap reentrant dll calls.)
    The execution queue to which a vi's tasks are posted depends upon the vi execution settings and the caller's execution priority. If the caller's execution priority is less than or equal the callee's execution settings, then the callee's tasks are posted to the back of the callee's specified execution queue. If the caller's execution priority is greater than the callee's specifications, then the callee's tasks are posted to the back of the caller's queue. Under most conditions, the vi execution setting is set to "same as caller" in which case the callee�s tasks are always posted to the back of the caller's execution queue. This applies to cases where two vis are set to run either in the other execution systems or two vis are set to run in the user interface execution system. (It�s not clear what happens when one vi is in the �user interface� system and the other is not. If the rule is followed by thread priority, any background tasks in the �other� systems will be moved to the user interface system. Normal task in the �other� systems called by a vi in the �user interface� system will execute in their own systems and vice versa. And �user interface� vis will execute in the caller�s �other� system if the caller has a priority greater than normal.)
    Additionally, certain nodes must execute in the "user interface" execution system because their operations are not thread-safe. While the above generally specifies where a task will begin and end execution, a non-thread safe node can move a task to the �user interface� system. The task will continue to execute there until some unspecified event moves it back to its original execution system. Note, other task associated to the vi will be unaffected and will continue to execute in the original system.
    Normally, tasks associated with a diagram run in one of the �other� execution systems. The tasks associated with drawing the front panel and monitoring user input always execute in the user interface execution system. Changes made by a diagram to it own front panel are buffered (the diagram has its own copy of the data, the front panel has its own copy of the data, and there seems to be some kind of exchange buffer that is mutexed), and the front panel update is posted as a task to the user interface execution system. Front panel objects also have the advanced option of being updated sequentially; presumably this means the diagram task that modifies the front panel will be moved to the user interface execution system as well. What this does to the data exchanged configuration between the front panel and diagram is unclear as presumably both the front panel and diagram are executing in the same thread and the mutex and buffer would seem to be redundant. While the above is true for a control value it is not clear whether this is also true for the control properties. Since a referenced property node can only occur on the local diagram, it is not clear it forces the local diagram to execute in the user interface system or whether they too are buffered and mutexed with the front panel.
    If I were to hazard a guess, I would say that only the control values are buffered and mutexed. The control properties belong exclusively to the front panel and any changes made to them require execution in the �user interface� system. If diagram merely reads them, it probably doesn�t suffer a context switch.
    Other vis can also modify the data structure defining the control appearance and values remotely using un-reference property nodes. These nodes are required to run in the user interface system because the operation is not thread-safe and apparently the diagram-front-panel mutex is specifically between the user interface execution system and the local diagram thread. Relative to the local diagram, remote changes by other vis would appear to be user entries.
    It is not clear how front panels work with reentrant vis. Apparently every instance gets its own copy of the front panel values. If all front panel data structures were unique to an instance, and if I could get a vi reference to an instance of a reentrant vi, I could open multiple front panels, each displaying its own unique data. It might be handy, sort of like opening multiple Word documents, but I don�t think that it�s available.
    A note: It is said that the front panel data is not loaded unless the front panel is opened. Obviously the attributes required to draw an object are not required, nor the buffer that interfaces with the user. This rule doesn�t apply though that if property references are made to front panel objects, and/or local variables are used. In those cases at least part of the front panel data has to be present. Furthermore, since all data is available via a control reference, if used, the control�s entire data structure must be present.
    I use the vi server but haven�t really explored it yet, nor vi reference nodes, but obviously they too make modifications to unique data structures and hence are not thread-safe. And in general, any node that accesses a shared object is required to run in the user interface thread to protect the data associated with the object. LabVIEW, does not generally create OS level thread mutexes to protect objects probably because it becomes to cumbersome... Only a guess...
    Considering the extra overhead of dealing with preemptive threading, I�m wondering if my well-tuned single threaded application in LV4.1 won�t out perform my well-tuned multithreaded application in LV6.0, given a single processor environment�
    Please modify those parts that require it.
    Thanks�
    Kind Regards,
    Eric

    Ben,
    There are two types of memory which would be of concern. There is temporary and persistent. Generally, if a reentrant vi has persistent memory requirements, then it is being used specifically to retain those values at every instance. More generally, reentrant code requires no persistent memory. It is passed all the information it needs to perform its function, and nothing is retained. For this type of reentrant vi, memory concern to which you refer could become important if the vis are using several MBytes of temporary storage for intermediate results. In that case, as you could have several copies executing at once, your temporary storage requirements have multiplied by the number of simultaneous copies executing. Your max memory use is going to rise, and as labview allocates memory rather independently and freely, the memory use of making them reentrant might be a bit of a surprise.
    On the other hand, the whole idea of preemtive threading is to give those tasks which require execution in a timely fashion the ability to do so regardless of what other tasks might be doing. We are, after all, suffering the computational overhead of multithreading to accomplish this. If memory requirements are going to defeat the original objective, then we really are traversing a circle.
    Anyway, as Greg has advised, threads are supposed to be used judiciously. It isn't as though your going to have all 51 threads up at the same time. In general I think, overall coding stategy should be to minimize the number of threads while protecting those tasks that absolutely require timely execution.
    In that sense, it would have been nice if NI had retained two single threaded systems, one for the GUI and one for the GUI interface diagrams. I've noticed that control drawing is somewhat slower under LV6.0 than LV4.1. I cannot, for example, make a spreadsheet scroll smoothly anymore, even using buffered graphics. This makes me wonder how many of my open front panel diagrams are actually running on the GUI thread.
    And, I wonder if threads go to sleep when not in use, for example, on a wait, or wait multiple node. My high priority thread doesn't do a lot of work, but the work that it does is critical. I don't know what it's doing the rest of the time. From some of Greg's comments, my impression is it in some kind of idle mode: waking up and sleeping, waking up and sleeping,..., waking up, doing something and sleeping... etc. I suppose I should try to test this.
    Anyway that's all an aside...
    With regard to memory, your right, there are no free lunches... Thanks for reminding me. If I try this, I might be dismayed by the additional memory use, but I won't be shocked.
    Kind Regards,
    Eric

  • The report server has encountered a configuration error. Logon failed for the unattended execution account. (rsServerConfigurationError) Log on failed. Ensure the user name and password are correct. (rsLogonFailed) The user name or password is incorrect

    I am able to run the report fine in BIDS in the preview window, and it deployes fine.  When it goes to view the report in the browser, I get the following error.  There is no domain, I am using a standalone computer with SQL Server and SSRS on
    this one machine.
    Can anyone point to where I might configure the permission it is looking for?  thanks!  Steven
    The report server has encountered a configuration error. Logon failed for the unattended execution account. (rsServerConfigurationError)
    Log on failed. Ensure the user name and password are correct. (rsLogonFailed)
    The user name or password is incorrect
    Steven DeSalvo

    Hi StevenDE2012,
    Based on the error message "The report server has encountered a configuration error. Logon failed for the unattended execution account. (rsServerConfigurationError)", it seems that the Unattended Execution Account settings in Reporting Services
    Configuration is not correct.
    Reporting Services provides a special account that is used for unattended report processing and for sending connection requests across the network. Unattended report processing refers to any report execution process that is triggered by an event rather than
    a user request. The report server uses the unattended report processing account to log on to the computer that hosts the external data source. This account is necessary because the credentials of the Report Server service account are never used to connect
    to other computers. To configure the account, please refer to the following steps:
    Start the Reporting Services Configuration tool and connect to the report server instance you want to configure.
    On the Execution Account page, select Specify an execution account.
    Type the account and password, retype the password, and then click Apply.
    In addition, please verify you have access to the Report Server database by following steps:
    Go to SQL Server Reporting Services Configuration Manager, make sure the configuration is correct.
    Go to Database, Verify that you can connect to the database.
    Make sure you are granted public and RSExecRole roles.
    Reference:
    Configure the Unattended Execution Account
    Configure a Report Server Database Connection
    If the problem is unresolved, i would appreciate it if you could give us detailed error log, it will help us move more quickly toward a solution.
    Thanks,
    Wendy Fu

  • Preferred execution system

    What is the exact meaning of:
    User interface (I know)
    Standard ?
    Instrument IO ?
    Data acquisition ?
    Other 1 ???
    Other 2 ???
    Same as caller (I know)
    I know that it also depend on if your computer is a Single or Dual Processor
    Thanks!
    Nitrof

    > Greg McKaskle has written several good answers about execution systems:
    >
    > http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101...http://exchange.ni.com has been obsoleted by http://forums.ni.com/ni/ . I'm not sure how to find those three documents, but I found the following...  
    1999: priority of VIs
    http://forums.ni.com/ni/board/message?board.id=170&message.id=5587 
    2001: Need some clarification on Execution Systems, Priorities, and threads with Labview on Windows NT
    http://forums.ni.com/ni/board/message?board.id=170&thread.id=11944 
    2002: Multithreading in LabView loops doesn't work?
    http://forums.ni.com/ni/board/message?board.id=170&message.id=23498&requireLogin=False 
    2002: best way to do parallel activities
    http://forums.ni.com/ni/board/message?board.id=170&thread.id=24932 
    2003: Is this roughly how the labVIEW Execution Systems work?
    http://forums.ni.com/ni/board/message?board.id=170&thread.id=45194 
    Is there anything more current?

  • SSRS programmatically remove the unattended execution account

    Hi,
    Is there a way to programmatically remove the SSRS unattended execution account?
    In the
    Configuring the Unattended Execution Account article, the "How to Delete the Unattended Report Processing Account" section only list a manual step to do so.
    I also didn't find any terms that I could use with the rsconfig utility to do so, see
    rsconfig Utility.
    Thanks,
    Emmanuel

    Hi Emmanuel,
    When we set the account in SSRS, it will add specify Encrypted characters in the RSreportserver.config file. If we want to programmatically remove the SSRS unattended execution account, we need find a way to delete the corresponding Encrypted characters
    in the RSreportserver.config file.
    Based on my test, I cannot programmatically remove the Encrypted characters. As per my understanding, delete the unattended report processing account is a simple step in SSRS. The manual steps may be simpler than programmatically remove the account.
    Hope this helps.
    Regards,
    Alisa Tang
    If you have any feedback on our support, please click
    here.
    Alisa Tang
    TechNet Community Support

  • Defining the Target Source System

    Hi gurus,
    I have a question ?
    I have SAP BW 7.3 SP 10 If I have this version is necessary configure the conversion logical system names in the Transport Connection ?
    I do not idea if yes or not?
    Thank for you help.
    Best regards.
    Andres Bermudez

    Hi Andres,
    yes you have to mantain the usual table with systems transaltion after the import. RSA1 CTRL+F12
    In addition you could restrict the transaltion  only for objects in version 7.x
    Luca

  • How to configure the document management

    Hi all,
    I am new to document management system. My request is about how can we configure the document management system in our sap system, actually we are not using sap for storage of documents.
    Is there some way, so that we can attached documents in the system and put some attributes with them so as to retrieve and search purpose.
    Please guide.
    Thanks and Regards

    Hai,
    See this link, it would help you
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/04/92718846f311d189470000e829fbbd/frameset.htm
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/2d/3527f6448c11d189420000e829fbbd/frameset.htm
    Regards,
    KK

  • How to creat multiple sub VIs'

    I have a VERY large VI that finaly crashed due to the large size. What is the best way to create "Sub VIS"? I have almost 800K of code. Should I create all the sub vis and then add them to my Project? I want the program to call the sub vis automaticaly.
    Thanks
    Philip

    Hi Philip,
    Backups:
    As Lynn (johnsold) said, local backups are a minimum requirement.
    A service like Dropbox is better in case of computer crash.
    Note: Temporarily disable Dropbox syncing when doing builds in a Dropbox folder as this may cause builds to fail.
    The best solution is true source control like the free TortiseSVN.
    For sub vis I suggest:
    Identify code sections that perform one specific function. This makes a logical sub vi. If you can easily come up with a name to describe the
    section (like "Parse Input String" for example) then you are on the right track. With some practice you will be creating sub vis that can be used
    in other programs and save you time in the future. This is a good reason to NOT include unrelated code in a sub vi just because it will fit.
    Take note of the number of inputs and outputs in the code section. Ideally you want a small number of inputs and the same for outputs (3 or 4). Use clusters to reduce the number of I/O items.
    Standardize on a connector pane layout - this makes wires line up better. The 4224 pattern works well. When LabVIEW creates sub vis it only creates the number of inputs and outputs that are required. So you will normally have to change the connector pattern and rearrange the controls and indicators every time you create a sub vi.
    Include error in and error out in their standard places even if you don't need them for the particular application. When you use that sub vi later
    you may need them.
    Good practice is to use Type Defines for controls and indicators that go to more than 1 place. In your case, it is a jugement call if it is worth the trouble to do this on an existing program. Once you start using sub vis more, Type devs become very important. If you don't use them, changing a data structure will require manually changing every sub vi that uses that data structure.
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.

  • Current execution system of labview 8.20

    What is the Current execution system of labview 8.20

    Hi,
    I presume you mean how LabVIEW executes the code in your block diagram? You can see this happen using the "Highlight Execution" button located next to the run, run continuously and abort buttons.
    Thanks,
    CLA | LabVIEW 7.1... 2013
    www.renishaw.com

  • What's the best Preferred Execution System setting for parallel testing run from TestStand

    I configured what vi's I think need to be reentrant, but I am not sure what choice for "Preferred Execution System" is best for the vi's in my TestStand sequence that's going to run in parallel.  Can anyone advise?
    Thanks!

    Hi mike_22,
    This option should not matter unless you have a LabVIEW VI with parallel code blocks.  If this is the case, you can set your VI to Other 1 or Other 2.  Please take a look at this knowledgebase for further explanation.
    Cheers,
    Kelly R.
    Applications Engineer
    National Instruments

  • Configuring mail priority when sending mails via SMTP from ECC 6.0 system

    hi all,
    we have the problem, that mails which we send via SMTP out of ECC 6.0 system
    reach our SMTP server with very low priority. So the server usualy send them in the evening.
    Is there a possibility to configure global priority for mails?
    best regards
    Davor

    Goto SCOT transaction, double click on STMP you will find the option
    Maximum waiting time for repeat send attempt procedure:
    Hours/minutes       / 30. define the time over there.
    II option execute the job- start send process,
    Regards,
    Mahesh

  • The difference between system restore and last good known configuration

    hi,
    what is the difference between system restore  and last good known configuration.
    in which situation you use system restore ,and in which situation you use last good known configuration.
    very short answer wil be enough.
    thanks
    johan
    h.david

    Last Known Good Configuration deals only with Starting Windows eg. a bad registry or incorrect driver is preventing Windows to start.It recovers the registry settings of HKEY_LOCAL_MACHINE\System\CurrentControlSet
    While System Restore uses restore points to return your system files and settings to an earlier point in time without affecting personal files. Restore points are created automatically every week, and just before significant system events, such as the installation
    of a program or device driver. You can also create a restore point manually.You can undone system restore but there is no such option in Last Known Good Configuration.
    Last Known Good Configuration is disabled in Windows 8 or,Windows 8.1 by default.
    Try using Last Known Good Configuration if you can't start Windows, but it started correctly the last time you turned on the computer.
    Try using System Restore to return the system to an earlier point in time when things worked correctly.
    S.Sengupta, Windows Entertainment and Connected Home MVP

  • The report server has encountered a configuration error. Logon failed for the unattended execution account. (rsServerConfigurationError) Log on failed. Ensure the user name and password are correct. (rsLogonFailed) Logon failure: unknown user name or bad

    The report server has encountered a configuration error. Logon failed for the unattended execution account. (rsServerConfigurationError)
    Log on failed. Ensure the user name and password are correct. (rsLogonFailed)
    Logon failure: unknown user name or bad password 
    am using Windows integrated security,version of my sql server 2008R2
    I have go throgh the different articuls, they have given different answers,
    So any one give me the  exact soluction for this problem,
    Using service account then i will get the soluction or what?
    pls help me out it is urgent based.
    Regards
    Thanks!

    Hi Ychinnari,
    I have tested on my local environment and can reproduce the issue, as
    Vaishu00547 mentioned that the issue can be caused by the Execution Account you have configured in the Reporting Services Configuration Manager is not correct, Please update the Username and Password and restart the reporting services.
    Please also find more details information about when to use the execution account, if possible,please also not specify this account:
    This account is used under special circumstances when other sources of credentials are not available:
    When the report server connects to a data source that does not require credentials. Examples of data sources that might not require credentials include XML documents and some client-side database applications.
    When the report server connects to another server to retrieve external image files or other resources that are referenced in a report.
    Execution Account (SSRS Native Mode)
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me

    I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me

    Here's a quick example I threw together that generates a sort-of-bell-curve shaped data distribution, then performs the binning and plotting.
    -Kevin P.
    Message Edited by Kevin Price on 12-01-2006 02:42 PM
    Attachments:
    Binning example.vi ‏51 KB
    Binning example.png ‏12 KB

  • [SOLVED] Configure The System (Beginners Guide) Question

    Hello!
    I'm currently working my way through the beginners guide, from the wiki.  All going ok so far and I've reached the Configure The System section. Which is where I'm a bit stuck.
    Beginners Guide wrote:You will be presented with a menu including the most important configuration files for your system. If you want to look up the available options as stated in /etc/rc.conf just press Alt+F2 to get a shell, look it up, and switch back to the installer with Alt+F1.
    The problem I have is looking up the available options. For example, to find my locale it states I should run locale -a, however when I hit Alt+f2 and enter the command at the bash shell ([Arch Linux: /]# ) I get the following error
    -bash: locale: command not found
    When I attempt to lookup other items I'm also unable to find those (such as timezone in /usr/share/zoneinfo).
    Can anyone let me know what I'm doing wrong, I'm missing something very obvious here, but sadly I just can't work it out!
    Last edited by Laatia (2008-03-23 08:56:38)

    dyscoria wrote:
    I wouldn't skip all of the steps, particularly adding your hostname to /etc/hosts. Just fill in as much as you can, and edit the rest after you've finished installing, though I think the defaults are safe enough to have a running system.
    If you typed in 'km' and chose your locale before you ran the /arch/setup command to start the installation, it should automatically enter in the locale you selected earlier (if you press yes in the dialog box that pops up).
    Confirm this as that's what happended in this location on 2 recent install.

Maybe you are looking for

  • I need to download the 64 bit version of itunes

    where can i do that? cuz the one thats offered on "ipod+itunes" is 32bit... is the 64 bit under "downloads" and would i have to look around for it?

  • Date format in graph

    hi,  is there any way i can have dates on a X-axis for a graph on horizontal orientation ? it seems that i can only have it in vertical many thanks

  • Work web site not Safari compatible

    On my macbook I use FireFox, since my work's web site does work with Safari. What can I do with my iPhone? Can I load Firefox? Please help.

  • The Best Method To Backup Referenced Masters?

    I cannot find in Aperture help any mention of backing up the referenced masters which seems odd that Apple would consider backing up managed photos on the internal Aperture Library while not considering the very common (and supported by Apple) method

  • NI-VISA does not appear in the addition installers window

    Its seems that i cannot add any NI-VISA packages to my "additional installers" window. The dev system has VISA 4.0 and LV 8.0 and even after downloading and installing the VISA runtime especially to fix this problem, i still cannot see it in the list