Add event cases to an event structure using scripting

Hello,
Iam trying to (using scripting) update an event structure (add event cases) on a vi that is not on memory.
i get error 1054 The specified object was not found.
here is a picture of it.
any help in this will be greatly apreaciated.
Solved!
Go to Solution.

Another suggestion, the following VI is a wrapper for Traverse for GObjects VI and allows you to specify the name of the object you want. I always use this VI, I never use the Open VI Object Reference function, for the reasons tst mentioned:
vi.lib\Utility\traverseref.llb\TRef Find Object By Label.vi
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman

Similar Messages

  • Lock front panel until the event case for this event completes

    A Dynamic Event is a filtered event? Is this why "Lock front panel until the event case for this event completes" is not shown on Edit Event window dialog? I use Dynamic Event so I can subvi the event structure.
    I need stop my app from locking the FP whenever the user double clicks on the numerical array value (<-- the FP freezes the mouse and renders it useless) and stops the value from ever being changed. This event is registered for Value Change (not mouse up or down) and I get a locked mouse. As yet in the UI, no value changed occurs but I get a locked mouse. A LV bug?
    Trying to KISS, I can see this fixing this by moving ONLY the value change event to the top level VI instead of a dynamic registered event in a subVI. This will give me the option to NOT "Lock front panel until the event case for this event completes" .
    Solved!
    Go to Solution.

    richjoh wrote:
    Thx, Ben that fixed the problem when I unchecked "Lock panel...".
    So it appears LV locks the panel during runtime once the Dynamic Reg Events is on BD and it doesn't matter if your case to handle the Reg Events is created or NOT... interesting. That's why my mouse persisted to "freeze up" although I deleted the case for my FP array.
    Its situation like what you described that has given me many insights into how LV actually works. In one of my bbuggy VI's I found that a class wire can run a million miles through multiple sub-VI queues etc but the data itself is only touched when it has to be touched. in my case it was a crash while trying to write bogus class dat to a TDMS file.
    I am glad you are back on course.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Event case missing mouse events on active-x component

    I am using a Treeview and capturing selections in the tree using mouse events (event structure). I have a problem where approx 3 out of 15 mouse events are not actioned by the event structure - has anyone else had this problem or is there any suggestions?
    Thanks.

    Could you post a copy of your code that demonstates this?
    I have experimented with this control and its events.
    We may be able to help if we have soething to look at.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to add a textline to an xml structure using xslt

    Hi,
    I am having a requirement where i need to add a textline to an xml.
    scenario: IDOC-File  and output format is an xml.
    Output should be like this:
    &&##AOC0MB000#AD15543390#BOIFCO#Z
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <messages>
         <batch>0800062844</batch>
         <message>
              <type>VPR</type>
              <action>A</action>
              </body>
         </message>
    </messages>
    The line that has been added to xml is the data that will be coming from IDOC. How can we append the textline to the xml using xslt.Will document() in xslt works for doing this?

    The required format in ur scenario is not an xml format, so u should not save the file in xml format. U may write an adapter module at receiver to achieve this.
    How can we append the textline to the xml using xslt
    This is not possible as the output of xsl transformation is an xml file.
    Regards,
    Prateek

  • Suggested Feature: Add event case number data node

    The Source data node in an event structure is too vague to be of much practical use.  (Values are LabVIEW UI, ActiveX, User Event, and <Other>...)  A data node containing the event case number would be very useful to the developer wishing to merge the event case number into error messages.  I hope this feature can be incorporated into a future version of LabVIEW.
    Thanks!
    Larry Stanos

    You can make product suggestions at http://digital.ni.com/applications/psc.nsf/default?OpenForm&temp1=&node=
    I'm not sure an Event Case number even exists and I think the name of the event and the event type would provide more usefule information. That can easily be done with something like the attachment.
    Message Edited by Dennis Knutson on 04-07-2006 08:24 AM
    Attachments:
    name and event type.JPG ‏18 KB

  • How can I reduce the number of event cases in the main VI?

    I would like to reduce the number of event case of the event structure in my main VI. E.g. I would like to have pop up window with a table when the user double click a table row. Nothing more simple than this: add a case to the event structure trigger by double clicking the table, read the table row ... But in my main VI I would have lots of them and the event structure gets crowded with minor tasks. One solution is using XControls. But is there any other recomended way to handle selected events separatly from the event structure in the main VI?
    to clarify: I don't want to distribute the whole event structure. (In this case the code would not be maintainable) But I would like to handle certain context specific events in a differnt place. If I have them all in the main VI the drop down list of the events in the event structure exceeds the windows size and the program becomes difficult to maintain because one looses the overview.

    "Strictly forbidden" is not true. But highly not recommended. The reason is simple:
    1. Code can react unpredictable. Dennis already stated some things about that in your linked thread. 
    2. Code is not readable and therefore not maintainable. Each event source should have only one event structure for its events. Since the UI is a single source, events from there should be captured in a single event structure. It is recommended to use this event structure as producer in a producer/consumer design pattern in order not to block the events.
    3. You will most propably need timeouts in your event structure which completly negates the advantage of event driven programming. Either use event driven programming or stay at polling. Do not mix (most of all because of maintenance).
    Regarding your "advantages" you listed:
    - Clustering  reduces readability in therefore should never be done. Additionally, it requires timeout cases in most places which is not recommended.
    - If you have such many events and interactions in your "sequence", it is a clear indication that you chose the wrong architecture for your application.
    Please see attached example. Since i am not used to program with more than one event structure (except if i have different dedicated event sources), the example is "constructed" and therefore may lack of "realism". Nevertheless, it shows some issues which might occur:
    - Blocking calls within the events lead to the fact that the UI is not responsive for the event time (FuncA). Nevertheless, interaction is still enqueued and if the blocking call is over, all those interaction are executed. In the example, please press FuncA and then press FuncC immediatly. You will see that nothing happens and after the 5s blocking call, the FuncC dialog appears. You also can switch tabs, but the visual display will update only after the 5s blocking call.
    - In order to keep the UI responsive, FuncB is configured not to block the UI. But this is no solution: Press FuncB (on page 2) and the change to page 1 and press FuncA. Additionally, press FuncC. What happens? Just to mess things up, press Stop as well......do this combination several times. It is possible that only the lower loop is finished and the VI is still running even if Stop has been pressed.
    Please note everyone that the attached example shoudl strictly be seen as "NEVER DO IT LIKE THIS". This is a negative example and shows the approach which is not recommended by any means!
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.
    Attachments:
    Never EVER86.vi ‏10 KB

  • Save as previous version causes events to disappear in event structure

    I am using 2009 and I am trying to save a VI as previous version...saved it in 8.6, 8.5,8.2 and 8.0.
    I mass compiled the Main VI in 8.6 and tried to open it.  I get about 30 errors one for each event case and the event structure has no events added. 
     "Event Data Node:Contains unwired or bad terminal"
    I am attaching a zip file containing my 8.6 source code which I down converted from LabVIEW 2009.  I am trying to open it in 8.6
    Is this a bug or am I doing something wrong?
    Brian
    Attachments:
    8.6.zip ‏556 KB

    Hey Brian,
    This was reported to R&D (# 194525) for further investigation. A possible workaround for this issue is to save the VI to LabVIEW 8.6 and then save it to the various versions you wish to save the VI to. Also, another workaround is to manually re-enter the event specifiers to your cases.
    When I saved the VI from LabVIEW 2009 to 8.2, the only thing that seemed to be out of place was the event specifiers. You can re-configure these by right-clicking on the event structure and selecting "Edit Events Handled by This Case...". Also, when I first saved the VI to LabVIEW 8.6 and then to LabVIEW 8.2, everything seemed to be in order.
    Thanks for your feedback. Let me know if I can clarify any of my proposed workarounds.
    Hope this helps.
    -Ben
    WaterlooLabs

  • How can I use the same event case for different controls dynamically

    OS: Linux 2.6.24-1-686 #1 SMP Sat Apr 19 00:37:55 UTC 2008 i686 GNU/Linux
    LabVIEW: Version 8.2
    I have a lot of (about 50) controls (numeric, boolean) on my front panel. If a "Value Change" event will be fired by any of them the same event case shall be executed. As I do not want to add all 50 controls to the same event case manually I am looking for a way to do it at run time. Additionally the VI is still under contruction, i.e. controls will be added and removed.
    Thanks for any help here.
    Regards,
    Johannes
    Solved!
    Go to Solution.

    Hi Johannes,
    collect all your control references (you can use the FP property for it) and create a user event. Connect this user event to your event structure. Now you have one event case for all your controls. See the attached picture.
    Mike
    Attachments:
    Unbenannt1.PNG ‏11 KB

  • Can I have multiple event structures with the same event cases?

    Hello, 
    I'm doing an application that reproduces the front panel of the HP6675A power supply. To achieve this, I have done a state machine with different states
    (initialize, measures, voltage, current, ocp, ov, store, recall, etc). In each state, should have an event structure that catches the events of the buttons, like for example: if the current state is the Voltage mode and the user press the current button the next state will be the Current mode. For this in each state of the state machine should be the same event structure with the same events.
    My problem is that the Vi doesn't work properly when I have multiple event structures with the same event cases. There are some possibily to do this, and how? Or is impossible to have multiple events? I have been reading some posts, but I don't find solutions. 
    Any help is appreciated.
    Thank you very much.
    Solved!
    Go to Solution.

    natasftw wrote:
    Or as others mentioned, make two parallel loops.  In one loop, have your state machine.  In the other, have just the Event Handler.  Pass the events from the handler to the state machine by way of queues.
    A proper state machine will not need the second loop.  The "Wait For Event" or "Idle" state (whatever you want to call it) is all you really need in order to catch the user button presses.  The setup is almost there.  Maybe add a shift register to keep track of which state to go to in the case of a timeout on the Event Structure.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to use only one event case at a time??

    Using LabVIEW, using the event structure is it possible to have only one event case execute at a time. For example, having event case controlled by keyboard, and the other event case controlled by mouse (clicking buttons) and only one being able to execute, not simultaneously. I was considering using a switch of some sort, but each case does not have a "stop if true/false" so I am open to a new method or work around. I attached code. I do not want output to be able to be sent from the keyboard case and mouse case at the same time.
    Thanks,
    Andrew
    Attachments:
    WiFi Motor Control & Cam Stripped.vi ‏29 KB

    Ah, OK. all you need is to keep state in a shift register that ensures that all "key down/mouse down" events are discarded after each key down/mounse down event until a key up or mouse up (resp.) has occured.
    Overall, you code is still way to complicated for this simple task. For example, you could eliminate all these "select" primitives and place the approriate diagram constant inside the respective case. On the other hand it is too simplistic, because you would think that certain key combinations should be allowed concurrently (e.g. up and left).
    What does the receiver actually do with the codes? Do you have any documentation for this device?
    LabVIEW Champion . Do more with less code and in less time .

  • Case order of EVENT structure

    LV 8.2.1 - Regarding the order of cases in an EVENT structure:
    1... Is there any performance (speed) advantage to having the most-commonly used events near the top of the list?  Does it have to search through a list to find which case to execute, or does it happen some other way?  If it searches thru a list, then I want to have the high-frequency events near the top of the list, and the rarer ones nearer the bottom.
    2... If #1 is "no advantage" then what is the point of the REARRANGE CASES dialog?  Why would I want to rearrange them?  Maybe just to collect them into groups of similar function - is that all?
    3... When you SORT CASES in the REARRANGE CASES dialog, what order does it put them in?  The help window says "alphabetical" , but that's plainly not true, because my list includes "Stop" and "Clear", and it orders "Stop" before "Clear" after a sort.  It doesn't put the user events together.  A simple test shows that SORT puts them back in the order you added the cases to the structure.  Is there a point to that?
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

    is it possible you have some invisible chars (like a leading space) or that one of the words starts with an uppercase letter and the other with a lowercase one?
    Nope.  Try it yourself with the Wed, Thur, Friday trick.
    The EVENT structure cares about what order you created the cases in.
    The CASE structure cares about the order of whatever drives the selector.
    Alphabetic order seems to have nothing to do with it. 
    From your reference thread:
    However, this does tell you that if you want to squeeze every ounce of performance out of your event-handling code, make sure the most frequently run event-handling diagram is the first one in the list.
    This from a LabVIEW R&D engineer.
    Hmmm. 
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Can you use event case with labview real time?

    I have a real time application I am putting together and until recentally have concentrated on getting the data acquisition working as expected.
    I am using a PXI-8183 in a 1031 chassis.
    I am now trying to add the functionality for setting up the system in the form of a GUI remote front panel that I connect to with a host laptop.  I am connecting with the host as expected and it seems to be working well in that respect.
    My problem is with event cases, operating in a while loop on the target.  They just dont seem to want to trigger when i click on a button I have set an event for.
    I have looked through the documentation and cant see any reference to issues with event cases on rt, but I feel I am missing something fundamental.  Can anyone help?
    Regards,
    Barry

    look here maybe:
    http://digital.ni.com/public.nsf/allkb/42B70D2D0C4B568586256E2F0051441D
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome

  • Event Handling for tree structure using "CL_GUI_ALV_TREE_SIMPLE"

    Hi,
    I have created a tree structure using class CL_GUI_ALV_TREE_SIMPLE.
    Now I wanted to insert a check and give message when the user opens the last node in my structure.
    I checked the events available in the class , but there in none which gets trigered when we try to open a node.
    Please guide me with this scenario.
    Thanks & Regards,
    Omkar M.

    Hello Omkar
    The solution is somewhat odd but apparently works. As sample report please check BCALV_TREE_SIMPLE_DEMO.
    Copy this report and make the following changes:
    class lcl_tree_event_receiver definition.
      public section.
        methods:
        on_expand_no_children " new event handler method
          for event expand_no_children of cl_gui_column_tree
            importing NODE_KEY,  " class = CL_GUI_COLUMN_TREE !!!
        on_add_hierarchy_node
                  for event on_add_hierarchy_node of cl_gui_alv_tree_simple
                        importing grouplevel
                                  index_outtab.
    endclass.
    CLASS lcl_tree_event_receiver IMPLEMENTATION.
      METHOD on_expand_no_children.
        BREAK-POINT.
      ENDMETHOD.                    "on_expand_no_children
    FORM register_events.
    * define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    * define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
      CALL METHOD tree1->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
    * set Handler
      DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
      CREATE OBJECT l_event_receiver.
      SET HANDLER l_event_receiver->on_add_hierarchy_node
                                                            FOR tree1.  " CL_GUI_ALV_TREE_SIMPLE
      SET HANDLER l_event_receiver->on_expand_no_children
                                              FOR ALL INSTANCES. " CL_GUI_COLUMN_TREE !!!
    ENDFORM.                               " register_events
    As soon as you open a node in the ALV tree the report will stop at the break-point.
    Now you need to check if there are still children nodes to be displayed.
    If not then trigger your special coding.
    Regards
      Uwe

  • State machine with using event case

    Hallo everyone,
    i have a question about how to realize the "Timeout". In the flow diagram below we can see 2 different situation:
    1. in the 1st Situation i have used the state machine, it begins at state 1, which contains a event case. In there it will be at first determined, if the input value has changed within 10 second,  if it didn't, the state machine will go to state 2, if it 's  changed, will be furthermore determined, whether the input value equal to 3, if yes, the state mashine will jump to state 3, if no, jump back to state 1. (this VI i have done before, you can take a look at the Attachment).
    2. my question is in the 2nd situation. It begins also at state 1. In there the input value can also be changed (once or many times) or not. If the value has not been changed within 10 s, or even though it's been changed many times within 10s, but  it's never been equal to 3, the state machine will go to state 2; only when the input value within 10s equal to 3, it can jump to state 3.
    This problem i have no idea how to solve, does anybody have  idea or better methods?
    thanks a lot!!
    Solved!
    Go to Solution.
    Attachments:
    situation 1.vi ‏12 KB

    The statement in the OP is not covering all cases.
    mexaviesta wrote:
    2. my question is in the 2nd situation. It begins also at state 1. In there the input value can also be changed (once or many times) or not. If the value has not been changed within 10 s, or even though it's been changed many times within 10s, but  it's never been equal to 3, the state machine will go to state 2; only when the input value within 10s equal to 3, it can jump to state 3.
    This problem i have no idea how to solve, does anybody have  idea or better methods?
    thanks a lot!!
    Just check my implementation for Situation 2 and let us know, if it works for you.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.
    Attachments:
    Situation 2.llb ‏40 KB

  • Continous increasing using a event case

    Hello,
    I'm making a game space invaders in labview, but i've a problem with it. I have make my shooter already, I can move(step by step) and shoot with it ...
    But my problem is,  I wan't to move continously. When I press the right key, it should keep on going ... now it stops after one step ...
    How can I do this ??

    Use the "Key Repeat" event to detect this.  Or, run a seperate loop that watches key buttons and sends the values over User Events.  Then, register the User Events and hook up the refnum to the dynamic terminal on the event case.  From there, you can watch those values.
    7J1L1M

Maybe you are looking for

  • Adobe Encoder flashing problems

    Adobe Encoder takes wmv and has Flashes in it between fading pictures.  when I try to convert it to a F4V or H.264 format.  How can a get rid of these post fade flashbacks (to previous pictures) Thanks

  • Master role-derive role concept and FICO role in dev system!!!

    Hi all, I have created a master role with t-codes AWUW BAPI BD10 BD100 BD101 BD102 BD103 BD104 BD105 BD11 BD12 BD13 BD14 BD15 also included object PLOG where maintained org data and created a derived role from that master role and generated from the

  • Calendar appointments color change since 4.1

    Anyone experiencing a change in the color presentation of calendar appointments since 4.1 and iTunes 10? I am syncing with Outlook 2003 on XP. The calendar appointments are now different colors as compared to prior to the upgrade, but the annoying th

  • How do I open my disk drive?   Help

    How do I open my disk drive?

  • DB Control: Listener Monitoring

    Hi We are using RAC database and ASM. ASM home and DB Home are seperate. The listener is running from the ASM Home and listening for both ASM and DB Instances. But the EM (db control) is trying monitor the listener on DB Home and it alway finds it do