Event CallBack in TestStand - Labview OI

Hi everyone,
i am using the simple interface for labview of teststand, i have modified the interface what i like, now what i want to do is when the user press the control button to execute a sequence the system ask the user for something and depending of it answer execute or not the sequence, for this i have create a new event callback, modifying the configure event callback.vi, what i introduce in the Reg Event Callback is that when StartExecution event starts it run the callback vi that contains the question to the user.
It works well because when the user press the run sequence control button or the restart contorl button, the system ask the user. But the problem is when the user press the exit control button, the system ask too.
Why occurs this, and how can i fix it??
Thank you in advance

Hi Marith,
This behavior is occurring because the Application Manager automatically executes the FrontEndCallbacks sequence file when the Operator interface starts, and again as part of the shutdown.  To prevent this from occurring, we'll need to check that the execution is not the FrontendCallbacks execution before launching the dialog (the other case is "FrontEndCallbacks.Seq"):
You also may want to consider a couple alternative implementations:
use the UImessage event to run the code when the UIMsg_ModelState_Initializing message is posted (when the process model begins executing)
putting this code in the process model rather than the User interface - in this case we could just add a step in the setup of the model, and terminate the execution if the user chooses.
Al B.
Staff Software Engineer - TestStand
CTA/CLD

Similar Messages

  • Event callback insanity

    Can anyone tell me what might be causing
    such a serious error?
    #Date: Mon, Jan 26, 2004 1:56:37 PM
    #OSName: Windows NT
    #OSVers: 5.0
    #AppName: LabVIEW
    #Version: 7.0
    #AppKind: FDS
    D:\lvworm\src\lvsource\eventoracle.cpp(370) : DAbort: event callback insanity
    $Id: //labview/branches/Wormhole/dev/lvsource/eventoracle.cpp#112 $
    0x00589B50 - LabVIEW + 0
    0x0058A245 - LabVIEW + 0
    0x0058CFDB - LabVIEW + 0
    0x0040AF57 - LabVIEW + 0
    0x0DDAA9C7 - tsui + 0
    0x0DDA9FC3 - tsui + 0
    0x0DDA1FEF - tsui + 0
    0x581777B0 - teapi + 0
    0x77E3A2D0 - USER32 EnumClipboardFormats + 76F
    0x77E145E5 - USER32 GetDlgCtrlID + 1E
    0x77E15B51 - USER32 wvsprintfW + 132
    0x00B
    84CA0 - LabVIEW + 0
    0x00B3C46B - LabVIEW + 0
    0x00C0813C - LabVIEW + 0
    0x7C5987E7 - KERNEL32 SetLocalTime + 4FC

    Hi William,
    I can not off hand explain this to you beyond the obvious stuff.
    If you can reproduce this error at will, I suggest you share the details on how you did this.
    I also suggest you report this to NI as a possible bug. I am not sure if Win NT is still supported.
    Ben
    Ben Rayner
    Certified LabVIEW Developer
    www.DSAutomation.com
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Configure Event Callbacks in test stand using labview

    Hi,
    I was going through Full OI - Configure Event Callbacks.vi in the test stand example. Can you please explain me how the vi works and what is techniwue behind it?
    When i open the individual VI's in the reference, I could see more that 1 control in the front panel. But Only the user parameter is wired in the vi? Why is it so?
    Regards
    Gopal

    Hi Gopal,
    When the TestStand Engine fires events, this VI specifies how your Operator Interface will respond.  For example, let's examine the first event callback registered in Full OI - Configure Event Callbacks.vi , Exit Application.   When the TestStand Engine receives the message to shutdown, and then finishes its neccessary shutdown procedures, it will send a message to the Operator Interface.  For the Operator Interface to receive this message, it must "listen" for it.  In LabVIEW, this is done by Registering an Event Callback.  See the links below for details on how to implement this. 
    The answer to your specific question is in step 7 of the first link below.  When TestStand sends the message to LabVIEW, there is information that is always passed.  The other input controls contain this information.  To create a VI that always includes these controls, right-click on the VI Ref input to the Reg Event Callback Property Node, and then select Create Callback VI.
    Here are two references that talk about handling ActiveX callbacks in LabVIEW in general:
    Registering and Handling .NET and ActiveX Events
    Register Event Callback (Not in Base Package)
    Cheers,
    David Goldberg
    National Instruments
    Software R&D

  • Active x and event callback in Labview

    I have an active x written by Aanderaa Instruments (makes
    weather and hydrology sensors), it contain various methods and events to get
    the next line of records from a sensory scanning unit. The connection is
    through the COM1, so far i have wired it up only using the methods to get next
    record level, but then I have found that sometimes it does not get the complete
    record from the COM port. So to solve that I have to use an event in the active
    x to check for new record available. So what I want to do is send the event
    (when complete record available) to VI that uses the get next record method to
    pick up the data from the COM1 port and then send the data back to the main VI
    for processing, plotting and writing.
    My problem is that when I connect the output from the GetNextRecord method to a
    indicator that I then wire on the connector pane to be an output from this
    VI  get an error that there is a wire function conflict. I have tried to
    explain a bit better in the attached pdf file with diagrams.
    The reason why I want to export the data back in the main VI is because it runs
    continuously collecting data every 2 min and I plot them on a graph and write
    them to a file so it will no work to have all that done in the event callback
    VI that will only run ever 2 min, then it will reset the graph the whole time
    and I want continuous data plotting for 10 days of historic data records. I
    also have a few other sensors that come in through a connector board that are
    written o the same file.
    hope somebody can give me some hints
    Attachments:
    labview question.pdf ‏721 KB

    Duplicate post, click here for the original: http://forums.ni.com/ni/board/message?board.id=170&message.id=135639#M135639
    LabVIEW Champion . Do more with less code and in less time .

  • Event callback with active x in labview

    I have an active x written by Aanderaa Instruments (makes
    weather and hydrology sensors), it contain various methods and events to get
    the next line of records from a sensory scanning unit. The connection is
    through the COM1, so far i have wired it up only using the methods to get next
    record level, but then I have found that sometimes it does not get the complete
    record from the COM port. So to solve that I have to use an event in the active
    x to check for new record available. So what I want to do is send the event
    (when complete record available) to VI that uses the get next record method to
    pick up the data from the COM1 port and then send the data back to the main VI
    for processing, plotting and writing.
    My problem is that when I connect the output from the GetNextRecord method to a
    indicator that I then wire on the connector pane to be an output from this
    VI  get an error that there is a wire function conflict. I have tried to
    explain a bit better in the attached pdf file with diagrams.
    The reason why I want to export the data back in the main VI is because it runs
    continuously collecting data every 2 min and I plot them on a graph and write
    them to a file so it will no work to have all that done in the event callback
    VI that will only run ever 2 min, then it will reset the graph the whole time
    and I want continuous data plotting for 10 days of historic data records. I
    also have a few other sensors that come in through a connector board that are
    written o the same file.
    hope somebody can give me some hints 
    Attachments:
    labview question.pdf ‏721 KB

    Hello!
    I checked the PDF file with snippets of your code and it looks alright, no issues or comments regarding that from my side. However it is really difficult for us to troubleshoot when we don’t have the ActiveX control available and even though we had access to the control it would still be quite tricky to find the cause of the problems you are experiencing since we don’t have the hardware and so on.
    I found one link only that mentioned wire conflicts when talking about COM objects and ActiveX and you can find it here:
    http://digital.ni.com/public.nsf/websearch/0CED780​C5D5EDCD5862569D9005AE1FA?OpenDocument
    Regards,
    Jimmie A.
    Applications Engineer, National Instruments
    Regards,
    Jimmie Adolph
    Systems Engineer Manager, National Instruments Northern Region
    Bring Me The Horizon - Sempiternal

  • How to access new data in User Message Event Callback?

    I am using the Simple LabVIEW OI as the model for my TestStand user interface.
    The sequence sends a User Message to the OI to request the string array of tests to run.
    But I am having great difficulty making this string array data available to the event callback VI.
    I do not want to use a global variable and so my unsuccessful method so far has been as follows:
    1. Use a Refnum to the Array and pass it into the Config Event Callbacks VI via the cluster 
    2. The "Selected Tests" in the input cluster in the Config Event Callbacks VI is a generic Control Refnum
    3. This Selected Tests (at the bottom) is then bundled and passed into the User Parameter
    4. But how do I convert the Selected Tests Control refnum back into the original string array in the actual callback?
    Also if there is anyone that can suggest a better way of doing this then please let me know.
    The bottom line is - how to get the latest data into the event callback function when it is called?
    Many thanks,
    Ronnie
    TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
    Solved!
    Go to Solution.

    Hi Ray,
    The 'Selected Tests' array refnum is #4 in the cluster order and matches all the way through - so I think that's OK.
    In the final diagram above, I can get the Selected Tests cluster from the 'User Parameter', but it is still in the form of a refnum.
    My problem is a lack of understanding in how to convert this 'Selected Tests' refnum back to the original data type (a string array).
    Basically I want to get the string array from the 'Selected Tests' refnum.
    As you can see from above I tried to use a property node. I've also tried to 'cast' the refnum to a 'more specific class' by choosing 'Array' but it's still ends up as a refnum.
    I hope you see what I mean?
    Thanks,
    Ronnie
    TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009

  • Executable and Register event callbacks

    Hi,
    I have been running into an issue regarding the building of an executable that has register event callbacks (specifically Test Stand Callbacks).  The VI that is responsible for setting up the event registration is an asynchronous VI.  During development everything works but during deployment of an executable the Callback is either not running or capturing the event from the Test Stand engine (I am looking for the end of execution event).  The setup is not reporting an error, and the pathing to the callback VIs is correct.  Any Ideas on this?
    Does the Teststand engine not post a endexecution callback when running from a executable labview environment?
    Thanks,
    Andrew
     

    akonecki wrote:
    Hi,
    I have been running into an issue regarding the building of an executable that has register event callbacks (specifically Test Stand Callbacks).  The VI that is responsible for setting up the event registration is an asynchronous VI.  During development everything works but during deployment of an executable the Callback is either not running or capturing the event from the Test Stand engine (I am looking for the end of execution event).  The setup is not reporting an error, and the pathing to the callback VIs is correct.  Any Ideas on this?
    Does the Teststand engine not post a endexecution callback when running from a executable labview environment?
    Thanks,
    Andrew
    The TestStand engine is singular regardless of what is hosting the components so it will post the appropriate callbacks. Try some tracing and see what flags up in your callback VI.

  • References won't close in UserMessage Event Callback example.

    I download the following example:
    http://zone.ni.com/devzone/cda/epd/p/id/2606.
    I was going to use some of the features of this example to pass variables from my OI to TestStand.  Well unfortunately, this example with the modified UserMessageCallback locks up everything with an R6025 error.  Well, it actually will also give me the Property Object warning dialog ONLY if I have the Debug Options set within the Station Options->Preferences tab set to report Object Leaks, otherwise I get the R6025 error.  Only solution is to go to Task Manager and close out LabVIEW.
    I attached a picture of the callback, I believe I am closing ALL possible references.  I don't understand why TestStand still thinks that the SequenceContext reference is open?   Is there something I have to do special to close the SequenceContext reference because of the Variant to Data function?
    I am running TestStand 4.2.1 and LabVIEW 2010.
    Thanks,
    PH
    Attachments:
    UserMessage Event Callback.png ‏53 KB
    Debug Warnings.PNG ‏19 KB
    R6025 Error.JPG ‏12 KB

    The original example failed, hence it did not work  Again, it did not work with TS 4.2 and LV 2010.
    All I was trying to do is use that example, to pass data from my Operator Interface to TestStand using the SequenceContext.  It was mentioned as an example in a previous post here:
    http://forums.ni.com/t5/NI-TestStand/Passing-Variable-from-Operator-Interface-to-Process-Model/td-p/...
    I attempted to add a fix for the Variant to Data function per reference to the KB, proposed by Anand Jain, in the previous posts!
    In the long run, I will have to go with the method proposed by Ray Farmer. 'The simplest way is just store it in the StationGlobals.'   Not exactly the method I prefer to use, but it seems to be working.
    Thanks,
    PH

  • Problem with register event callback in use of instrument control

    now, i use the register event callback to register a value change of a boolean control on the front panel, and wire the cluster's ref of the instrument control parameters to the user parameter input, then create the callback vi. In the callback vi, i select the pump-control subvi, and pass the user parameter to the subvi. The problem is that,  when i press the boolean control, the instrument (here is pump) can act, but immediately, the code crashes.
    I use labview 8.6
    Attachments:
    callback vi.png ‏8 KB
    register event callback.png ‏8 KB

    You would wire the event registration wire that comes out of the Register for Events node into an event structure.  You will need to right click on the event structure and check off "Show Dynamic Event Terminals" and it into that.  Then you can create a new Event Case that uses the dynamic event.  You can place your subVI in that event in whatever way you want.  (Just drop the subVI in or do a Call by Reference there, or whatever.)  Look in the Example Finder for "Dynamically Register for Events.vi".

  • How to place event callback components and "main-VI" components in the same Front Panel?

    What I'm trying to accomplish:
    Place a .NET component, which generates events, and other standard LabVIEW components in the same Front Panel. The standard LabVIEW components should be updated when events are being generated in the .NET component.
    How I tried to solve it:
    Problem:
    The event callback code must reside in a separate event callback VI. In order to "pass the event up" to the main VI I tried to use a global variable. The interrupt does occur:
    but I was hoping that the string indicator would be updated when the event occurred, but it wasn't.
    Questions:
    What's the best way to solve what I try to accomplish? If I want to solve the problem on the picture above, how would I do it (it may not be the best solution, but I'm still curious what's wrong)? Please feel free to be over-explicit when replying as I am novice LabVIEW programmer. Thanks in advance for any help.

    There are two bundle functions for creating clusters. The function simply called Bundle operates almost exactly like the Build Array function I showed. The type of the output cluster depends on whatever you wire in as inputs. You don't have to supply a specific type parameter.
    The function called Bundle by Name takes in a specific type of cluster in the top input and allows you to fill in the values of that specific type of cluster. To create the specific type of cluster you want, you need to create a cluster of string references. Here's how to do that:
    Go to the Front panel and drop down an empty cluster shell.
    Go to the Refnum palette and drop down a Generic Control Refnum. Now here's a cool trick to turn that generic refnum into a string-specific refnum (a so-called strictly-typed refnum). Grab a string from the controls palette and drag it into the Generic Control Refnum. Once you drop it, you'll see the refnum change its icon to display a string picture.
    Make copies of this string refnum (as many as you need) and add it to the cluster shell.
    Now, if you're making specific types of clusters to work with, now is the absolute best time to learn about typedefs if you haven't already. It will save you hours and hours (if not days) of development time in the future. Trust me!
    Jarrod S.
    National Instruments

  • Activex events not seen in Labview

    I have PC application which has a COM server interface included.
    I am able to connect to this successfully with labview for everything apart from events. When I try and connect to events it always comes back with error 95, event unknown. I have also tried the "list events descriptions" and that comes back empty.
    The COM server works fine when used with VB and C++ applications so I am guessing Labview is the problem.
    I am using a Automation Refnum control to access the COM server and this is working fine.
    Any suggestions why I can not see any events in Labview?
    (I am running Labview 6.0.2)

    Thanks for the reply. I just tried an evaluation copy of Labview 7.0 and managed to get it working with the new feature "Register Event Callback".
    I would still like to use Labview 6.0.2 if possible as I don't believe I will use most of the new features in Labview 7.0 and 7.1. Also we have alot of version 6 licenses that will cost alot of money to upgrade!
    Any suggestions how I can get 6.0 working with events?
    Thanks,
    Matthew

  • How to implement a callback function using LabView's Call Library Function Node?

    I am trying to call a fuction from a SDK.dll library using the Call Library Function Node. The SDK was provided to
    me and I do not have the source code, just the .dll and .h files.
    The SdkSetPropertyEventHandler function has a callback fuction as one of its parameters. How do I implement the
    callback using the CLF node? I am a good LabView programmer but this is my first time using the Call Library
    Function Node. I have read all the info I can find on NI's web site and the discussion board but cannot figure
    this one out. I am using LabView 8.6.
    The SDK.h deacribes the function as:
    //  Function:   SdkSetPropertyEventHandler
    SdkError SDKAPI SdkSetPropertyEventHandler(
                SdkCameraRef                    inCameraRef,
                SdkPropertyEvent                inEvnet,          
                SdkPropertyEventHandler         inPropertyEventHandler,
                SdkVoid*                        inContext );
    //  Description:
    //       Registers a callback function for receiving status
    //          change notification events for property states on a camera.
    //  Parameters:
    //       In:    inCameraRef - Designate the camera object.
    //              inEvent - Designate one or all events to be supplemented.
    //              inPropertyEventHandler - Designate the pointer to the callback
    //                      function for receiving property-related camera events.
    //              inContext - Designate application information to be passed by
    //                      means of the callback function. Any data needed for
    //                      your application can be passed.
    //      Out:    None
    //  Returns:    Any of the sdk errors.
    A separate header file called SDKTypes.h contains the following data:
    typedef  SdkUInt32  SdkPropertyEvent;
    typedef  SdkUInt32  SdkPropertyID;
    typedef  void       SdkVoid;
    typedef  struct __SdkObject*    SdkBaseRef;
    typedef  SdkBaseRef    SdkCameraRef;
     SdkPropertyEventHandler
    typedef SdkError ( SDKCALLBACK *SdkPropertyEventHandler )(
                        SdkPropertyEvent        inEvent,
                        SdkPropertyID           inPropertyID,
                        SdkUInt32               inParam,
                        SdkVoid *               inContext );
    Thanks for your help.
    Alejandro
    Solved!
    Go to Solution.

    alejandroandreatta wrote:
    I am trying to call a fuction from a SDK.dll library using the Call Library Function Node. The SDK was provided to
    me and I do not have the source code, just the .dll and .h files.
    The SdkSetPropertyEventHandler function has a callback fuction as one of its parameters. How do I implement the
    callback using the CLF node? I am a good LabView programmer but this is my first time using the Call Library
    Function Node. I have read all the info I can find on NI's web site and the discussion board but cannot figure
    this one out. I am using LabView 8.6.
    Basically you do not do that. LabVIEW does not know pointers and certainly not function pointers. What you should do instead is writing a C DLL that implements the callback and also exports a function to be called by LabVIEW that translates between the callback and a LabVIEW user event. Look for PostLVUserEvent() here on the NI site to find examples how to do that.
    Rolf Kalbermatter
    Message Edited by rolfk on 02-11-2009 08:00 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Version 1.1.1 of LabHSM Toolkit for Complex Event-Driven Development in LabVIEW – Small Corrections and Huge Changes in Licensing.

    A new version of the unique toolkit is now available for download. As announced earlier, LabHSM makes it possible to easily create and then maintain complex event-driven applications in LabVIEW as a collection of HSM-driven active object VIs using a higher level of abstraction and agile software development methodologies. These active object VIs are created based on a universal Hierarchical State Machine ( HSM or statechart ) template. Therefore, all your code looks similar regardless of its functionality!
    So, what’s new in version 1.1.1?
    The code (made in LabVIEW 7.0 for Windows) now comes complete with block diagrams (password protected).
    Simpler debugging code in the full template.
    Extra menu items in the editor to open VIs as well as HSM files - nice to have when the LabHSM editor is the only VI open.
    Copying of default actions is now implemented correctly.
    No more run-time licenses! Just buy a developer's license once and distribute as many applications as you like!
    The "Demo_" prefix is no longer required for VIs created in the trial version.
    No more nag messages while running your HSMs!
    As before, the LabHSM toolkit is available for UNLIMITED PERIOD trial. Please visit http://www.labhsm.com for details and download. The site also contains references which you may want to check to learn more about hierarchical state machines and active object computing.
    Stanislav Rumega
    NI Certified LabVIEW Architect
    H View Labs

    Symtx is currently hiring the following position. Please contact me if interested.
    Amy Cable
    Symtx, HR
    [email protected]
    Symtx, the leading supplier of functional test equipment, hires the brightest & most talented engineering professionals to design & manufacture complex custom electronic systems for advanced technology leaders in the defense, aerospace, communications, medical, transportation & semiconductor industries. Symtx’ challenging & dynamic work environment seeks to fill openings with highly qualified electronic engineering design professionals.The ideal candidate will be responsible for defining the requirements, software design and code development, and integration of test control software for custom functional test systems. Candidate should be familiar with data acquisition concepts, instrument control, complex test, measurement and calibration algorithm development and definition and implementation of control interfaces to hardware. Prefer familiarity with instrument control via GPIB, VXI, MXI, RS-232 desirable. Requires BS/MSEE and 3 -7+ yrs of experience in one or several of the following test applications in a Windows NT/2000/XP environment using Labwindows CVI, TestStand, Labview, Visual Basic, C++ and knowledge of RF systems is a plus. Job responsibilities will include software design, development, integration, team leadership, and interfacing with customers( includes PDR’s & CDR’s).

  • Event Callback from a Reentrant VI Recursion Error

    Greetings,
    I am using Register Event Callback with an ActiveX object to respond to user mouse events. The problem is that when I run the VI (the main, calling vi) as reentrant, Labview gives an error that the "Callback.vi" is attempting to recursively call "Main.vi".
    Is there a way around this problem? I intend to run two copies of "Main.vi", so reentrant execution seems necessary.
    - Colin Holbrook

    Hi Colin,
    Are you placing the Register Event Callback inside of the Main VI and then wiring the same Main VI to the VI Reference terminal?  If so, then that explains why you are getting an error.  You cannot use the Register Event Callback to call a VI within itself.  If this is not the case, then please post a simple VI that demonstrates the problem. 

  • Recursive ActiveX register event callback VI

    Hi!
    I am trying to control a motor in LV2013 using the ActiveX concept. When I use a "register event callback VI" function, can I call the same VI that calls a VI (with the "stop rule" controlled be the user data terminal, of course, inside)? By default, callback Vis that one can create for this are all reentrant (preallocated clone) and synchronious (according to help). However, both when I use the "server VI reference" ("This VI") and when I create a reference and browse for the same file - "register event callback" shows me a broken wire.

    _Basil_ wrote:
    As far as I understood, putting a  movement method in the loop will not give any result, so I tought in the direction of the recursive callback. However, I found this post. Would you in general agree that the callback VI cannot be recursive? I attach my code in LV13 (if you need me to convert, I will)
    Sorry, I'm still on LabVIEW 2012 here, so can't look at your VIs. I don't understand your comments in these sentences though. What do you mean by putting a movement method in a loop will not give any result? And why would you ever want a recursive callback? The callback is called each time the event occurs. There's no sense in making it recursive, nor would you want to re-register for a callback on an event inside a callback VI. Normally a callback should contain very little logic; it should primarily pass some piece of information (through a queue, user event, etc) back to the main thread and let the main logic handle it.

Maybe you are looking for

  • Applet not refreshing in internet explorer 7

    Hi there, I have an application that works fine in IE6 but does not work under IE7. The applet reads a text file every minute, this text file is refreshed also every minute. I have found out that if you press x in the Java console to clear the classl

  • Function modules for Classifications

    Hi Sapall. here iam have got some abap technical work to do on classifications. before creating new tasks i just looked at some of the  existing programs in Material management and classification. i have observed  that  most of the programs are using

  • Preserve the sorting of a hierarchy during import to MDM

    Hi experts I have imported a hierarchy from a legacy publishing system The file is XML and itu2019s close to perfect except for one very important thing The hierarch is sorted manually in the legacy system and not by any number or letters This sortin

  • Newbe again, how to save an edit

    This is probably basic. Looked briefly through the past discussions, but did not find the answer. I did manage to pull some Iphoto files to an album on my Mac desktop and import them to PSE. I can do the simple edite, but when I'm done the photo has

  • Do I need 1 or 2 licenses?

    I have a Mac Pro 8 core, 2GB RAM, Mac OS X 10.5.6 on which I use Adobe CS Premium 1.0. I will upgrade in the near future to CS 4 Design Premium. I'm also thinking about purchasing a MacBook Pro primarily for use as I travel. On the MacBook Pro, I int