Handling LabView events in ActiveX

Hi all,
I know most ActiveX discussion here is about getting ActiveX to work inside of LabView, but I'm trying to go the other way around.
General Question:
How to I catch or listen to events generated by LabView (in VB or whatever)? And is there some kind of library of LabView ActiveX events?
More specific:
If anyone has ever used the Jacob libraries for using ActiveX from Java, how would I create a LabView event listener from within Java? I can create a VI ActiveXComponent, but I don't know how to use it to listen to events.
Any help on either part of the question will be most appreciated!
Thanks,
Sam

"SamF" <[email protected]> wrote in message news:[email protected]..
Thanks for both of your replies, I'm pretty certain that it is possible to generate ActiveX events from LabView, but unfortunately those links don't deal with events. Those are what I used to get to where I am -- opening and running a VI from ActiveX -- but I can't find anything on generating events.If it really seems as though there is no way for LabView to generate ActiveX events (or just catch those that are automatically generated), then I have another question: Is it possible to use LabView to catch its events internally (using it's own events methods), and write to, say, an excel file everytime an event is generated?My thinking is that even if LabView doesn't throw events, other programs such as Excel do, and so if the events were routed through Excel I could catch *those* events.(BTW, I know there are examples of writing to Excel, but I'm looking for something that is *event* driven).Any help either on catching LabView events or using LabView events to write to an MS program will be much appreciated, as always!Thanks,Sam
Sure it's possible to build an activex server. No doubt about that.
If I where to communicate events between the LabVIEW code and another language, I'd think about occurrences or windows events.
There is documentation available about occurrence communication between dll's, cin's and LabVIEW. Never used it, so I can't help you much further.
The windows events are well documented in the msdn. They should be available in any language, though relatively simple api calls.
And you can always use window messages. If you have a window handler of the main program available in LabVIEW, you can use sendmessage or postmessage to communicate to it. The other way around is more difficult, but seems not necessary.
Hope it helps,
Wiebe.

Similar Messages

  • Generating LabVIEW events via ActiveX

    I have a Labview 2010 Vi compiled to an EXE with ActiveX server enabled.
    The VI has a single control that is a latched boolean control that is used in an Event Handler.
    When I toggle this control, remotely, via an ActiveX client, the control changes state, but does not generate an event. (non-signaled).
    I can understand this behavior if the control was not a latched control, but I would have thought that the latched control would automatically generate an event, since it doesn't make a distinction between "value" and "value (signaled)".
    Other than monitoring/polling the control status and when it changes using a Value (Signal) local variable, is there a way to generate an Event, in a LabVIEW EXE, via ActiveX?  Or is there another, more appropriate way to accomplish this.  I'm trying to remotely run an program from another program through an activeX interface.   I suppose if every control had a unique message and I had a message handler loop, then I could just use the ActiveX control to insert the appropriate message into the Queue, but this is an existing application and would take a fair effort to set that up.

    What if you tried dynamically registering the event? You could create a reference to the boolean and use the Register for Events VI. Then, wire this event into the dynamic event terminal of the event structure (right click the border and say "Show Dynamic Event Terminals").  I don't have an ActiveX program to call into LabVIEW with, so I'm not sure if this will be any different than what you're doing now, but it's something easy to try.  Perhaps you could post you ActiveX code and LabVIEW code or a modified version of both illustrating what you're mentioning?

  • Best way to handle an event from WaitForSingleObject

    Hello LV experts,
    I would like to know what's the best way to handle an event which I catch using the Win32 API (WaitForSingleObject) in Labview(7.1 or 8.20).
    I know there is too many possibilities to do this, but I want to do it  on the best way. that is why I would like to have ideas and tips from you.
    Any and all tips appreciated

    You can download the Library from this link. Inside is an example that shows how to handle windows messages/events.
    http://zone.ni.com/devzone/cda/epd/p/id/4394

  • Event structure doesn't handle all events from external DLL source

    Hi!
    I use a DLL, wich handles an USB CAN transceiver device, and generates LabVIEW user events with extcode.h and PostLVUserEvent() function.
    In my vi I use an event case structure to handle theese external events. The problem is, that if the events come too frequently, then it cannot handle all events.
    The vi contains a couple of parallel while loops which process the incoming data from the external event.
    In another application I use the same architecture, and that works fine. This one is more complex.
    Do you think I have reached the limits of the program? Or what else can be the problem?
    I have tried to use a queue in the  event structure, it helped a little, but yet, not all the events are handled. My external DLL sends all event, so the problem is not there.
    Thanks in advance!

    Hi Wasz,
    Thanks for the post and I hope your well.
    It is not possible for the event structure to miss events - it simply queues them up. To keep the event structure 'in time' with the code you must ensure the code to execute in each event is minimal to allow the event structure to handle the next event. 
    Please see this two links:
    event structure buffering: leading to,
    How to avoid built-up for "cursor move" events? : where somone is trying to avoid handling all events.
    What sort of events are not being handled? Could it be an issue your events are not configured correctly? Maybe if you could produce a small example in LabVIEW code, so we can just test the event structure configuration... someone working around the external dll call - which you seem sure is working correctly.  
    In terms of queuing to process the events in other loops is certainly an option to speed up the event structure. To do this, use a produce/consumer design pattern.
    hope this helps,
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • Event handler : handleEvent(Event event)

    Good day,
    The deprecated event handler "handleEvent(Event event)" has been replaced by "processEvent(AWTEvent event)" as per the docs.
    With some research, I came up with this little conversion chart :
    item handleEvent processEvent
    ====== ============ ============
    x event.x event.getX()
    y event.y event.getY()
    id event.id event.getID()
    target event.target ???
    ====== ============ =============
    I'm just trying to compile a list of conversion for deprecated APIs with some extra information to "ease" the transition process.
    Is the above information right or am I still missing the boat ?
    Please apply necessary corrections wherever applicable.
    Best regards.

    Good day,
    The deprecated event handler "handleEvent(Event event)" has been replaced by "processEvent(AWTEvent event)" as per the docs.
    With some research, I came up with this little conversion chart :
    item handleEvent processEvent
    ====== ============ ============
    x event.x event.getX()
    y event.y event.getY()
    id event.id event.getID()
    target event.target ???
    ====== ============ =============
    I'm just trying to compile a list of conversion for deprecated APIs with some extra information to "ease" the transition process.
    Is the above information right or am I still missing the boat ?
    Please apply necessary corrections wherever applicable.
    Best regards.

  • Is it possible to handle multiple events using Jscript for a button in Apex

    Hi,
    I've application wherein in one of the pages for a button, I need to trigger 2 events as: 1. redirect to a new page upon 'click' of the button
    2. display a set of values on 'mouse over' that button.
    I'm able to handle both separately, but not in one button. I would like to know if there is any limitation in Apex that we cant handle multiple events? Currently I've put a text item near the button, and called the Jscript for mouse over event in that as a temporary workaround. Can someone let me know if this is feasible? If not any other alternative to handle this?
    Thanks in advance,
    gsachidh

    Hi Gsachidh,
    well interesting problem you're facinng. Indeed, it can't be specified using the 'Button Attributes' So we have to come up with an workaround.
    A quick en dirty solution would be to specify it with the 'Optional URL Redirect options'. In a normal button, with processing on same page, this would be 'no target'. but in case of additional things to be done this can be used, using an target URL. I used this many times, in example with popUp windows for refreshing the caller object when changes are made. In your case we have to add next to the href an onmouseover event. this can be done with;
    Target set to => URL
    URL - target => javascript:doSubmit('<button_name>');" onMouseOver="javascript:showTooltip('tooltip');"
    Here the " is the key, letting ApEx know the target (href) is doSubmit('<button_name>'), just like when no target would be specified and adding a new javascript event; onMouseOver.
    Although this is a dirty solution in my opinion, it is the best i could come up with. I have another idea in how to do this, that is by adding this event dynamically with javascript with an addEvent. But i don't have an example at the moment for this scenario.
    Simon
    Message was edited by:
    S1M0N

  • Labview event problem

    Hi guys
    I have a problem with the event case. I have a Button called "CON". This Button have to start two deferent Event Structurs by change his value, but not on the same time.
    Between the Event Structurs i have two Case structurs with other stuff. Wehn i first press the button, it will be make the stuff twice (like i press the button twice). I have no idea why.
    thanks for Help

    Because each event structure has its own event queue.  So when you press the button, all event structures that are registered for that value change event will have it queued up.  So your first event structure sees the event and runs that event case.  The second event structure can't run yet due to data flow, but it has the event queued up.  So when that second event structure is reached, it can run that event case.
    In general, your VI should only have 1 event structure.  This makes handling events A LOT simpler.  Look into the state machine.  That will help you handle your events properly and in a central location.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Reg : Cross browser issue while handling LOV event on KeyFlexFeild

    Hi OA Gurus,
    We are encountering issues on R12.0.6, JDev 120Rup6.
    We have the following test case and code changes.
    Requirement:
    We have OA page where we have one KeyFlexFeild item and a normal LOV. Page items are part of one AM and LOV is in another AM.
    The requirement was to make LOV dependent on keyFlexfeild. Test case is mentioned as per following flow.
    1.     User changes cost center segment of Accounting Flex(Key flex) using Cost center LOV.
    2.     Another LOV in the same page should be dependent on new value of cost center as modified in step 1.
    Solution Implemented:
    Describing in the 3 steps
    1) Here the KeyFlexFeild is expense account. Whenever User changes any segment, we handle
    ‘lovValidate’ and ‘lovUpdate’ events on KeyFlexFeild in processFormRequest of controller.
    2) Retrieve the value of cost center segment using getSegmentsQualifiedBy(), Update corresponding VO attribute of the LOV query parameter.
    3) Forward the request to current page so that LOV will have modified value with updated query.
    4) Forwarding to current page is must because LOV is built with another AM and will loaded only when page is built.
    Issue:
    This works fine on internet explorer. When trying to run the same in Mozilla we have following issue
    1) User modifies one of the segments of expense account and make a tab – out
    2) Now the page refresh happens
    3) Now in the same page no other LOV or no other button works. He can’t click on any button for submit or cancel.
    LOVs will not open even after clicking on it.
    Code changes:
    //Step1 – Handle LOV events
    String source = pageContext.getParameter(SOURCE_PARAM);
    String eventType = pageContext.getParameter(EVENT_PARAM);
    if(source !=null && eventType != null) {
    if(source.startsWith("Acct") && eventType.equals("lovUpdate") || eventType.equals("lovValidate") ) {
    KeyFlexfield flex = (KeyFlexfield)lkff.getAttributeValue(OAWebBeanConstants.FLEXFIELD_REFERENCE);
    // Step -2 Updating the corresponding VO attribute for LOV to get the modified the value
    Segment[ ] segmentL = flex.getSegmentsQualifiedBy(FA_COST_CTR");
    CostCenterValue = segmentL[0].getValue().getValue();
    if(CostCenterValue != null ){
    sampleViewObject.getCurrentRow().setAttribute("ToCostCenter",CostCenterValue);
    OAFormValueBean formValueBean = (OAFormValueBean)webBean.findIndexedChildRecursive("ToCostCenter");
    if(formValueBean != null)
    formValueBean.setValue(pageContext, CostCenterValue);
    OAMessageLovInputBean formValueBean1 = (OAMessageLovInputBean)webBean.findIndexedChildRecursive("ReceivingApprover");
    if(formValueBean1 != null)
    formValueBean1.setValue(pageContext, null);
    else
    sampleViewObject.getCurrentRow().setAttribute("ToCostCenter",null);
    //Step 3 – Forward the request Current Page again
    pageContext.setForwardURLToCurrentPage(null, true, ADD_BREAD_CRUMB_YES, (byte)0);
    We have following questions.
    a)     Solution implemented by us is correct ? or we have to implement it in another way ?
    b)     Is OA version mentioned above supported on Mozilla browser version 3.x ? This issue is not occurring on Mozilla 1.x while running from JDev.
    Please let us know if any additional details required.
    Thanks for help in advance.
    Edited by: user774130 on Dec 15, 2009 2:27 AM

    Hi,
    It seems that you have not noticed that this forum is not for posting product-related questions/problems....
    So , this might be the correct forum....
    Java Server Pages (JSP)
    Sim

  • How to handle softkey events

    hi all,
    The softkeys varies form device to device.so kidly say some genric way to handle softkey events.
    Thanks in advance
    Badri

    The only "generic" way to handle softkeys is to use Commands.
    shmoove

  • Javascript error in event handler! Event Type = element [edge.2.0.0.min.js:162]

    I'm doing a little edge project (now in beta version) for my girlfriend (she hates the code), with examples of the animate() method and other functions like setInteval(), but when I run I get the following error in Chrome console:
    Javascript error in event handler! Event Type = element [edge.2.0.0.min.js:162]
    But this library is global for all projects, how is possible that trigger an error?
    Example here:
    https://app.box.com/s/m7nof4al6597gfn47jlu
    Thanks.

    you dont need to import java ease !!
    it's already included in edge animate, remove that yepnope completely your problem will gone
    Zaxist

  • Handling Key Event

    How to handle key events in the Console?
    Plz give sample code for it.
    Thanks in advance.

    Don't have any experience with it personally, but I think curses does this type of thing http://sourceforge.net/projects/javacurses/

  • Handling Button Event

    Hi all,
    i am using a 'When-Validate-item' trigger in this i am doing a validation,
    when user try to enter amount greater than the given amount(This is needed validation)
    and also i am regenerating new lines(Creating new records when button pressed)
    when i am regenerating i should not validate.
    How to handle button event
    Thnx
    Raj

    Hi...
    The WHEN-VALIDATE-ITEM Trigger fires once you updated a field. Be sure you raise
    form_trigger_failure when amount is invalid. So, the cursor stays in field amount. You cant
    leave this field until the amount is not valid.

  • How to handle Valuechange events, when page bean is in request scope

    Hello balusc and forum mates,
    I want to know is there any good way to handle ValueChangeEvents events, when the page's bean in request scope.
    My problem is, I have a page having more than 1 value change event so How can I maintain page values at backing bean. My bean is request scope, I can't change to session scope.
    Please I really need it.

    Hi Frank...
    In my code i used almost same logic as Andrejus Baranovskis has explained in his Editable Table example...
    You can refer that example to see what problem I'm facing...
    http://andrejusb.blogspot.com/2007/04/create-edit-and-delete-operations-in.html
    The Bean Scope in this Example is Session scope...Save button is working fine...
    But as i Change the bean scope to Request scope then Save button is not working for Edit but it is working for Delete Action very well..
    I want that save button should work also for Edit action in Request Scope..
    Please Make me understand that why it is happened like that..
    and help me to find the solution..
    and Also if you have a better document to Explain the life cycle of Application in Different Bean Scope...So please provide me that Doc to me...
    It would be a great help for me to understand the concept of session...
    Thanks Frank
    Fizzz...

  • Handling FPM Events in Java WDP

    Hi All,
    I have a requirement for a simple WDPJ iView that responds to the selection of an employee in MSS.
    Is it possible to handle the employee selection event from Business Package for Manager Self-Service (mySAP ERP) from a simple WDPJ iView that is not configured/resgistered as an FPM Self-Service application?
    Can a WDPJ simply handle theses events if the event name is known?
    Cheers,
    Steve

    Steve,
    you may want to check out these links
    Adding custom iview to general info
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/how-toaddacustomWebDynproiViewtotheMSSEmployeeProfile%28ECC+6.0%29
    and check this note 1112733
    Thanks
    Bala Duvvuri

  • Handling button events in large app

    I'm currently examining a large swing app, and have observed the following with regard to action events.
    A number of listeners (for buttons, menu items, JLists etc.) are defined at the top of the app. These variously extend MouseAdapter or implement ActionListener, depending on the type of component whose actions they listen for.
    The ButtonListener definition is as follows :
    private class ButtonListener implements ActionListener
    public void actionPerformed(ActionEvent event)
    Object object = event.getSource();
    if (object == button1)
    // button1 actions
    else
    if (object == button2)
    // button2 actions
    .....etc
    One instance of this listener is created in the app, and is used as the actionlistener for each button. This means that the buttonlistener is quite large (as it contains the code for each button in the app).
    Is this the proper way to handle button events for an app with a large number of buttons?

    Thanks for the responses.
    In response to theDude : I agree that defining the action listener for each button can be useful when you can see the button definition and button action in one place; one could counter that by saying that grouping all the button actions makes it easier to examine all button actions in one place.
    Setting the action command isn't really an option because the application creates panels of buttons on the fly, e.g. when notification of a new customer is received, a new panel is created with a JTextPane (customer description) and a row of buttons for "Modify", "Delete" and "Print".
    Several customer panels could be in existence at the same time, so setting an action command of "Modify" would not enable one to uniquely identify which "Modify" button was pressed.
    This problem is currently handled by associating the panel instance with a "Customer" class instance in a hashtable. The "Customer" class consists of a JTextPane field, and a JButton for each function. When a button is pressed, the button listener traverses up the component's parents until it reaches the panel (i.e. it loops until the parent is a key on the hashtable, at which point it can retrieve the Customer instance and check which button was pressed).
    In response to KPSeal : If I understand you, I would define "ApplicationAction" separately from the main app and define extensions of it in the main app for each type of action. Would this add much value over merely defining a method for each type of action in the main app and just calling this method when the relevant button/menu item was pressed/selected?
    There doesn't seem to be a universal approach to event handling, but I thought there might have been one accepted strategy when an app has large numbers of buttons (some created on the fly, ruling out action commands).

Maybe you are looking for