NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I access a Notification from a CVI Dll?

My Main Sequence creates a Notification object and then uses the Dll Flexible Prototype adapter to start a LabWindows GUI running in a separate thread. The Main Sequence then continues to run, and sets the Notification when it’s time to close the GUI.

I'd like to periodically check the status of the Notification from the LabWindows app, but I can't figure out how to access the Notification status programmatically.

I've tried the functions in the TestStand Synchronization Library, but they all need a SyncManager reference that I can’t seam to obtain (the code for this library is not commented or documented, as far as I can tell).

I've also tried passing an ActiveX reference to the Notification object, but it
does not appear to have any PropertyObject subproperties that I can access.

Is there a way to access the Notification status from the Dll?
0 Kudos
Message 1 of 4
(3,821 Views)
I would suggest a slightly different approach.

Main Sequence creates a Notification object and then uses the Dll Flexible Prototype adapter to start a LabWindows GUI running in a separate thread (as you stated).

The Main Sequence then calls a sequence in a new thread and this thread waits for the notification. After the thread receives notification have the sequence set a sequence file global variable to indicate that it is time for the gui to end. The sequence file global variable will need at least three states(Initial Value, Set and Reset).

In the gui setup an idle event callback checking the state of the sequence file global variable once it is set have the gui reset the sequence file global variable. At this point the gui ends. It is important not to
let the main sequence end before the gui ends because this will orphan your child. Thus the main sequence will wait for the sequence file global variable to be reset indicating it is safe for the main sequence end.

Also consider all things that could go wrong.... Because Murphy lurks in multi-threaded test applications.

Steve
0 Kudos
Message 2 of 4
(3,821 Views)
You can use the TestStand Synchronization Manager if you'd like. The Synchronization Manager is what is used by the TestStand Synchronization Manager so the methods and properties are not documented because they aren't meant for external use. However, I can offer some resources to help you.

First, there is an example posted on the Discussion Forum that has the answer to your question using LabVIEW instead of CVI. ActiveX in LabVIEW is pretty simple to understand, so I recommend you take a look at the How to pass sync steps from TestStand to LabVIEW? Example.

As for the reference to the Sync Manager, there is an Engine m
ethod that should give you the reference. The method as found in the TestStand Programmer's Help is Engine.GetSyncManager( syncObjectName). The documentation warns that the synchronization methods are accessible, although they are not meant for end-user use.

If you have other questions, let me know!

Regards,
Shannon R.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 4
(3,821 Views)
Thank you!

The LabVIEW example should have the information I need.
0 Kudos
Message 4 of 4
(3,821 Views)