Get Current vi Name

I'm making a generic error handler that I will use in many sub VI's.
Is there a way to programatically get the name of any sub VI that I
put my error handler into?
Thanks!

Bill Watts wrote:
> I'm making a generic error handler that I will use in many sub VI's.
>
> Is there a way to programatically get the name of any sub VI that I
> put my error handler into?
>
> Thanks!
Bill,
This is certainly possible. The function you are looking for is
Call Chain in the Application Control subpallette.
If you want an example of how that can be parsed and used, I did
something very similar to what you suggest. You can download it from my
website if you want to take a look. There is a VI called Error Cluster
Generator.vi within the UtilityVIs.llb.
Regards,
Dave Thomson
David Thomson 303-499-1973 (voice and fax)
Original Code Consulting
[email protected]
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Developer
Certified Instrument Driver Developer
Research Scientist 303-497-3470 (voice)
NOAA Aeronomy Laboratory 303-497-5373 (fax)
Boulder, Colorado [email protected]
There are 10 kinds of people: those who understand binary,
and those who don't.

Similar Messages

  • How to get current function name?

    Hello, everyone!
    I want to get the current function name for debug purpose. I simply want to dump out current class name, function name (and better line number) of current executing statement. For example, I can embed my debugger inside my source codes if I can get the current function name as the following,
    <code>
    class foo
    void function goo()
    //operations
    myDebugger (getCurrentFunctionName(), informationString)
    </code>
    Then my debugger will have richer information which indicates in which function information is dumped. Have I made myself understood? If Java does not have such apporach to get current function name automatically, I have to define a function local variable which contains function name manually in each function I want to debug. And pass the variable to my debugger which seems rather silly.
    Can anyone help?
    Thanks in advance,
    George

    To elaborate a little: be sure to read the API on getStackTrace: because of JVM optimization
    there may be missing stack trace info, so look before you leap:
    public class Client {
        public static void main(String[] args) {
            f();
        static void f() {
            Debugger.log("testing");
    class Debugger {
        public static void log(String msg) {
            StackTraceElement[] trace = new Throwable().getStackTrace();
            if (trace.length >= 1) {
                StackTraceElement elt = trace[1];
                System.out.println(elt.getFileName() + ": " + elt.getClassName() + "." +
                    elt.getMethodName() + "(line " + elt.getLineNumber() + "): " + msg);
            } else
                System.out.println("[UNKNOWN CALLER]: " + msg);
    }

  • How to get current tab name or tab id or related info?

    Hi ,
    I would like to hide/show tabs according to users' page privileges list. So I need get current tab ID or tab Name in runtime environment to know if show/hide it for current user. :APP_USER
    Could you please provide any info about this requirement? Or do you have alternative method to control tabs' hide/show?
    thanks
    Ruiping

    最爱用中文 wrote:
    Hi Jari,
    Thanks for your info. Even if set authorize schema to tabs, I still need to get the relationship between "current tab" and "privilege&users". So I think evrm's hard-code method above is avaliable.I agree with Jari: APEX provides Authorization schemes specifically for this purpose. You need to reverse your thinking on how to implement this.
    For more information consult the documentation on APEX security, specifically using authorization schemes to restrict access to pages and control rendering of components.
    Tutorial: Adding Security to your Database Application (APEX 4.0)
    Use Authorization Schemes to control access/rendering for security ("only managers see/access this page and it's associated tab"); and Conditions to control rendering for functional reasons ("region only displayed if account is in arrears").
    Authorization Schemes have the benefits of being reusable, performing better, and allowing central maintenance of security-related code. This makes it easier to change the implementation&mdash;say moving from role information held in database tables to groups defined in LDAP.
    I worked for a number of years with an application where authorization schemes are not properly used (decisions made before my involvement) and all security and business logic relating to rendering and processing is wrapped up in spaghetti code in conditions. It's impossible to maintain.
    It is of course advisable to make both authorization scheme and business logic condition code more reusable and maintainable by locating it in API packages.

  • To Get current System Name / Machine Name

    Hi all,
    Is there any thing to get the current System Name or Machine Name In PL/SQL?
    Thanks in advance.
    Regards,
    GowriShankar.N

    Try :
    SELECT p.pid, p.spid, p.program, s.sid, s.program
    into lvpid, lvspid, lvprogram, lvsid, lvprogram2
    FROM v$process p, v$session s
    WHERE p.addr = s.paddr AND s.sid = (SELECT sys_context('userenv', 'sid') FROM dual);
    display :
    PID SPID PROGRAM SID PROGRAM
    25 12278 oracleBECD@v480d-01 145 SQL Developer
    1 rows selected

  • How to get current view name on clicking device back button?

    Hi,
    iam wriing a function for handling device back button(in android) press in my app.controller.js .How to get current viewname when clicking device back button.
    code samples will be helpful.
    my app.controller.js looks like below
    sap.ui.controller("com.opensap.App", {
      onInit : function() {
      document.addEventListener("deviceready", onDeviceReady, false);
      onBeforeShow : function(evt) {
      navButtonTap : function(evt) { 
    function onBackKeyDown(){
      //alert("hai");
      //sap.ui.getCore().byId("SalesDetail").app.backToPage("ProductList");
      //sap.ui.getCore().byId("ProductList").app.backToPage("Dashboard");
      //sap.ui.getCore().byId("SupplierDetail").app.backToPage("Dashboard");
    function onDeviceReady(){
       document.addEventListener("backbutton", onBackKeyDown, false);

    I somehow managed to find the solution
    function onBackKeyDown(){
      var app = sap.ui.getCore().byId("LoginDetail").app;
      app.back();

  • Caml query - get current user name

    I have an external list via BDC (so cannot change column type, create calculated column or workflow
    ). There is a text column “Supervisor”. I need to create a view that display all items which the value of “Supervisor” = current login user’s display name or login name (windows user name). 
    I tried set up the field on the UI with [Me] function which does not work because “Supervisor” is not an user/group type column. Now I am working on the code. I found the follow caml query on the web that is close to what I need:
    <Eq>
    <FieldRef Name='Supervisor' LookupId='TRUE'/>
    <Value Type='Integer'><UserID/></Value>
    </Eq>
    I know this only work if the ‘Supervisor’ type is “User”. I just wonder if someone know how to replace the <Value> with a text string
    of the current user’s display name or window name? I really appreciate for any help (I have struggled with this issue for a week).
    Forget to mention that I am working on a web part page in SharePoint designer, not in Visual Studio. So I cannot not using spcontext class.

    Thank you again for your response.  For this method, I need need to find a way to get the current user to a variable, the use the varrible in the query. This works for me:
    <ParameterBinding Name="UserID" Location="CAMLVariable;ServerVariable(LOGON_USER)" DefaultValue="CurrentUserName"/>
    <Eq>
    <FieldRef Name="Supervisor"/>
    <Value Type="Text">{UserID}</Value>
                    </Eq>
                    <Eq>
    <FieldRef Name="AttnMonitor"/>
    <Value Type="Text">{UserID}</Value>
                   </Eq>

  • Saving documents via Scripts: Get current file name and set save path/file type

    I am writing a script that will:
    -Make all layers invisible
    -Make a layer named "background" visible
    -Delete all the invisible layers
    -Save the docment as an EPS file (leaving the original document untouched)
    I am new to scripts and so have based my script by copying code from other scripts.
    Here is my code:
    var doc = app.activeDocument;
    var name = doc.name;
    var hide = function (){ // hide all layers (based on http://forums.adobe.com/thread/644267)
         var L=doc.layers.length;
         for (j=0;j<L;j++){  doc.layers[j].visible=false; }
    hide();
    // loop through all layers
    for (var i = 0; i < doc.layers.length; i++) {
                  // Create the illusrtratorSaveOptions object to set the AI options
        var saveOpts = new IllustratorSaveOptions();
        // Setting IllustratorSaveOptions properties.
        saveOpts.embedLinkedFiles = true;
        saveOpts.fontSubsetThreshold = 0.0
        saveOpts.pdfCompatible = true
    //Set up Variable to access layer name
              var currentLayer = app.activeDocument.layers[i];
    // Loop through the layers and make the back ground layer visible
              if (currentLayer.name == "Background") {
                        docName = name + currentLayer.name+".eps";
                        currentLayer.visible = true;
    // Delete Invisible Layers (based on http://www.cartotalk.com/index.php?showtopic=7491)
    var myDoc=app.activeDocument;
    var layerCount=myDoc.layers.length;
    for (var ii = layerCount - 1; ii >= 0; ii--) {
        var currentLayer = myDoc.layers[ii];
        currentLayer.locked = false;
        var subCount = currentLayer.layers.length;
        for (var ss =subCount -1; ss >= 0; ss--){
            var subLayer = currentLayer.layers[ss];
            subLayer.locked = false;
            if (subLayer.visible == false){
                subLayer.visible = true;
                subLayer.remove();
        if (currentLayer.visible == false){
            currentLayer.visible = true;
            currentLayer.remove();
    // Save Out Document with New Name
    var saveName = new File ( doc.path + "/" + docName );
    doc.saveAs( saveName, saveOpts );
    Everything works fine except:
    1) It saves the document with the name AdobeIllustratorBackground as opposed to the name of the document
    Also, I am not sure how to tell the script to save as EPS and to specify the save location.
    Could some one give me some pointers?          Thanks!

    Thanks! I changed my code to this:
    var title = doc.name;
    var title = title.substring(0, title.length - 3);
    And it now works! (The substring thing removes the .ai extenion).
    However, how do I get it to save it as an EPS? (I found this script that  saves as PNG, but I am not sure how to adapt it to EPS).
    Also, how do I set the file output path?
    Thanks for any help that can be offered.

  • Get current form name

    I thought this would have been easier. I want to retrieve the name of the current form (the one I just entered). Short of passing the form name as a parameter from the parent form is there an easy way.
    I tried
    Me.ActiveForm
    Form.ActiveForm
    Any ideas?
    John

    Me.Name ?
    or
    Dim currentForm As Form = Form.ActiveForm
    MessageBox.Show(currentForm.Name)

  • Using odiRef in ODI package to get current user name for Subject in OdiSendmail Step

    Hi,
    I am trying to do something simple and include the user name in a subject line of an OdiSendMail Step.  In the Expression editor for the Subject I use the following but to no avail.
    Push Data to HFM Started by <%=odiRef.getUser( String )%>
    What amI missing here?  Do I need to replace String with something like "UserName" or is there a different parameter to pass?  I tried Username but it didn't work.  Is this syntax correct or do I have to code it a different way?
    Thanks,
    T.

    Hi
    getUser has a parameter which is the property name to retrieve, you probably want the user name;
    http://docs.oracle.com/cd/E14571_01/integrate.1111/e12645/odiref_reference.htm#autoId70
    Something like....
    <%=odiRef.getUser( "USER_NAME" )%>
    Cheers
    David

  • Getting current user name

    I have only HttpSession Object. And I want to get information about the remoteUser().
    Certainly I have no request object. Any suggestion how to get userName.

    Some suggestions:
    - Some servlet containers put the remote user in proprietary session attributes. Try enumerating the attributes in the session to see if your server does this.
    - Put the remote user into a session attribute or a ThreadLocal variable at a point where you know the remote user. Maybe you can create a javax.servlet.Filter for this?

  • How to get current layer type (text, art, group layer, etc.)

    Hi,
    I am traversing over all layers using layerIndex.
    I can get current later name in following way.
    char* layerName = new char[100];
    int32 len = 100;
    PIUGetInfoByIndex(layerIndex,classLayer, keyName, layerName , &len) ;
    I need to get layer type using the someway. There exists a key called keyType.
    But I am not able access layer type that way. Why?
    If there is a better way, I wold like to know that too.

    Photoshop Scripting

  • How to get current layer type (text, art, group layer, etc.)r discussion here

    Hi,
    I am traversing over all layers using layerIndex.
    I can get current later name in following way.
    char* layerName = new char[100];
    int32 len = 100;
    PIUGetInfoByIndex(layerIndex,classLayer, keyName, layerName , &len) ;
    I tried  using the keys keyType and keyGroup in the same way but I am not able to directly get type of the layer. Why?
    Also, I found similar discussion, which is check the layer is SectionStart, SectionEnd or SectionContent.
    Get Layer Groups from C++ plugin
    If the layer is a "SectionContent", how to I further check its type (artlayer, textlater, adjustmentlayer, ect) ?

    apologize !
    I post the question in relevant forum. But I would like to ask extra explanation here.
    var ref = new ActionReference();                                                                                                               // create action reference
    ref.putProperty(stringIDToTypeID ("property"), stringIDToTypeID("layerKind"));                                            // add "layerKind" property to the reference
    ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );                   // what putEnumerated actually do ?
    var layerDesc = executeActionGet(ref);                                                                                                      // get the corresponding layer descriptor
    alert (layerDesc.getInteger(stringIDToTypeID("layerKind")));                                                                        / get its layerKind
    1. what putEnumerated actually do ?
    2. I am traversing each layer so that I have the layer object in JavaScript.
        How current layer object is refereed to above code segment ?

  • Current Tab Name or ID

    Hi,
    Is there a function which will give me the current tab name or ID ? I know there is APP_PAGE_ID for Pages. I am looking for something similar for the Tabs.
    Thanks
    Naresh

    You could try what Scott mentioned. Or I found a table APEX_APPLICATION_TABS where you could query an get all information about tabs.
    15:30:15 apexu1@dvlp > desc APEX_APPLICATION_TABS
    Name                                      Null?    Type
    WORKSPACE                                 NOT NULL VARCHAR2(255)
    APPLICATION_ID                            NOT NULL NUMBER
    APPLICATION_NAME                          NOT NULL VARCHAR2(255)
    TAB_SET                                   NOT NULL VARCHAR2(255)
    DISPLAY_SEQUENCE                          NOT NULL NUMBER
    TAB_NAME                                  NOT NULL VARCHAR2(255)
    WHEN_CURRENT_TAB_IMAGE                             VARCHAR2(255)
    WHEN_NOT_CURRENT_TAB_IMAGE                         VARCHAR2(255)
    TAB_IMAGE_ATTRIBUTES                               VARCHAR2(255)
    TAB_LABEL                                 NOT NULL VARCHAR2(2000)
    TAB_PAGE                                  NOT NULL NUMBER
    TAB_ALSO_CURRENT_FOR_PAGES                         VARCHAR2(4000)
    PARENT_TABSET                                      VARCHAR2(255)
    CONDITION_TYPE                                     VARCHAR2(255)
    CONDITION_EXPRESSION1                              VARCHAR2(4000)
    CONDITION_EXPRESSION2                              VARCHAR2(4000)
    BUILD_OPTION                                       VARCHAR2(261)
    AUTHORIZATION_SCHEME                               VARCHAR2(259)
    AUTHORIZATION_SCHEME_ID                            VARCHAR2(255)
    LAST_UPDATED_BY                                    VARCHAR2(255)
    LAST_UPDATED_ON                                    DATE
    COMPONENT_COMMENT                                  VARCHAR2(4000)
    TAB_ID                                    NOT NULL NUMBER
    COMPONENT_SIGNATURE                                VARCHAR2(1901)To get current tab name, you will have to filter with current page ID using APP_PAGE_ID against -
    TAB_PAGE column which has one value of page ID representing the default page of the tab
    and
    TAB_ALSO_CURRENT_FOR_PAGES column which contains comma-separated page ID under this tab.
    Ittichai
    Edited by: ittichai on Mar 5, 2009 3:38 PM

  • Get current method through reflection. Is it possible?

    Is it possible to get current method name (I mean method, which currently executes) through reflection.

    it would seem i am not the one that has a problemas I said, get over it. I have no problem with you whatsoever, I merely pointed out that your solution was a massively heavyweight one that almost certainly wasn't necessary. if you really can't take this sort of opposition, that's your own look out. but don't go trying to start a flame war just because somebody disagreed with you on a couple of points
    that's twice today you've posted something that actually wasn't pertinent to the original question, and rather than accept that, you insist on keeping dragging it up, re-defining terms and making passive-aggressive comments such as the one above. grow up
    The End

  • Get Current UserName in Infopath always returns the secure store service credential name

    I followed the 3 page tutorial here to get the current Display Name in an infopath textbox.https://spvee.wordpress.com/2013/04/10/auto-populate-user-information-in-infopath-with-claims-based-authentication-part-1-of-3/
    After several tries I narrowed down the problem to something very specific.
    It always shows the Display Name of the user used in the Credentials in the secure store service application. It doesnt use the current user.
    I do have access to the farm, but I didnt not install it, so am not aware if something is wrong on IIS/App Pools or service applications.
    Any idea??
    Follow me on Twitter
    levalencia Blog

    I followed the 3 page tutorial here to get the current Display Name in an infopath textbox.https://spvee.wordpress.com/2013/04/10/auto-populate-user-information-in-infopath-with-claims-based-authentication-part-1-of-3/
    After several tries I narrowed down the problem to something very specific.
    It always shows the Display Name of the user used in the Credentials in the secure store service application. It doesnt use the current user.
    I do have access to the farm, but I didnt not install it, so am not aware if something is wrong on IIS/App Pools or service applications.
    Any idea??
    Follow me on Twitter
    levalencia Blog

Maybe you are looking for