NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling events/delegates within TestStand

Has anyone got any experience of handling delegates or events within  from a C# assembly? My application issues an event to inform that a time consuming operation has completed its running. I would like TestStand to handle the event directly and trigger some operation when the event is seen rather than having to write a C# wrapper application to handle the event when it occurs.
 
I am interested in knowing the following, if indeed they are possible:
1) how to setup my TestStand sequence to register for reception of an event
2) how to trigger a step asynchronously when the event is seen
 
Thanks in advance.
Ben
0 Kudos
Message 1 of 5
(3,651 Views)
Hi Ben,

Hope you are doing well today! What kind of event is it? ActiveX or some other?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 5
(3,635 Views)

Hi Adnan,

Im very well, thanks for asking. Its an event which is broadcast from a C# code module, so it is similar to a function pointer in a C++ app. I am not sure how similar this is to an ActiveX event however as c# uses .NET technology rather than COM, and I am not as familiar with COM.

Many thanks,

Ben

 

0 Kudos
Message 3 of 5
(3,613 Views)
There is no mechanism for listening to .NET events in TestStand.  You will need to create a code module to do this, and most likely launch it in a new thread.  Once an event happens, you could have another thread that is listening for incoming items on a Queue execute a specific squence once an event happened.  In your event handling code, you could post items to the queue so that TestStand could execute a sequence whenever the event occured.

There are more possible solutions, so if your needs are different, an alternative might be better.

Allen P.
NI
0 Kudos
Message 4 of 5
(3,607 Views)

Hi Allen,

Thanks for your useful feedback. I thought that this might be the case. I like the sound of the queue idea, so will investigate that further.

Regards,

Ben Lawler

0 Kudos
Message 5 of 5
(3,605 Views)