X Control Exec State Change with Panel Close

I have an X Control that launches VIs dynamically and loads them into subpanels. If I put this X Control on a VI front panel and that VI has its panel closed, but that panel close event is unhandled so LabVIEW takes the default panel close behavior, the exec state change never fires. If I reopen the VI however, it is stopped. Because of this, my shutdown user event which is sent in the Exec State Change event case never sends and my VI is left running in the background. 
Of course, I know the panel event should be handled, but this is about robustness of my X Control, not the panel close event handling. Is there any way I can capture this specific case?
CLA, LabVIEW Versions 2010-2013

DevonR wrote:
Hi,
Thanks for sending in the code.  Have you tried implementing an event structure?  With an event structure, you can set the event to, “Application Instance Close”, so that you can execute some code when a user executes the Quit LabVIEW function.  Please see attached screenshots.
Devon R.
Applications Engineer
National Instruments
This doesn't work because if you close an owning project but not LabVIEW, the refnum goes invalid. However, I got an answer from here that lets me know what I needed to.
CLA, LabVIEW Versions 2010-2013

Similar Messages

  • Control presence - function change with platform

    Hi Folks,
    I have a form with two controls that have the Object Presence set to Visible (Screen Only). The controls do not print in Acrobat 9 Pro or with Reader X, but they print in Acrobat Standard 9 and Reader 9. This is the case whether the form is saved as a static PDF or dynamic XML. Any suggestions why this is happening and how to fix it?
    Thanks!

    You might get a better response if you were to upload the form somewhere and post a link, it would be helpful to be able to see the form and look at how you've got the fields in question set up. Other things that might help, which version of Designer did you use to create the form? What's the target version the form is set to? If you can strike a balance between giving more info and not writing a book it helps a lot.
    djaknow

  • Problem with multiple sub-panels through Enum case structure: "The VI is not in a state compatible with this operation"

    Hello,
    I am using LabVIEW 8.0 and I am attempting to create a sub-panel that displays the front panel of a sub-vi depending on the selection made by the user via the Enum dropdown menu.  I have wired the Enum to a case structure and applied identical coding to each individual case structure except for obviously changing the sub-vi source.  However, I receive an error "The VI is not in a state compatible with this operation."  I was able to successfully make a single sub-vi work within a sub-panel using a true/false case structure and the exact same coding.  However, now that I am using an Enum box wired to a case structure, I receive this error.  I have attached my block diagram as well.  Could anyone assist me as to where it is that I am going wrong?
    Thanks in advance!
    Solved!
    Go to Solution.
    Attachments:
    enum subpanels.JPG ‏22 KB

    torm wrote:
    I have attached my block diagram as well
    I only see a picture. Can you attach the VI instead? At what point do you close the reference?
    torm wrote:
    I have wired the Enum to a case structure and applied identical coding to each individual case structure except for obviously changing the sub-vi source.
    Well, if the code is identical except for the source, only the source should be inside the case, right? Why duplicate code?
    LabVIEW Champion . Do more with less code and in less time .

  • How to control Object States of different objects with single button?

    I have a set of Images, stacked one on the other. I have selected all of them & created Object States for them. I also have a set of Text Objects, each containing a description of the images. These text objects are also stacked on top of each other & I've created object states for them too. I have two buttons which go to previous state & next state. When I do a mouse release operation on these buttons, only my images are moving from state to state.
    My question is how do I control the states of these different types of objects (images & type) so that they change states in sync with each other - I want to have an image 1 with its description, then image 2 with its description & so on. Thanks in advance.

    You just group your description with images

  • I cant access control on syncing iphone with mac air to get contact via outlook to change on phone

    I cant access control on syncing iphone with mac air to get contacts via outlook to change on phone. Worked fine on old itunes.

    Hi Steve, Thanks for that. When I conect the phone it comes up with iphoto and starts to sync and then when that is finnished the itunes window shows my phone syncing at the top of the screen. The only button that says iphone which is on top right only asks if I want to eject and then disapears when sync finnishes. I can not see any other way of showing a side bar view and i can not access any way of controling the sycn service. It seems to be syncing calander but not my contacts. Have I missed something?

  • Scale Object with Panel, but what about inside a Tab control?

    The Scale Object with Panel option works very well for simple UI
    objects.  I like to use it for VIs that display tables or
    multicolumn listboxes, etc.  I am finding a limitation when I use
    the Tab control.  If I have a table or listbox in each tab, I
    would like them to scale with the panel.  I would also like the
    tab to scale.  It should look like an Excel workbook where all
    sheets scale with the window even though they are each on their own
    tab.  If I could only Group the various tables / lists with the
    Tab itself....
    This wouldn't be such an issue if the Bounds property of the
    multicolumn listbox was writable.  I can set the number of rows
    and columns, but column size can be variable and not uniform across all
    columns.  Also, that solution looks and behaves much different
    from the Scale Object with Panel approach.... not to mention the extra
    coding required.
    I'm guessing that this amounts to a feature request, but if anyone has a present-version workaround, I'd love to hear about it.
    See you at NI Week!
    Dan Press
    PrimeTest Automation

    Hi Kalin T,
    Thanks for your prompt reply. I am running version 8.01. My problem is that i cannot select "Scale object with pane" for the controls inside a Tab control if the Tab control "Scale object with pane" is turned on. I want both the Tab control and the controls inside to be scaled, for instance an Waveform graph or an textbox  when i resize my main window.
    Best regards,
    Mattis
    Attachments:
    Scale.vi ‏11 KB

  • How to Control the Favorites  T-code Description changed with the Logon La

    Dear All,
             I have a issue for this: user want to set Favorites Description changed with the Logon langue, For example: In EN Langue, The MM01 in Favorites is u2018Material createu2019, If user used the other Langue, he want the u2018Material createu2019 changed the logon langue.
    If the t-code in SAP menu, the description can change with logon langue?
    How to set?
    Please help me!
    Thanks
    Sun
    Edited by: sun on Dec 19, 2008 2:23 AM

    hi,
    pls check this link
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci862499,00.html
    use these FM
    STREE_USER_FAVORITES_COPY
    STREE_FAVORITES_MAINTAIN
    thanks

  • Panel Close? Event causes front panel to be unresponsive

    I'm trying to create a simple program. There is a while loop that generates random numbers just so I can see it's running. An "Exit" button is wired to the exit terminal of the while loop. An event structure is also in this while loop, which catches "Panel Close?" and discards it, then wires true to the exit terminal of said while loop. To be more specific, the exit terminal takes an OR statement that takes the Exit button and this Event Structure boolean as inputs. However, when I run the program, the Exit button doesn't respond, though with highlight execution the event structure part of the program seems to be working. Sorry if I'm bad at explaining, any help is appreciated.
    I guess my real question is, how do you properly implement that an exit button stops the loop and clicking the red x or File:Close is ignored and instead does the same thing as your Exit button.
    Solved!
    Go to Solution.
    Attachments:
    ex1.vi ‏10 KB

    For applications that require a user interface I prefer to use a producer/consumer architecture. The producer loop with the event structure essentially does nothing but deal with the UI. It will process UI events as well as provide the ability to update the UI. The consumer loop(s) do the actual work. These loops are generally some form of a state machine but they allow messages to be passed from the producer loop for control purposes. Most common are start, stop and exit events. This type of approach allows your UI to be very responsive to user input. Even though your application may take time to shut down cleanly you can immediately let the user know you are going into shut down mode. They know you receive their input and are working on it. This prevents them from pressing the stop button multiple times. If your shut down does take a very long time make sure you provide regular updates to the user informing them you are still running and not simply hung.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How can I initialize all TabNavigator Tabs upon a state change?

    Here's the basic goal. I want to provide two views to the
    user that display the same panels. I configured each view as a
    separate state but I am having trouble initializing each of the tab
    views since they are only created by Flex when the user first
    selects it. I need them all created when the user changes to that
    state so that I can insert my view objects. Does that make sense?
    Ok, how about an example program. I define three view objects
    in ActionScript which will be used in two different states. I use
    AddChild to put them in the proper layout location. The problem is
    with the Tab state. The AddChild operation only works for the first
    tab because it is visible. The other two tabs don't get setup
    properly. Can anyone help me resolve this?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    creationComplete="onCreationComplete()">
    <mx:Script>
    <![CDATA[
    import mx.containers.VBox;
    import mx.controls.Label;
    [Bindable] public var view1:VBox;
    [Bindable] public var view2:VBox;
    [Bindable] public var view3:VBox;
    private function onCreationComplete():void
    var label1:Label = new Label();
    var label2:Label = new Label();
    var label3:Label = new Label();
    label1.text = "This is view 1.";
    label2.text = "This is view 2.";
    label3.text = "This is view 3.";
    view1 = new VBox();
    view1.label = "View 1";
    view1.addChild(label1);
    view2 = new VBox();
    view2.label = "View 2";
    view2.addChild(label2);
    view3 = new VBox();
    view3.label = "View 3";
    view3.addChild(label3);
    currentState = "wizardState";
    private function changeState():void
    switch(stateBox.selectedItem.data)
    case 0: currentState = 'wizardState'; break;
    case 1: currentState = 'tabState'; break;
    ]]>
    </mx:Script>
    <mx:Panel id="mainPanel" title="Tab View Bug" width="400"
    height="320"/>
    <mx:ComboBox id="stateBox" change="changeState()">
    <mx:dataProvider>
    <mx:Object label="Wizard" data="0"/>
    <mx:Object label="Tabbed" data="1"/>
    </mx:dataProvider>
    </mx:ComboBox>
    <mx:states>
    <mx:State name="wizardState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:HBox width="100%" height="100%"
    verticalAlign="top">
    <mx:ToggleButtonBar id="wizardButtonBar" width="20%"
    direction="vertical"
    dataProvider="{wizardViewStack}"/>
    <mx:ViewStack id="wizardViewStack" width="80%"
    selectedIndex="{wizardButtonBar.selectedIndex}"/>
    </mx:HBox>
    </mx:AddChild>
    <mx:AddChild target="{view1}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    <mx:AddChild target="{view2}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    <mx:AddChild target="{view3}"
    relativeTo="{wizardViewStack}" position="lastChild"/>
    </mx:State>
    <mx:State name="tabState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:TabNavigator id="tabViewStack" width="100%"
    height="100%">
    <mx:VBox label="Tab 1" id="tab1"/>
    <mx:VBox label="Tab 2" id="tab2"/>
    <mx:VBox label="Tab 3" id="tab3"/>
    </mx:TabNavigator>
    </mx:AddChild>
    <mx:AddChild target="{view1}" relativeTo="{tab1}"
    position="lastChild"/>
    <mx:AddChild target="{view2}" relativeTo="{tab2}"
    position="lastChild"/>
    <mx:AddChild target="{view3}" relativeTo="{tab3}"
    position="lastChild"/>
    </mx:State>
    </mx:states>
    </mx:Application>

    Ok, here is an even simpler scenario. I take each view from
    the default state and put them in the new tab view when the state
    changes. If you compile and run this example, the only view that
    makes it into the tabview is the one that was active when the state
    changed. Why is that?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical">
    <mx:Script>
    <![CDATA[
    private function changeState():void
    switch(stateBox.selectedItem.data)
    case 0: currentState = ''; break;
    case 1: currentState = 'tabState'; break;
    ]]>
    </mx:Script>
    <mx:Panel id="mainPanel" title="Tab View Bug" width="400"
    height="320">
    <mx:HBox id="wizardView" width="100%" height="100%"
    verticalAlign="top">
    <mx:ToggleButtonBar id="wizardButtonBar" width="20%"
    direction="vertical"
    dataProvider="{wizardViewStack}"/>
    <mx:ViewStack id="wizardViewStack" width="80%"
    selectedIndex="{wizardButtonBar.selectedIndex}"
    creationPolicy="all">
    <mx:Canvas id="view1" label="Part 1" >
    <mx:TextInput text="This is view 1"/>
    </mx:Canvas>
    <mx:Canvas id="view2" label="Part 2">
    <mx:TextInput text="This is view 2"/>
    </mx:Canvas>
    <mx:Canvas id="view3" label="Part 3">
    <mx:TextInput text="This is view 3"/>
    </mx:Canvas>
    </mx:ViewStack>
    </mx:HBox>
    </mx:Panel>
    <mx:ComboBox id="stateBox" change="changeState()">
    <mx:dataProvider>
    <mx:Object label="Wizard" data="0"/>
    <mx:Object label="Tabbed" data="1"/>
    </mx:dataProvider>
    </mx:ComboBox>
    <mx:states>
    <mx:State name="tabState">
    <mx:AddChild relativeTo="{mainPanel}"
    position="lastChild">
    <mx:TabNavigator id="tabView" width="100%" height="100%"
    creationPolicy="all">
    <mx:Canvas label="Tab 1" id="tab1"/>
    <mx:Canvas label="Tab 2" id="tab2"/>
    <mx:Canvas label="Tab 3" id="tab3"/>
    </mx:TabNavigator>
    </mx:AddChild>
    <mx:RemoveChild target="{view1}"/>
    <mx:AddChild target="{view1}" relativeTo="{tab1}"/>
    <mx:RemoveChild target="{view2}"/>
    <mx:AddChild target="{view2}" relativeTo="{tab2}"/>
    <mx:RemoveChild target="{view3}"/>
    <mx:AddChild target="{view3}" relativeTo="{tab3}"/>
    <mx:RemoveChild target="{wizardView}"/>
    </mx:State>
    </mx:states>
    </mx:Application>

  • Using Control Reference to change subVI control - sub VI also called using a container

    Hello
    I am in need to update a control inside a sub VI that is also called inside a container in the main VI.
    Please see the project attached.
    My goal is simple -
    Change the "Main VI calling sub VI-Container.vi " panel's "FGV state"
    once the state changes, it needs to be propagated to the sub VI that is called within the container
    The sub VI's (sub VI called is "Check Time FGV.vi")  "FGV state" also needs to change when the main front panel's control
    How do I accomplish this ? just a FYI - the sub VI being called is at "C:\Projects\User Examples\Check Time with FGV\Check Time FGV.vi"
    Also my stop button functionality is broken, not sure why.
    Thanks for your help.
    Attachments:
    Check Time.lvproj ‏6 KB

    OK you have a few problems.  Lets address the Stop button first:
    Add a value change event for the stop button and put the stop button in that case.  Wire the button out of the event structure to the conditional terminal of the while loop.  WHAT IS HAPPENING:  You press "Stop" but the event structure is still waiting for an event so the loop never iterates.  Get rid of the wait.  the CPU will not be hogged unless you are generating events at warp speed.  No user can generate events that fast! so the loop will not be greedy.  The event structure does wait for an event it does not poll for them by running contineously.
    Now your subpanel.  You do know that the FGV runs once when you invoke the run method on it right?  You can change the contol value all you want but the vi won't do anything about it because the vi is not running.  And even if the vi WAS running changing the value of a control that is read once (outside the loop) would not cause the value on the wire inside the loop to change at all.  Does that clear up some of why what you are attempting will not work like that?
    Jeff

  • Need help created state machine with timed digital output

    Hello everyone I'm new in LabView especially about how to make a state machine. I want to make simulation about state machine with digital output. In Front Panel there are volt_in as an input slider (0-10 V), two numeric control (upper limit and bottom limit), a waveform chart to plot those 3 value, and three boolean (P0.0, P0.1, P0.2) as an indicator. Boolean indicator will on if input from slider exceed the limit in certain situation. This simulation will work as follow:
    1. Define the upper & bottom limit (ex. 8 & 4V)
    2. Make an input from slider (0-10V)
    3. If input (2) exceed the upper limit but less than 10 second (ex. you have 9V input for 8 second, but after 8 second you change the slider back to normal between 4-8V) then the boolean indicator P0.0 & P0.2 will stay off
    4. If input (2) exceed the upper limit more than 10 second (ex. you have 9V input for 4 second, change to 8.5 V for 3 second, and then change to 10V for 3 second) then the boolean indicator P0.0 will turn on for 5 second, turn off, then follow by indicator P0.2 for 5 second, and turn off
    5. Wait 15 second, then repeat process from (2)
    Same process for input that exceed the bottom limit (P0.1 and P0.2 as indicator).
    Can you help me make the block diagram of this process? I will appreciate any of your help.
    Best Regards
    juventom 
    Attachments:
    State Machine Digital Output.vi ‏28 KB

    I would highly recommend you to open the template in LabVIEW to design state machines. You can the Standard State Machine template if you go to File -> New.. and Browse to VI -> From Template -> Frameworks -> Design Patterns.
    Also, here is a good explanation of one:
    https://decibel.ni.com/content/groups/northeast-oh-labview-users/blog/2009/09/08/state-machines
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Doubt in control break statement

    Hi All,
    Is there any way to trigger control break statements at new & at end of for non primary key fields.
    i want to trigger both control break statements for my requirement , not at change of, because i want to trigger at end of also. Please let me know if any possibility. Thanks
    regards
    vishal

    hi vishal,
    Variants:
    1. AT NEW f.
    2. AT END OF f.
    3. AT FIRST.
    4. AT LAST.
    Effect
    In a LOOP which processes an internal table, you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT. The sequence of statements which lies between them is then executed if a control break occurs.
    You can use these key words for control break processing with internal tables only if a loop is actively processing an internal table and reference is to the innermost currently active loop.
    The control level structure with internal tables is static. It corresponds exactly to the sequence of columns in the internal table (from left to right). In this context, the criteria according to which you sort the internal table are unimportant.
    At the start of a new control level (i.e. immediately after AT), the following occurs in the output area of the current LOOP statement:
    All character type fields (on the right) are filled with "*" after the current control level key.
    All other fields (on the right) are set to their initial values after the current control level key.
    Between AT and ENDAT, you can use SUM to insert the appropriate control totals in the numeric fields (see also ABAP Number Types) of the LOOP output area (on the right) after the current control level key. Summing is supported both at the beginning of a control level (AT FIRST, AT NEW f) and also the end of a control level (AT END OF f, AT LAST).
    At the end of the control level processing (i.e. after ENDAT), the old contents of the LOOP output area are restored.
    Notes
    When calculating totals, you must ensure that the totals are inserted into the same sub-fields of the LOOP output area as those where the single values otherwise occur. If there is an overflow, processing terminates with a runtime error.
    If an internal table is processed only in a restricted form (using the additions FROM, TO and/or WHERE with the LOOP statement), you should not use the control structures for control level processing because the interaction of a restricted LOOP with the AT statement is currenly not properly defined.
    With LOOPs on extracts, there are also special control break control structures you can use.
    Note
    Non-Catchable Exceptions:
    SUM_OVERFLOW: Overflow when calculating totals with SUM.
    Variant 1
    AT NEW f.
    Variant 2
    AT END OF f.
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.See Compatible Work Area with Control Level Processing and Field Symbols Not Allowed as Control Level Criterion.
    Effect
    f is a sub-field of an internal table processed with LOOP. The sequence of statements which follow it is executed if the sub-field f or a sub-field in the current LOOP line defined (on the left) before fhas a different value than in the preceding (AT NEW) or subsequent (AT END OF) table line.
    Example
    TYPES: BEGIN OF COMPANIES_TYPE,
            NAME(30),
            PRODUCT(20),
            SALES TYPE I,
          END   OF COMPANIES_TYPE.
    DATA: COMPANIES TYPE STANDARD TABLE OF COMPANIES_TYPE WITH
                         NON-UNIQUE DEFAULT KEY INITIAL SIZE 20,
          WA_COMPANIES TYPE COMPANIES_TYPE.
    LOOP AT COMPANIES INTO WA_COMPANIES.
      AT NEW NAME.
        NEW-PAGE.
        WRITE / WA_COMPANIES-NAME.
      ENDAT.
      WRITE: / WA_COMPANIES-PRODUCT, WA_COMPANIES-SALES.
      AT END OF NAME.
        SUM.
        WRITE: / WA_COMPANIES-NAME, WA_COMPANIES-SALES.
      ENDAT.
    ENDLOOP.
    The AT statements refer to the field COMPANIES-NAME.
    Notes
    If a control break criterion is not known until runtime, you can use AT NEW (name) or AT END OF (name) to specify it dynamically as the contents of the field name. If name is blank at runtime, the control break criterion is ignored and the sequence of statements is not executed. If name contains an invalid component name, a runtime error occurs.
    By defining an offset and/or length, you can further restrict control break criteria - regardless of whether they are specified statically or dynamically.
    A field symbol pointing to the LOOP output area can also be used as a dynamic control break criterion. If the field symbol does not point to the LOOP output area, a runtime error occurs.
    If you use AT within a LOOP with an explicitly-specified output area, the area must be compatible with the line type of the internal table so that it can be initialized properly (as described above) at the start of a new control level.
    You can restrict control break criteria further, regardless of whether they were defined statically or dynamically, by specifying offset and/or length.
    Variant 3
    AT FIRST.
    Variant 4
    AT LAST.
    Effect
    Executes the appropriate sequence of statements once during the first (AT FIRST) or last (AT LAST) loop pass.
    Example
    TYPES: BEGIN OF COMPANIES_TYPE,
            NAME(30),
            PRODUCT(20),
            SALES TYPE I,
          END   OF COMPANIES_TYPE.
    DATA: COMPANIES TYPE STANDARD TABLE OF COMPANIES_TYPE WITH
                         NON-UNIQUE DEFAULT KEY INITIAL SIZE 20,
          WA_COMPANIES TYPE COMPANIES_TYPE.
    LOOP AT COMPANIES INTO WA_COMPANIES.
    AT FIRST.
    SUM.
    WRITE: 'Sum of all SALES:',
    55 WA_COMPANIES-SALES.
    ENDAT.
    WRITE: / WA_COMPANIES-NAME, WA_COMPANIES-PRODUCT,
    55 WA_COMPANIES-SALES.
    ENDLOOP.

  • An INSERT EXEC statement cannot be nested.Please tel me some good way of formulation in following situation.

    Hi,
        The following query is showing error An INSERT EXEC statement cannot be nested
    CREATE PROCEDURE [dbo].[Procedur3]
    @para1 int
    AS
    BEGIN
    CREATE TABLE #tem
    select * from detialpar where did=@para1
    --this code is quite big and is called from many place so we kept it inside this SP , so that we can call the sp to get result.
    END
    CREATE PROCEDURE [dbo].[Procedur2]
    @para1 int
    @para2 datetime
    AS
    BEGIN
    CREATE TABLE #tem
    insert into #tem (value) exec [dbo].[Procedure3] @para1
    exec ('select * from abc
    left join #tem on id=temid
    where id =' + cast(@para1 as varchar) -- i do not want to change this big dynamic query, because it has many optonal code concatinated by using "if then else".
    END
    CREATE PROCEDURE [dbo].[Procedure1]
    @para1 int,
    @para2 datetime
    AS
    BEGIN
    delete from table1 where id=@para1
    insert into table1 ( col1,col2) exec Procedure2 @para1,@para2
    ……. There are many blocks in this SP where we are deleting and inserting with different SP .
    select Name,Amount from #Temp1
    END
    CREATE PROC Procedure
    AS
    BEGIN
    SET TRANSACTION ISOLATION LEVEL SNAPSHOT
    SET NOCOUNT ON
    LOOP "A" starts here which gests id from a table xyz @para1
    begin try
    begin trans
    exec [Procedure1] @para1
    LOOP "A" ents here
    COMMIT TRANSACTION;
    END TRY
    BEGIN CATCH
    IF @@trancount > 0 ROLLBACK TRANSACTION;
    END CATCH;
    END
    GO
    Please tel me some good way of solving the error.
    yours sincerly

    You can not do like above:
    Try the below:(Not tested), Below, we do not change the code, however, we placed your dynamic execution to different procedure.
    CREATE PROCEDURE [dbo].[Procedur3]
    @para1 int
    AS
    BEGIN
    CREATE TABLE #tem
    insert into #tem (value)
    select * from detialpar where did=@para1
    --this code is quite big and is called from many place so we kept it inside this SP , so that we can call the sp to get result.
    END
    CREATE PROCEDURE [dbo].[Procedur2]
    @para1 int
    @para2 datetime
    AS
    BEGIN
    CREATE TABLE #tem
    exec [dbo].[Procedure3] @para1
    END
    CREATE PROCEDURE [dbo].[Procedure1]
    @para1 int,
    @para2 datetime
    AS
    BEGIN
    delete from table1 where id=@para1
    insert into table1 ( col1,col2)
    exec ('select * from abc
    left join #tem on id=temid
    where id =' + cast(@para1 as varchar) -- i do not want to change this big dynamic query, because it has many optonal code concatinated by using "if then else".
    ……. There are many blocks in this SP where we are deleting and inserting
    with different SP .
    select Name,Amount from #Temp1
    END
    CREATE PROC Procedure
    AS
    BEGIN
    SET TRANSACTION ISOLATION LEVEL SNAPSHOT
    SET NOCOUNT ON
    LOOP "A" starts here which gests id from a table xyz @para1
    begin try
    begin trans
    exec [Procedure1] @para1
    LOOP "A" ents here
    COMMIT TRANSACTION;
    END TRY
    BEGIN CATCH
    IF @@trancount > 0 ROLLBACK TRANSACTION;
    END CATCH;
    END
    GO

  • Exec.State and Start Asynchrono​us Call

    In my application I like to start a VI asynchronously by pressing a button control. I just want to have one instance of the VI running so I let the caller test if the VI is already running. Unfortunately there seems to be a bug in the Exec.State property if you use it with a VI reference that has been built with a type specifier. It returns always "Running" as state.
    I found a workaround by first openening a "normal" reference to the VI, questioning the Exec.State property, closing the reference and opening the "typed" reference. That works like I think it should.
    My question: Is this difference in behaviour of the "VI" property node and the "VI Interface Type 1" property node by design or is this a bug in LV 2012 (I have not tested it with another version) ?
    Matthias

    I just wanted to point out about the very reason of the situation:
    These are the options you can read by the Execution State property. As already marked, "Running" indicates that the VI is (at least) reserved for execcution. It does not necessarily mean that the VI is actually executing!
    That being said, opening a typified reference to the VI already reserves the VI for running, hence your property node returns this value.
    Your workaround seems to be well-thought out and should work in any case. Y already gave another option of handling this situation.
    I doubt that there is another, better solution other to these two.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Control break statements

    Hi friends,
           pls explain , what is the use of control break statements( at first, at last, at new, at end of, on change of ) ? and practical difference applying at new and on change.
    Pls send me material or links related to control break statements.
    Thanks in advance.
    SR K

    Hello SR K,
    Just go through the following documentation.
    AT - Control breaks with extracts
                  Variants:
                  1. AT NEW f.
                  2. AT END OF f.
                  3. AT FIRST.
                  4. AT LAST.
                  5. AT fg.
    Effect        In a LOOP which processes a dataset created with EXTRACT, you
                  can use special control structures for control break
                  processing. All these structures begin with AT and end with
                  ENDAT. The sequence of statements which lies between is
                  executed whenever a control break occurs.
                  You can use these key words for control break processing with
                  extract datasets only if the active LOOP statement is
                  processing an extract dataset.
                  The control level structure with extract datasets is dynamic.
                  It corresponds exactly to the sort key of the extract dataset,
                  i.e. to the order of fields in the field group HEADER by which
                  the extract dataset was sorted.
                  At the end of a control group (AT END OF, AT LAST), there are
                  two types of control level information between AT and ENDAT:
                  -  If the sort key of the extract dataset contains a
                     non-numeric field h (particularly in the field group
                     HEADER), the field CNT(h) contains the number of control
                     breaks in the (subordinate) control level h.
                  -  For extracted number fields g (see also ABAP Number Types),
                     the fields SUM(g) contain the relevant control totals.
    Notes         1. The fields CNT(h) and SUM(g) can only be addressed after
                     they have been sorted. Otherwise, a runtime error may
                     occur.
                  2. The fields CNT(h) and SUM(g) are filled with the relevant
                     values for a control level at the end of each control group
                     (AT END OF, AT LAST), not at the beginning (AT FIRST, AT
                     NEW).
                  3. When calculating totals with SUM(g), the system
                     automatically chooses the maximum field sizes so that an
                     overflow occurs only if the absolute value area limits are
                     exceeded.
                  4. You can also use special control break control structures
                     with LOOPs on internal tables.
    Variant 1     AT NEW f.
    Variant 2     AT END OF f.
    Effect        f is a field from the field group HEADER. The enclosed
                  sequence of statements is executed if
                  -  the field f occurs in the sort key of the extract dataset
                     (and thus also in the field group HEADER) and
                  -  the field f or a superior sort criterion has a different
                     value in the current LOOP line than in the preceding (AT
                     NEW) or subsequent (AT END OF) record of the extract
                     dataset.
                  If f is not an assigned field symbol, the control break
                  criterion is ignored, and the subsequent sequence of
                  statements is not executed. If a field symbol is assigned, but
                  does not point to the HEADER field group, the system triggers
                  a runtime error.
    Example
                  DATA: NAME(30),
                        SALES TYPE I.
                  FIELD-GROUPS: HEADER, INFOS.
                  INSERT: NAME  INTO HEADER,
                          SALES INTO INFOS.
                  LOOP.
                    AT NEW NAME.
                      NEW-PAGE.
                    ENDAT.
                    AT END OF NAME.
                      WRITE: / NAME, SUM(SALES).
                    ENDAT.
                  ENDLOOP.
    Notes         1. If the extract dataset is not sorted before processing with
                     LOOP, no control level structure is defined and the
                     statements following AT NEW or AT END OF are not executed.
                  2. Fields which stand at hex zero are ignored by the control
                     break check with AT NEW or AT END OF. This corresponds to
                     the behavior of the SORT statement, which always places
                     unoccupied fields (i.e. fields which stand at hex zero)
                     before all occupied fields when sorting extract datasets,
                     regardless of whether the sort sequence is in ascending or
                     descending order.
    Variant 3     AT FIRST.
    Variant 4     AT LAST.
    Effect        Executes the relevant series of statements just once - either
                  on the first loop pass (with AT FIRST) or on the last loop
                   pass (with AT LAST).
    Variant 5     AT fg.
                   Addition:
                   ... WITH fg1
    Effect        This statement makes single record processing dependent on the
                   type of extracted record.
                   The sequence of statements following AT fg are executed
                   whenever the current LOOP record is created with EXTRACT fg
                   (in other words: when the current record is a fg record).
    Addition      ... WITH fg1
    Effect        Executes the sequence of statements belonging to AT fg WITH
                   fg1 only if the record of the field group fg in the dataset is
                   immediately followed by a record of the field group fg1.
    Reward If Helpful
    Regards
    Sasidhar Reddy Matli.

Maybe you are looking for

  • My computer is no longer connecting to the TV. through HDMI

    My computer is no longer connecting to the TV. I was using an HDMI and an adapter to my macbook pro 2013. It was working perfectly fine eariler today but then stopped working. I tested it on another mac and it did not work as well. The HDMI is alrigh

  • 'Mass maintainence ' of  Plug-in settings for users in cFolders

    Hi All In cFolders  under settings---> General , we have a checkbox for Plug-in. Can the cFolders admin enable the plug-in for all the users in cfolders through some mass maintainence transaction? Pls. let me know, if you have any inputs on this. war

  • Sd billing with wbs element

    dear all, please understand the scenario example: item - "cable" . total order quantity - 5 kilometers of installation installation charges: 100000 per kilometer. (total order value- 500000) billing can be done partially.  (multiple invoices against

  • Posting period closed"

    Hi, My period is open till august 2008.. Still i am able to receive goods at current date i.e. 3.11.2008. There is no error coming as " posting period closed" tx uts

  • Can I create my own indicator?

    I like to use a product image as an indicator which is turning around its center, the angle is set via a terminal.