Event handler switch creation (for repeated use )

Im creating a hyperterminal like application which reads from serial port and  writes into serial port.
The reading and writing works almost fine..I also wants to create some custom "Key controls" that will send some prestored commands to the serial port.
I currently implemented two commands "ESC" and "FLASH " in the Key controls menu..
I want to send these commands ESC and FLASH each time i click a button in the menu.
I used event handler for it..and put the event handler inside an always running while loop.
But the problem is I can send only these commands only for one time during execution.
Repeated pressing of switches doesnt cause any effects..
Can somebody help please???
Im using labview 6.1. If u modify VIs using higher versions i cant open here..kindly include a jpg screenshot inthat case.
Thanking you.
Stephen.
Attachments:
Serial Port(stable release)1.2.vi ‏113 KB
Init.vi ‏32 KB
Write.vi ‏44 KB

Hi Stephen,
in LV7.1 your events will be executed whenever I press one of the according switches...
Notes:
-Don't make several event structures. Instead make one event structure with several event cases. Read the context help for the event structure!
-I would suggest to set the mechanical action of both switches to "latch when pressed" instead of "switch..." to give a feedback to the user as the switch will be reset after reading it...
-Generally be more styleguide-conform! Use right-click on terminals to create controls/constants to avoid coercion dots (spot the red colored dots in the image?). Make error in/out in the lower left/right of the connector pattern. Avoid block diagrams larger than the screen (or what kind of monitor do you use?).
Edited:
Sorry for weird display. I have to get used to the new image gallery feature of the forum (and will use "image to the left" only on rare conditions). Btw. the preview looks different to the actual post
Message Edited by GerdW on 05-28-2009 06:59 AM
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome

Similar Messages

  • How do I save the width and height of a photo for repeated use?

    How do I save the width and height of a picture for repeated use, rather than having to enter it each time in the 'new file' box?
    Thanks,  Ed Jackson.

    It could be that I'm older and have forgotten. I'm now 73 and will admit I have forgotten many things over the years. I have been using Photoshop since Photoshop version 3.  And can not really recall which features or changes were made in ever version of Photoshop I have installed.  Adobe has added many features over the years. The number of bugs introduce has also greatly increased after CS3.  "New Doc Sizes.psp"  in your user id preferences is edited using the two buttons in the new document dialog.
    As for guide lines in new documents Photoshop CS6 or CC seem to add some for video file presets with guide lines.  I do not know how to edit or add guide line to new doc presets. Guide line actions are easy to create. I have also seem some guideline in new documents when I did not expect any perhaps a new bug. Photoshop like most software has bugs. If you do not see Adobe new presets perhaps you copied an old  "New Doc Sizes.psp"  over Adobe's newer default file or Adobe migrared you presets and wand wiped their presets out. There are bugs. Close Photoshop down and rename your current  "New Doc Sizes.psp"  in you user id Photoshop cc preferences folder and start Photoshop it will add a dedault  "New Doc Sizes.psp"  file see if you see Adobe new presets in the new doc pull down when you select video and film...

  • Is there a way to make an event handler to watch for inbound socket action?

    So I have a program that I've put on hold till spring break: Its a simple TCP/IP chat program for MUDs or IRC servers. Now its time to get this monkey running.
    Right now I have a problem where it locks up after initiating the connection to release after the server disconnects on it's side. I've tried futzing with threads but that was too complicated for this problem. If I could just have it act like an event where it spits out the info received from the IRC/MUD server, that would be ideal.
    Any suggestions?
    PS: In the past I tried posting my code but no one here seemed to understand what I was trying to do.
    CodeDragon

    There's nothing built-in to do what you want. I looked at the code from your old posting and I see two potential problems with yoru read code.
    1. I'm not sure why are you using the "in.reset()"... I doubt that's the cause, but I don't think you need it.
    2. I think your loop is incorrect. Your loop will keep reading until the Reader hits the EOF--which is a server disconnect in this case.
    What you want is something like:
    boolean eof = false;
    while(in.ready() && !eof) {
       String line = in.readLine();
       if(line!=null) {
          scroll.append(line);
          scroll.append('\n');
       } else {
          eof = true;
    }If you wanted to make this asynchronous, use your old loop, but push the lines out to a queue of some sort...somethign like:
    java.util.BlockingQueue <String>queue = new BlockingQueue<String>();
    Runnable r = new Runnable() {
    public void run() {
       String line = null;
       while( (line = in.readLine()) != null) {
         queue.put(line);
       queue.put(null); //tells your loop to abort
    Thread t = new Thread(r);
    t.start();
    String line = null;
    while( (line = queue.take()) !=null) {
       System.out.println(line);
    }Edited by: James_Schek on Mar 20, 2008 4:50 PM

  • Delivery Document creation for STO using BAPI_OUTB_DELIVERY_CREATE_STO

    Hi Experts,
    Am Cretaing Delivery DOC for the STO (PO) as the reference document using the bapi BAPI_OUTB_DELIVERY_CREATE_STO.
    my problem is, the bapi is not picking the stogare location(LGORT)  from the STO doc storage location. Please help me to find way, if its possible to pass the storage location to Bapi or any Badi exists for the bapi  to pass the storage location based on some condition.
    Have found below BADI's for the BAPI in my initial investigation, but not sure to use which one, pls suggest
    LE_SHP_PRICING
    BADI_HU_MAIN
    BADI_HU_PACKING_ALWD
    BADI_HU_PACKING_QTY
    BADI_HU_SAVE
    BADI_HU_AUTOPACK
    DELIVERY_PUBLISH
    Pls find below code for reference.
    WA_STOCK_TRANS_ITEMS-REF_DOC    = STO no
    WA_STOCK_TRANS_ITEMS-REF_ITEM   = Item.
    WA_STOCK_TRANS_ITEMS-DLV_QTY    = quantity.
    WA_STOCK_TRANS_ITEMS-SALES_UNIT = 'EA'.
    APPEND WA_STOCK_TRANS_ITEMS TO STOCK_TRANS_ITEMS.
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CREATE_STO'
              IMPORTING
                DELIVERY          = DELIVERY
                NUM_DELIVERIES    = NUM_DELIVERIES
              TABLES
                STOCK_TRANS_ITEMS = STOCK_TRANS_ITEMS
                DELIVERIES        = DELIVERIES
                RETURN            = RETURN3.
    thanks in advance.

    Hi Venkat,
    If you check the Function Module Documentation, there is a note which mentions:
    Order (SALES_ORDER_ITEMS-REF_DOC)
    Unless specified otherwise, the entire order is delivered. This means that it is not necessary to list all the order items. It is sufficient to specify the order number.
    Please try this.
    Regards,
    Pranav.

  • Correct way to use an event handler

    The following is dynamically adds a series of buttons and a label to each button. The problem is that the event handler fires twice for each button, and the last button never gets processed at all.
    Should I be using a different event handler than ResizeEvent.RESIZE? How do I add the label to the last button in the sequence?
    Thank you.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
        <mx:Script>
      <![CDATA[
          import mx.events.ResizeEvent;
    private var button:Button2;
    public var numButtons:Number=5;
    private var counter:Number=0;
    public function init():void{
        for(var i:int=0; i<numButtons;i++){
            button=new Button2;
            hbox.addChild(button)
            button.addEventListener(ResizeEvent.RESIZE, handleButtonAdded)
    private function handleButtonAdded(e:ResizeEvent):void{
        counter++
        trace(e.target)
        e.target.label= String(counter);
        button.removeEventListener(ResizeEvent.RESIZE, handleButtonAdded)
      ]]>
    </mx:Script>
    <mx:HBox id="hbox"  horizontalGap="0"/>
    </mx:Application>
    Here's the button: Button2.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Button xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" >
    <mx:Script>
        <![CDATA[
        public function init():void{
            this.width=100;
        ]]>
    </mx:Script>
    </mx:Button>

    Hmm , what are you trying to do ?  There are a few questionable things happening.  Your event-handler is named "handleButtonAdded" but it takes a ResizeEvent ? Do you mean to trigger an event based on when the button was added to the stage , or parent such as FlexEvent.ADDED or when the creation is complete ,  FlexEvent.CREATION_COMPLETE ?
       The second thing is your "button" variable.  It is declared outside of the loop in the "init" function.  Meaning , when that loop is done and even during execution , it will point to the last button created.  So all the buttons have listeners , meaning when one button fires off a ResizeEvent , it will remove the listener for whatever your variable "button" is pointing to.  This guarantees (well , maybe not) the behaviour that your last button will NOT have a listener , therefore it will not fire.
      By the way , you can set the label and the size of the button when you declare them. You don't have to subclass and use listeners.

  • How to reporcess event message for an event handler

    Dear Experts
    In one of our cases, we defined a task in the rule set to activate event handler when reason for rejection removed for a slaes order. We used the activity EH_ACTIVATE.
    For some of the SO event handlers, this activity was not triggered (do not know why) and the EH is still in Inactive Status. There is an option to reporcess event messages but this is disabled in Production. May I know is there any program to activate the EH in this case?
    Thanks
    Ravi

    Ravi,
    I would rather you see why the activity is not being triggered. Try reporting the events in simulation mode and check the results... If it subsequently posts then I would activate full App log logging in SAP EM and see what's going on. It's not good to be intermittently missing activities. You need to get to the bottom of it and use the correct methods in the rule set to achieve this.
    Thanks
    Kevin

  • Event handler for disclosureopenicon in tree in flex 4

    hi all,
              Is it possible to write event handler to disclosureopenicon for tree control in flex?
    if its possible means, h w can i write?

    Hi Ananth,
    You can do this by firing a Navigation event for Opening and closing of these tree nodes.
    Cheers,
    Jeevan

  • Queue based UI Event Handler Pattern (CLD)

    Hi, everybody:
    I am trying to get a better understanding of the Queue based UI Event Handler pattern in CLD exam. So I made the attached small LabVIEW program in which 3 buttons(State 0, State 1, State 2) are the 'switches' of 3 LED lights (S0, S1, S2), respectively. After comparing with the Queue based UI Event Handler pattern in NI's slide, I got some questions at the following points:
    (1) There are six items(Initialize, Waiting for Event, State 0, State 1, State 2 and Stop) in the Enum constant in my program. To make this program use standard Queue based UI Event Handler pattern, should I only use 3 cases(Initialize, Waiting for Event, Stop) in the case structure and put 4 events(State 0, State 1, State 2 and Stop) under the case of 'Waiting for Event' ? Is what I coded a standard Queue based UI Event Handler pattern?
    (2) In the attached screenshot of Queue based UI Event Handler pattern in NI's slide, I found 'Start' is wired with 'Enqueue Element.vi'. Why is that? Should there be a 'Start' Case in the case structure?
    (3) In my program, I wired 'Waiting for Event' with 'Enqueue Element.vi' in all events except 'Stop' event. Should I wire 'State 0', 'State 1', 'State 2' with 'Enqueue Element.vi' in their corresponding events, just like my second question in NI's slide?
    BTW, I didn't find the exact Queue based UI Event Handler pattern in LabVIEW 2011, Should we code it by ourselves in the real CLD exam?
    Thanks a lot in advance!
    Chuan
    Attachments:
    Queue based UI Event Handler Practice.vi ‏18 KB
    NI Slide.png ‏177 KB

    Chuan wrote:
    Hi, everybody:
    I am trying to get a better understanding of the Queue based UI Event Handler pattern in CLD exam. So I made the attached small LabVIEW program in which 3 buttons(State 0, State 1, State 2) are the 'switches' of 3 LED lights (S0, S1, S2), respectively. After comparing with the Queue based UI Event Handler pattern in NI's slide, I got some questions at the following points:
    (1) There are six items(Initialize, Waiting for Event, State 0, State 1, State 2 and Stop) in the Enum constant in my program. To make this program use standard Queue based UI Event Handler pattern, should I only use 3 cases(Initialize, Waiting for Event, Stop) in the case structure and put 4 events(State 0, State 1, State 2 and Stop) under the case of 'Waiting for Event' ? Is what I coded a standard Queue based UI Event Handler pattern?
    What exactly are you trying to do with this program?  Just using it to show a basic pattern for review? 
    Seems like you are trying to use Queues, a Case Structure, and Events all in one loop.  Be careful not to try to be so advanced for this test.  I still can't seem to figure out what the question you are trying ask is, but reply and we'll see if we can figure out an answer.  You can put as many "states" in an Enum as you want but just not use them all during the program.  I use fillers sometimes "just in case" I need to use it.  Obviously, don't do this for a real program. 
    (2) In the attached screenshot of Queue based UI Event Handler pattern in NI's slide, I found 'Start' is wired with 'Enqueue Element.vi'. Why is that? Should there be a 'Start' Case in the case structure?
     Your code is your code.  This is just an example of the way that you could do it if you wanted to.  You need to read the requirements document to determine exactly the way to Initialize and Start and whatever else your program.  Typically, I've seen the following included in software using this structure:  Initialize, Start, Run, Stop, Update Settings, Exit...and so on.
    (3) In my program, I wired 'Waiting for Event' with 'Enqueue Element.vi' in all events except 'Stop' event. Should I wire 'State 0', 'State 1', 'State 2' with 'Enqueue Element.vi' in their corresponding events, just like my second question in NI's slide?
     Well, you never ended up using the Initialize case.  You need to Initialize outside the loop in your program.  Again, try to explain your design more.  It seems like what you have done is right, but I'm not sure what all you are trying to accomplish.
    BTW, I didn't find the exact Queue based UI Event Handler pattern in LabVIEW 2011, Should we code it by ourselves in the real CLD exam?
    All code on the CLD needs to be your own.  Templates are just there as a starter for people who are not familiar with them.  If you want to take the CLD, you should be at the point where you don't need the templates to do the work for you. 
    Thanks a lot in advance!
    Chuan
    See my responses above.  Best of luck.
    The pattern you have used in your program is *technically* fine, but in all the code I wrote for the CLD and in most of the examples I saw, everything was just a state machine with a enum driver.  Be careful trying to violate the norm on this as you will likely run into more problems than solutions.  You could also encapsulate your Queue into an FGV, which would modularize the code and look a little neater.
    Nathan - Certified LabVIEW Developer

  • OIM 11.1.1.5: Post Process Event Handler, change password notification

    Hi,
    Products
    OIM 11.1.1.5 BP02
    OAM 11.1.1.5
    OID 11.1.1.5
    Problem
    I have written a post-process event handler which fires when a role is assigned to a user. The event handler calls a plugin which uses the UserManager API to generate and change the user's password.
    I've tested this by assigning a role to the user via the OIM web console. I can see my log messages indicating that the event handler has fired and that the password has been changed.
    However, I expected that when UserManager.changePassword completed, a notification email would then be sent to the user informing them of the new password, but no notification email has been sent.
    The email notifications have been set up correctly, because I have changed the same user's password via the OIM web console and successfully received a Reset Password email.
    So, my questions are:
    1) Am I right in thinking that when you call UserManager.changePassword(), an out-of-the-box ResetPassword email notification should be sent to the user?
    2) Has anyone got this working in 11.1.1.5?
    Some more detailed info
    In my plugin class I'm calling the following from both execute methods (EventResult and BulkEventResult):
    char newpasswd[] = new RandomPasswordGeneratorImpl().generatePassword(user);
    getUserManager().changePassword(userKey, newpasswd, false, null, true);
    logger.info(("Successfully changed password"));
    plugin.xml
         <oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
         <plugin
         pluginclass="oracle.iam.PostInsertPlugin"
         version="1.0"
         name="PostInsertPlugin">
         </plugin>
         </plugins>
         </oimplugins>
    $OIM_HOME/server/bin/weblogic.properties
              wls_servername = oim_server1
              app = OIMMetadata
              metadata_from_loc=/home/oracle/eventhandlers
              metadata_file=/metadata/roleuser/custom/EventHandlers.xml
    /home/oracle/eventhandlers/import/metadata/roleuser/custom/EventHandlers.xml
    <?xml version='1.0' encoding='utf-8'?>
    <eventhandlers
    xmlns="http://www.oracle.com/schema/oim/platform/kernel"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
    <action-handler
    class="oracle.iam.PostInsertPlugin"
    entity-type="RoleUser"
    operation="CREATE"
    name="PostInsertPlugin"
    stage="postprocess"
    order="1002"
    sync="TRUE"/>
    </eventhandlers>
    There are no errors in the OIM out and diagnostic logs apart from the following which occur at OIM startup:
    [2013-01-07T16:29:23.425+00:00] [oim_server1] [ERROR] [IAM-0080075] [oracle.iam.platform.kernel.impl] [tid: [ACTIVE].ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: oiminternal] [ecid: 2e903d7ef060ab65:66b2de91:13c15d6d9ce:-8000-0000000000000002,0] [APP: oim#11.1.1.3.0] XML schema validation failed for XML /metadata/iam-features-OIMMigration/EventHandlers.xml and it will not be loaded by kernel.
    [2013-01-07T16:29:24.267+00:00] [oim_server1] [ERROR] [IAM-0080075] [oracle.iam.platform.kernel.impl] [tid: [ACTIVE].ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: oiminternal] [ecid: 2e903d7ef060ab65:66b2de91:13c15d6d9ce:-8000-0000000000000002,0] [APP: oim#11.1.1.3.0] XML schema validation failed for XML /metadata/iam-features-callbacks/event_configuration/EventHandlers.xml and it will not be loaded by kernel.
    Thanks
    dty
    Edited by: oim_user on Jan 7, 2013 5:37 PM

    No notification will be sent if you changepassword using the method from usermanager api.
    You have to trigger the resetpassword event manullay in your code.
    Here is a sample code to create an event for reset password. Once you create event, invoke it from notification service - notify method.
    NotificationEvent event = new NotificationEvent();
    String[] receiverUserIds= {userLogin};
    event.setUserIds(receiverUserIds);
    event.setTemplateName("ResetPasswordNotification");
    event.setSender(null);
    HashMap<String, Object> resolvedData = new HashMap<String, Object>();
    resolvedData.put("userLoginId", userLogin);
    event.setParams(resolvedData);

  • WPF UI running in seperate runspace - able to set/get controls via synchronized hash table, but referencing the control via the hash table from within an event handler causes both runspaces to hang.

    I am trying to build a proof of concept where a WPF form is hosted in a seperate runspace and updates are handled from the primary shell/runspace. I have had some success thanks to a great article by Boe Prox, but I am having an issue I wanted to open up
    to see if anyone had a suggestion.
    My goals are as follows:
    1.) Set control properties from the primary runspace (Completed)
    2.) Get control properties from the primary runspace (Completed)
    3.) Respond to WPF form events in the UI runspace from the primary runspace (Kind of broken).
    I have the ability to read/write values to the form, but I am having difficulty with events. Specifically, I can fire and handle events, but the minute I try to reference the $SyncHash from within the event it appears to cause a blocking condition hanging both
    runspaces. As a result, I am unable to update the form based on an event being fired by a control.
    In the example below, the form is loaded and the following steps occur:
    1.) Update-Combobox is called and it populates the combobox with a list of service names and selects the first item.
    2.) update-textbox is called and sets the Text property of the textbox.
    3.) The Text value of the textbox is read by the function read-textbox and output using write-host.
    4.) An event handle is registered for the SelectionChanged event for the combobox to call the update-textbox function used earlier.
    5.) If you change the selection on the combobox, the shell and UI hangs as soon as $SyncHash is referenced. I suspect this is causing some sort of blocking condition from multiple threads trying to access the synchronized nature of the hash table, but I am
    unsure as to why / how to work around it. If you comment out the line "$SyncHash.TXT_Output.Dispatcher.Invoke("Send",[action]{$SyncHash.TXT_Output.Text = $Value})" within update-textbox the event handler will execute/complete.
    $UI_JobScript =
    try{
    Function New-Form ([XML]$XAML_Form){
    $XML_Node_Reader=(New-Object System.Xml.XmlNodeReader $XAML_Form)
    [Windows.Markup.XamlReader]::Load($XML_Node_Reader)
    try{
    Add-Type –AssemblyName PresentationFramework
    Add-Type –AssemblyName PresentationCore
    Add-Type –AssemblyName WindowsBase
    catch{
    Throw "Unable to load the requisite Windows Presentation Foundation assemblies. Please verify that the .NET Framework 3.5 Service Pack 1 or later is installed on this system."
    $Form = New-Form -XAML_Form $SyncHash.XAML_Form
    $SyncHash.Form = $Form
    $SyncHash.CMB_Services = $SyncHash.Form.FindName("CMB_Services")
    $SyncHash.TXT_Output = $SyncHash.Form.FindName("TXT_Output")
    $SyncHash.Form.ShowDialog() | Out-Null
    $SyncHash.Error = $Error
    catch{
    write-host $_.Exception.Message
    #End UI_JobScript
    #Begin Main
    add-type -AssemblyName WindowsBase
    [XML]$XAML_Form = @"
    <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Window.Resources>
    <DataTemplate x:Key="DTMPL_Name">
    <TextBlock Text="{Binding Path=Name}" />
    </DataTemplate>
    </Window.Resources>
    <DockPanel LastChildFill="True">
    <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
    <Label Name="LBL_Services" Content="Services:" />
    <ComboBox Name="CMB_Services" ItemTemplate="{StaticResource DTMPL_Name}"/>
    </StackPanel>
    <TextBox Name="TXT_Output"/>
    </DockPanel>
    </Window>
    $SyncHash = [hashtable]::Synchronized(@{})
    $SyncHash.Add("XAML_Form",$XAML_Form)
    $SyncHash.Add("InitialScript", $InitialScript)
    $Normal = [System.Windows.Threading.DispatcherPriority]::Normal
    $UI_Runspace =[RunspaceFactory]::CreateRunspace()
    $UI_Runspace.ApartmentState = [System.Threading.ApartmentState]::STA
    $UI_Runspace.ThreadOptions = [System.Management.Automation.Runspaces.PSThreadOptions]::ReuseThread
    $UI_Runspace.Open()
    $UI_Runspace.SessionStateProxy.SetVariable("SyncHash",$SyncHash)
    $UI_Pipeline = [PowerShell]::Create()
    $UI_Pipeline.Runspace=$UI_Runspace
    $UI_Pipeline.AddScript($UI_JobScript) | out-Null
    $Job = $UI_Pipeline.BeginInvoke()
    $SyncHash.ServiceList = get-service | select name, status | Sort-Object -Property Name
    Function Update-Combobox{
    write-host "`nBegin Update-Combobox [$(get-date)]"
    $SyncHash.CMB_Services.Dispatcher.Invoke($Normal,[action]{$SyncHash.CMB_Services.ItemsSource = $SyncHash.ServiceList})
    $SyncHash.CMB_Services.Dispatcher.Invoke($Normal,[action]{$SyncHash.CMB_Services.SelectedIndex = 0})
    write-host "`End Update-Combobox [$(get-date)]"
    Function Update-Textbox([string]$Value){
    write-host "`nBegin Update-Textbox [$(get-date)]"
    $SyncHash.TXT_Output.Dispatcher.Invoke("Send",[action]{$SyncHash.TXT_Output.Text = $Value})
    write-host "End Update-Textbox [$(get-date)]"
    Function Read-Textbox(){
    write-host "`nBegin Read-Textbox [$(get-date)]"
    $SyncHash.TXT_Output.Dispatcher.Invoke($Normal,[action]{$Global:Return = $SyncHash.TXT_Output.Text})
    $Global:Return
    remove-variable -Name Return -scope Global
    write-host "End Read-Textbox [$(get-date)]"
    #Give the form some time to load in the other runspace
    $MaxWaitCycles = 5
    while (($SyncHash.Form.IsInitialized -eq $Null)-and ($MaxWaitCycles -gt 0)){
    Start-Sleep -Milliseconds 200
    $MaxWaitCycles--
    Update-ComboBox
    Update-Textbox -Value $("Initial Load: $(get-date)")
    Write-Host "Value Read From Textbox: $(Read-TextBox)"
    Register-ObjectEvent -InputObject $SyncHash.CMB_Services -EventName SelectionChanged -SourceIdentifier "CMB_Services.SelectionChanged" -action {Update-Textbox -Value $("From Selection Changed Event: $(get-date)")}

    Thanks again for the responses. This may not be possible, but I thought I would throw it out there. I appreciate your help in looking into this.
    To clarify the "Respond to control events in the main runspace"... I'm would like to have an event generated by a form object in the UI runspace (ex: combo box selectionchanged event) trigger a delegate within the main runspace and have that delegate in
    the main runspace update the form in the UI runspace.
    ex:
    1.) User changes selection on combo box generating form event
    2.) Event calls delegate (which I have gotten to work)
    3.) Delegate does some basic processing (works)
    4.) Delegate attempts to update form in UI runspace (hangs)
    As to the delegates / which runspace they are running in. I see the $synchash variable if I run get-var within a delegate, but I do not see the $Form variable so I am assuming that they are in the main runspace. Do you agree with that assumption?

  • Event handler eats up memory. Bad programing and/or bug.

    Hello
    I've been programming a GUI for a project. The basics of the program is a sample routine that updates a array once a second. Once the array is updated I use a event handler to plot the new array in a graph.
    When I wrote this gui I think I've stumbled upon a bug in Labviews memory allocation.
    If you have two loops. One that builds a array and then signals a loop with a eventhandler that reads the array and the event handler is stoped for a few seconds (by opening a sub vi or something inside the event handler), the memory goes berserk. When the event handler is free after the stop the memory is still allocated and does not return.
    I could not find any information on this problem in the forum so I thought I would share this information with everyone. I managed to reproduce this phenomena in a small example (attached), if anyone is interested in it. The problem is simple to fix once you recognize the problem. However it was not the simplest problem to find (imho that is ).
    Regards
    Andreas Beckman
    Attachments:
    bug.zip ‏23 KB

    Where are you seeing the memory being allocated? What tool are you using, task manager or LabVIEW profiling? I'm not seeing what you describe (LV 7.1.1 on a 3.4 GHz Pentium 4 w/ 1 Gb memory)
    Thanks,
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Passing parameters to an event handler

    I am successfully using event handlers to respond to user
    inputs(mouse click, enter key, etc.)
    The handler can also use the event objects parameters to
    perform operations based on who called the function. An example of
    this is the target._name, which is apparently passed when the event
    occurs.
    In addition, I have a need to call an event handler from
    within AS to essentially mimic a mouse click or keyboard entry.
    This call from AS is no problem. Just use the event handler
    name. For instance, mc.click(); and the handler is invoked.
    However, with the AS call there is no object passed to the
    handler. This differs from an event-driven call where an object
    identifying the event source is passed to the handler.
    The question is: Can you pass a parameter(s) or object to an
    event handler from a call in ActionScript? I have tried various
    ways, but nothing has worked.
    Does anyone know the insides of event handling and how the
    "eventObject" is passed when
    a user event occurs? Knowing how that works might give some
    clues as to how to pass an object from an AS call.

    You would need to use a modified version of the
    mx.utils.Delegate package. The link below has just that;
    http://www.person13.com/articles/proxy/Proxy.htm

  • Launch Services event handler

    Hi All,
    I'm currently trying to develop an application that uses a custom URL very similar to iTunes and itms URL. I've read the documentation on Launch Services and edited by Info.plist as described in the documentation.
    All seem to work to an extent. When my application is launched then I click my custom URL example in a text file, the event handler in my applicaton for my custom URL gets called. However when I just click the URL in the text file without first launching my application, my application is launched but the event handler is never called.
    Using a set of NSLogs, I notice that the object that should handle the event never gets instantiated where in its -(id)init method I call
    [manager setEventHandler:self andSelector:@selector(handleOpenLocationAppleEvent:withReplyEvent:) forEventClass: 'GURL' andEventID:'GURL'];
    I must be missing something very basic here but can't seem to figure it out as to why my object is not instantiated and the selector not called for the event.
    Any tips or pointers would be appreciated.
    Thanks,
    rmb
    PowerBook G4 FW800   Mac OS X (10.4.4)  

    Not sure what exactly you are looking but the given below link can help you
    http://help.sap.com/saphelp_scm41/helpdata/en/67/b41e3e3986f701e10000000a114084/frameset.htm

  • Save Event Handler?

    Hey scripters!  I mostly develop plugins with the C++ sdk, so forgive my ignorance.  I was just wondering if it is at all possible (in a script) to make event handler that "listens" for a save event?

    I'm not sure how it works using Patch Panels, but if you want to register an event in a Flex panel using the Photoshop Panel SDK ( CSXSLib ) you register the event in the panel
    CSXSInterface.instance.evalScript("PhotoshopRegisterEvent", charToInteger("save").toString());
    ExternalInterface.addCallback("PhotoshopCallback", PhotoshopCallback);
    The 'Per Layer Metadata' sample in the SDK has more info

  • Howto deregister an event handler

    Hi all!
    Is there a way to deregister an event handler?! The documentation says so, but I cannot find the appropriate command.
    The thing is, that the event handler can change for a subsequent call of my function module. So I'd like to set the event handler each time the function module is called, though the control itself isn't changed.
    Thx!

    Hi,
    You can use the ACTIVATION addition to deregister handler methods or register them dynamically..
    Addition
    ... ACTIVATION f
    Effect
    The optional ACTIVATION addition allows you to undo existing registrations or register new handlers dynamically using a variable. The argument f in the addition must be a field with type C and length 1. If f contains the value SPACE, the event handler method is deregistered. If f contains the value X, the event handler is registered. You do not need the ACTIVATION addition for static registrations.
    Note
    If an instance triggers an event, the registration is implicitly deleted if the triggering instance is deleted by the automatic memory management (garbage collection).
    The addition ACTIVATION SPACE only allows you to delete those registrations set using ACTIVATION 'X'. A single registration cannot be deleted by means of a mass deregistration using FOR ALL INSTANCES ACTIVATION SPACE. Vice versa, individual triggering instances cannot be excluded from registration after a mass registration. The internal handler tables for single and mass registrations are completely independent of each other.
    Example
    CLASS C1 DEFINITION.
      PUBLIC SECTION.
        EVENTS E.
    ENDCLASS.
    CLASS C2 DEFINITION.
      PUBLIC SECTION.
        METHODS M2 FOR EVENT E OF C1.
    ENDCLASS.
    DATA: S         TYPE REF TO C1,
          H         TYPE REF TO C2,
          ACTIVE(1) TYPE C VALUE 'X'.
    CREATE OBJECT: S, H.
    SET HANDLER H->M2 FOR S.
    SET HANDLER H->M2 FOR S ACTIVATION SPACE.
    SET HANDLER H->M2 FOR S ACTIVATION ACTIVE.
    CLASS C2 IMPLEMENTATION.
      METHOD M2.
      ENDMETHOD.
    ENDCLASS.
    In this example, the method H->M2 is deregistered and then set dynamically.
    Note for all variants:
    Note
    When you register instance methods as event handlers, note that the registration refers to the current instance and not to the reference variable that is used for registration. Even when the reference variable takes another value after SET HANDLER, the registration of the object remains unchanged. This also affects to the lifetime of objects - an object exists for as long as it is registered as an event handler, even if no more reference variables point to it. The object is either explicitly deregistered using the ACTIVATION addition, or implicitly when the triggering instance no longer exists.
    Regards,
    Tanveer.
    Please mark helpful answers.
    Message was edited by: Tanveer Shaikh

Maybe you are looking for

  • How do I set up different hardware controls for different patches in mainstage?

    I'm using Mainstage 3.0.4 and a Novation Impulse. I created a concert, with the drawbar organ as my first and most important patch. I assigned the hardware controls on the Novation exactly how I wanted them, with the sliders controlling the drawbars,

  • How can i get the intValue of a Object?

    Now, I can't believe the result and I don't know why?Somebody help me! My codes: Object aobj[] = (Object[])vector.elementAt(i); System.out.println("Mxxh1: " + aobj[j] ); int k = ((Integer)aobj[j]).intValue(); System.out.println("Mxxh2: " + k ); I can

  • RSEOUT00 - Idoc not getting processed

    Hi All, I have few idocs in prod.system with status 30 and they are not getting processed using RSEOUT00. I tried using back ground job / forgrond / BD87 also but they are not getting converted to 03 status. receiver port is xmlgen. Any thing like id

  • RuntimeStyle is not working in firefox

    Hi all, I have an application wherein i am setting the background color in javascript as obj.style.backgroundColor = obj.runtimeStyle.backgroundColor; but this is not working with firefox. can any one help me?

  • SAP Forms : table cut short when too many entries

    Hi all, I have an issue with tables in sap forms. Normally the sap form printout is 1 page, but when many entries exist in a table, the table-list is cut short when the page ends. ie. it does not continue on a 2nd page. What is missing here? thanks f