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?

Similar Messages

  • 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.

  • Print file via ActiveX,an​d it is not found always

    Hello, I have made a lot of efforts to create and print an HTML Report.
    I have concluded to the fact that it has to be printed via ActiveX.
    But it is not working always. Some times the JPEG file that has to be printed, is not found and a "red X" is printed on the top-left of the page.
    Other times it is printed successfully.
    I attach an image of my code in which I use the ActiveX.
    Is there something that I can do?
    Thank you.

    Did you look in the LabVIEW Help? http://zone.ni.com/reference/en-XX/help/371361G-01​/lvhowto/reg_hndl_ax_evnts/
    You right-click on that parameter and select Create Callback VI. This will automatically create a VI with the required inputs and outputs. This is the VI that will be called when the event occurs. If you need the callback VI to update any front panel controls of the main VI, then you can pass in control references via the User Parameter input.
    Attached is a modification of the shipping example that handles the Navigate and DocumentComplete events.
    Attachments:
    Navigate Callback Example.vi ‏24 KB
    Navigate Callback.vi ‏15 KB
    DocumentComplete Callback.vi ‏15 KB

  • How to call a LV.exe from LV via ActiveX?

    Hi all,
    I need some kind of atomic task, e.g. some (short) instructions that cannot be aborted. Calling a DLL, wait some ms, calling it again... And even an Abort via VI server shall not abort this atomic task but finish it.
    I thought about building an LV application and run it via ActiveX.
    Building the app is managed. But running it via ActiveX is still unsolved.
    Have extensively searched for examples for this, but the only source I came up with was
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DD6B56A4E034080020E74861&p_node=DZ52051&p_source=external
    This one is about 6 years old and talks about LV 5.1, whereas I use LV 7.1.
    Nevertheless I have performed all steps as described there, e.g. enabling ActiveX, granting privileges, enabled DCOM with dcomcnfg and registering my app. Finally I could open an automation refnum to it. But whatever ActiveX class I choose, there's no way to set a control in my app and to run or call it. Lots of mysterious errors (depending on what class I choosed), amoung them 5012 (exception occored).
    Any newer instruction or another idea on how to get an atomic VI?
    BTW, I am not sure if a DLL would do it, as it runs in the context of LabVIEW. I believe I need this atomic VI in a different context. Right?Message Edited by LuI on 06-17-2005 04:08 PM

    Hi Lul
    I create a small example to run an LV application an run it via ActiveX in LV 7.1.
    To build the application I change:
    VI settings => Run when opened => No
    Application settings => Enable Active X server
    to register the executable I only run it once.
    Hope this helps
    Manuel
    Attachments:
    example.zip ‏45 KB

  • How can I detect an external trigger and then generate an event or occurance

    I have a PXIe-1065 chassis with a PXIe8030 controller, PXI-6653 timing module, PXI-6542 Digital IO, and PXI-6259 DAQ board, running LabView 8.5. I need to detect a trigger (100 ns TTL pulse) from an external device then start a process on a GPIB device. Is there a way for me to detect this trigger and then generate an event, or an occurance ? Can I do this without polling a device? Can any of this hardware generate an interrupt that LabView can detect?

    My screenshot was only an example how you can approach the issue. I wasnt saying that you should try it with AI....
    Just take a closer look into the DAQmx Events and you will discover something like this:
    hope this helps,
    NorbertMessage Edited by Norbert B on 10-05-2007 02:35 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.
    Attachments:
    DAQmxEvent.PNG ‏11 KB

  • Handling events of ActiveX controls in TestStand!rol

    Hi,
    I want to use the Microsoft WINSOCK control with existing ActiveX Automation Adapter of TestStand. These control generates an event in case of incomming data.
    Question:
    Is there any way to treat the events of such controls in TestStand (same problem with MSCOMM control) or can this only be realized by polling the size of incomming buffer?
    In case of answer two, i would be interested in any realized example.
    Regards,
    Sunny

    Hi Sunny,
    Currently, you cannot call ActiveX controls using the ActiveX Automation Adapter in TestStand. To do this, you would need to call a code module that was set to display/utilize the control, and retrieve all of the events generated by the control. TestStand can only currently call ActiveX servers (either DLL or EXE) that support the IDispatch interface. Hope this answers your question.
    Regards,
    Bob

  • Generate an Event based on Counter Trigger

    Hello,
    I have the following part that is already working: a counter (used for period measurement) which is triggered by a digital input. After that I'm reading the data and I'm puting them in a Queue. Here I get an error. The Enqueue Element Vi is providing an error. (Error 1, something with a @  character that is illegal). I've notice that if I disable the trigger for the counter I don't get the error. I'm thinking that this is cause by the delay between the moment in which the Enqueue Block tries to enqueue and the moment in which the counter provides something to its ouptut.
    What I want to do is to Generate an Event based on the Counter Trigger Signal and to put all the reading and Enqueue part in an Event Structure. I've tried to do that using an Export Signal - Property Node, but I didn't manage to make it work.
    If you have any solution for this (with or without events -  I just want to get rid of that error) please let me know.
    PS: I have Labview 8.5.1 and the USB-6210.
    Thanks,
    LostInHelp

    Hello Mike,
    Thanks for your replay.
    I've attached two vi files. In one you can find how I've tried to generate an event based on the counter trigger (test.vi).
    The second one (test1.vi) is the vi where I get the queue error. I've deleted from the second vi the part where the data are dequeue and handled.
    Thanks
    LostInHelp
    Attachments:
    test41.vi ‏50 KB
    test110.vi ‏35 KB

  • "Invalid type library" error when opening Excel via ActiveX

    Hi,
    I am trying to open Excel via ActiveX (Automation open function), for
    instance by running the
    build in example "Open Excel and make visible". However, on some computers,
    I recieve the error code -2147319784 "Old format or invalid type library".
    The problem seems to be that LabView is unable to recognize the ActiveX
    control, as it does not appear in the list "Select ActiveX Class". It works
    perfecly from Matlab though, so the control seem to be in order. I have also
    tried reinstalling Office.
    On most computers it works perfectly, but three identical Dell P4 900Mhz
    have the same problem.
    /Stefan Borg

    This may be happening due to different Excel versions, a vi made to control Excel 97 won't work for Excel 2000 and vice-versa. Be sure you are using the correct activeX calls for each one.
    Good luck

  • Multiple "generate user event" in event loop

    Hello.
    1.)  I am wondering if you can user a "generate user event" into an event loop to create a quasi-state machine.
    For example create an event loop with the events "event a", "event b," "event c," and so on.   The in "event a" put in a function to generate a user event to call "event b".  Then "event b" will call "event c" and so on.
    2.)  If this is possible, then can u put multiple generate user events into a single event loop and have it queue the generate user events up.  For example have the "event 1" case use the "generate user event" 3 times (generating "event 7" "event 8" and "event 9.") to call the next three future event cases in that order?
    Thanks
    Charlie C.

    Of course it is possible, easiest with simply writing signaling properties. (See attached examples, LabVIEW 7.1).
    You have to be very careful that you don't create trigger loops, e.g. event A triggers Event B, which triggers Event A ... ad infinitum! :0
    Example "Multievents": event 1 triggers event 2, which triggers event 3.
    Example Multievents2": event 1 triggers events 2-3-2-stop in sequence.
    Message Edited by altenbach on 09-28-2005 01:26 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    MultiEvents.vi ‏57 KB
    MultiEvents2.vi ‏72 KB

  • Microsoft-MsgBox via ActiveX

    Hi,
    i want to call the Microsoft-Message-Box (function "MsgBox" in VB) in my LabVIEW-6-application, e.g. via ActiveX.
    In the list (offer when import ActiveX-Controls) I can't find the MsgBox or any equivalent. Can anybody help me?
    Thank You.
    C. Dietz
    Test Engineering
    digades GmbH
    www.digades.com

    C. Dietz;
    You can use the Windows API Function Utilities (32-bit) for LabVIEW to call the Message Window Dialog Box.
    Also, as you might be already aware, LabVIEW also has a Message Box located in the function palette under the Time & Dialog menu.
    You can also create your own message box.
    Regards;
    Enrique
    www.vartortech.com

  • Create BO Event via Change Document

    Hello gurus
    I'm having some trouble creating an event via a change document for a custom Z table.  I've already followed the steps outlined in help.sap.com:
    1. Created the change document for the z table and generated the program.
    2. Made the Z table and its data elements relevant for change documents.  Did this through the Technical Settings for table (Log changes checkbox) and data element characteristics.
    3. Made an entry under "CREATE" in SWED for my new change document object, with the z table as the leading table and change document key with structure.
    4. Made an entry for my event in SWEC and linked it for a create of the change document.
    However, the event is not being fired when a new entry is made in the z table.  I set a breakpoint in the funcion module generated for the change document but it's not being detected apparently.
    Are there any further settings I need to look at/change for the change document to activate the event?  Thanks in advance
    Regards,
    Juan Ramos

    Hi Ramki
    Indeed, I consider using SAP_WAPI_CREATE_EVENT much, much simpler, but unfortunately it was another consultant, not me, who built the table, its code, and the code behind the z transaction where the table is used (and he's based offshore).  It was only just now that I also found the code he wrote for the txn. 
    If I would have to add code anyway to make the change document work, I'll just talk to the consultant to have him add the SAP_WAPI_CREATE_EVENT, or I'll just add it myself if I get permission from our development manager.
    Thanks for your help as always!
    Regards,
    Juan Ramos

  • Generate schedule lines via MRP

    Hi,
    Unable to generate schedule lines via MRP.
    Settings:
    Mat master - External proc , no spl proc
    OA - Maintained
    Source list - Maintained MRP Relevant - Indicator 2
    Quota arrangement- Exist with only 1 vendor(same as of OA) 100%
    MD03 - Planning data - Create PR (indicator-1), Create Sl(indicator 3)
    Please let me know whether there is anything else which influence SL generation.

    Hi,
    hi,
    1. Mark checkbox source list in material master.
    2. purchase info record for the vendor & material combination
    3. source list for the material - mention the scheduling agreement and mark as mrp relevant, schedule lines generated
    4. Use MD03, choosing 1 for purchase requisition, 3 for schedule lines and planning mode, prerequisites requirement exists for material. If requirement does not exists it will not create scheduling agreement line.
    I  hope you got all your answers. so kindly close this thread.
    YB

  • How to read and display a signal from my a miccrontroller (MCB1700) onto labview connected via a CAN port on a PXI machine

    How do you read and display a signal from my a miccrontroller (MCB1700) onto labview connected via a CAN port on a PXI machine?
    I tried using a DAQ Assistant but the CAN port is not included as one of the supported physical channels even though all its drivers are upto date.
    Please help..
    Thanks.
    Solved!
    Go to Solution.

    Attached herewith is a print screen of what is showing on MAX
    The CAN ports are on NI PXI-8461
    Hopefully that clarrifies something.
    Attachments:
    Untitled.png ‏212 KB
    Untitled.png ‏212 KB

  • Programati​cally change control focus to generate and Event.....​.

    I'm adding some user enhancement (anti-screw-it-up functions) to insure the desired process is executed.
    Primary question:  If I have an event that is handles by a value change in a text control, (event happens when you hit Enter or exit control with mouse) will the event also occur if you exit the control by programatically changing the focus to another control ?
    I'm going to try and set up a temp vi to test this but wanted to see if anyone had tried this and if it works or not.  My other option is to set up multiple event cases but I was hoping to use a single case to handle everything.
    A few details,  I have a test system that tests a product automatically when the product is placed in a cradle and the cradle is moved into position and activates a prox sensor.  At end of test, system waits for prox sensor to de-activate before resetting the system.
    If a unit fails, there are rework options and the unit can be retested.  When it fails, a label prints defining the failure modes and provides a failing serial number.  When the unit is retested, the failing serial number is entered into a text control. I want the re-test sequence (queued up in the Event) to occur when either 1, a failing serial number is entered or two a button is pressed (with mouse)  I'm pretty sure pressing a button would in turn automatically create the text control change event so my button can probably be a dummy button just for appearances.
    Where the hole is if the user enters a failed serial # and doesn't exit the control and then engages a pump to start the test.  I can use a 'Empty Path/String' function but the control will continue to show empty as if nothing was entered until the Enter key is pressed or the mouse is used to exit the control.
    If I can generate the event by changing the focus, then it will insure that if a failing s/n is entered, the re-test sequence occurs and if nothing exists in that field, it performs a first time test.
    A little long winded for sure but any thoughts are appreciated.
    Can't really post any simple code as this feature is in my top level vi and I have a really big app that doesn't warrant uploading.
    Doug
    Doug
    "My only wish is that I am capable of learning each and every day until my last breath."
    Solved!
    Go to Solution.

    Actually, changing the focus alone did not trigger the event but I was able to then utilize the Empty Path/String function to drive a Value(Signaling) node for the control.
    Doug
    "My only wish is that I am capable of learning each and every day until my last breath."
    Attachments:
    Event_Structure_Trials.vi ‏29 KB

  • Generate an event programically

    Greetings everyone!
    I am trying to create a 'splash' screen that is displayed during httpconnection calls so that the user is informed of the status of the connection (ie connecting, posting, receiving etc). I created a form that implements the runnable method so that i can call httpconnection on a seperate thread. Once the run method is called i clear up all elements in the form, display a message and proceed with the http business.
    The only problem is that the only way i found that i can move on to either a) the next form (if the data return is OK) or b) to the same form that made the call (if there is some error) is by inserting a command in the form after the connection is finalized, thus allowing the user to click his way out of the info screen.
    I was wondering if there is some way for an event to be generated automatically once the connection is finalized, which could be treated by the commandlistener, thus allowing me to avoid any further user interaction.
    thanks in advance!
    best,
    marcos

    thanks for the help guys, i apologize if i did no make myself clear, but i think i can try out the call back method you guys suggested.
    my problem was the following, i would:
    1) generate an event that would call my connection thread
    2) the main thread would then finish
    3) the connection thread would get started
    4) the form would be cleared up and a new message (ie connecting etc) would be appended
    5) the connection thread would finish
    i guess what i forgot to explain is that at this point i was hoping i could 'generate' an event so that i could call back my CommandHandler class (which implements commandlistener). i could probably change the code around in all my forms so that the result from the connection gets treated in the same thread that calls the connection. but by what i understood i could call commandlistener(command c, displayable d) directly, which would result in an event being generated and thus i could stick to my current logic whereby all events get treated in the main thread.
    so the next step would be
    6) i save the result of my connection
    7) i call back my commandhandler
    8) i treat the result of the connection and move on to the next Form by calling display.setDisplay...
    is that correct or did i misinterpret your answer?
    thanks again for the all the help guys, much appreciated!

Maybe you are looking for