NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Notification.SetEx

Hi all, I want to send a notification from my C# assembly to TestStand. The API Reference offers this function: Notification.SetEx ( sequenceContextObj, dataPropObj, byRef, autoClear) I don't know how to call this API function from C#. I assume, I need to create an object in order to call SetEx ?!? Has somebody an short example? Many Thanks, Thorsten
0 Kudos
Message 1 of 4
(3,589 Views)

Hi Thorsten!

 

Notification is not available inside the API (that is: is not an API class).

 

Maybe you should provide more information about your application. Do you really want to synchronize running threads/executions from within an assembly?

 

Ciao

 weltaran

 

0 Kudos
Message 2 of 4
(3,580 Views)

I'm having a server application which controls the connected clients (starts testing, performs necessary switching, displaying the status in on central point)

 

The clients are sending short text messages to visualize in the status.

This messages are send currently directly from TestStand using the Notification.Set methode (Synchronization->Notification).

It works fine, but I want to move this implementation now to C#.

 

 

0 Kudos
Message 3 of 4
(3,571 Views)

You can get the notification into your C# code a couple of ways.

 

1) Create it using notification steps, storing it in an object reference variable, then pass that object reference into your C# code module as a parameter

 

OR

 

2) You can get it by name as follows (or something similar, I didn't actually compile this so there might be some typos):

 

SyncManager mySyncManager = seqcontext.Engine.GetSyncManager(myNotificationName) as SyncManager;

mySyncManager->GetNotification(myNotificationName);

 

You need to add a reference to the TestStand Synchronization Manager from the add reference dialog, under the COM tab in visual studio as well in order to get the synchronization API (Visual Studio will create an interop assembly for you).

 

Hope this helps,

-Doug

0 Kudos
Message 4 of 4
(3,555 Views)