From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Events and event handlers in TestStand

Hello,

 

Is there a way to use events and event handlers in TestStand 2016?

 

What I wish to achieve is:

- I have 3 files: File_1.seq, File_2.seq and File_3.seq

- File_1 has a sequence SetX with a number as input

- I wish to create an event which is triggered as soon as I call SetX in File_1

- In File_2 and File_3, I wish to declare event handlers which run only when the respective event is triggered by File_1. This event handler (to event in File_1.seq) in different files which may then call some sequence in files in which they have been declared

 

The purpose is to avoid direct calling of sequences in File_2 and File_3 from File_1. This way File_1 can remain as it is and in future I just have to add event handlers in respective files as direct calling is avoided.

 

I know this exists in .NET, but due to our architect I want to avoid calling dlls for adding and detaching event handlers.

 

Is there any way to do this in TestStand?

 

Thank you and best regards.

0 Kudos
Message 1 of 5
(3,336 Views)

There is no built-in support for .NET events in TestStand. One thing you might want to consider is using a TestStand queue or notification to send a request from your File_1 execution to another execution that is waiting to handle it. When that other execution gets a request, it can examine the data from it (either sent in a TestStand queue or notification) and call the corresponding sequence that data specifies.

 

That said, I'm not sure exactly why you want to avoid direct calls. It might not be buying you that much. You can specify a sequence call by expression already anyway which would allow you to have a File_1 sequence that takes an argument and effectively calls a different sequence based on that argument anyway without having to change File_1.

 

Hope this helps,

-Doug

Message 2 of 5
(3,255 Views)

Thanks Mr. Doug. I will try queue and notification.

 

You can specify a sequence call by expression already anyway which would allow you to have a File_1 sequence that takes an argument and effectively calls a different sequence based on that argument anyway without having to change File_1

 

This is what I am doing already but it forces me to change existing sequence. I can explain better with following image

EventsOderAufruf.jpg

We have dozens of sequence files in "low layers" (all under versioned tool). The upper (application) layers consume these sequence files by calling them. Sometimes there are important parameters which when changed, they must notify upper files, for which I need events/notifications.

The disadvantage of schema in blue is that if a user has not added File_4 in his project, he/she will receive an error and secondly File_2 has to be checked out and in, which I don't prefer.

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

I'm still not sure I'm completely following what you are doing or trying to do, but here are some things to consider:

 

1) in your example, I'm not sure why adding a new sequence forces you to change File_2. I was suggesting the sequence name is an argument so it shouldn't require any changes to the file that is calling the sequence by expression.

 

2) Sequence calls do not necessarily have to be passing all of the arguments for the called sequence. You can add an argument to File_4.seq without having to update File_1 or File_2 as long as the default value for the parameter is what you want and you aren't changing the order or types of existing parameters. If the default isn't what you want I'm not sure how events would be any better. You'd have to update the invoker of the event to pass new arguments as well.

 

3) Another option might be to programmatically generate your top-level sequence at runtime (from some sort of configuration file or other mechanism) rather than having it pre-created. This would give you more flexibility in making changes to how it's dynamically generated without having to update existing sequence files.

 

Hope this helps,

-Doug

0 Kudos
Message 4 of 5
(3,213 Views)

Hello Doug,

 

It is new (and interesting) for me to know that I can pass sequence name as arguement.

 

Just to simplify my question:

- I do not want a caller sequence (in File_2) to specify sequences (in different files) that it should call.

- As soon as value of a variable is changed (or some sequence is called) in File_2, it shall raise an event alarm which will then be handled by its respective event handlers (in File_3, File_4 and so on) attached to it.

 

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