NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass parameters to teststand using LV



@Jhoskins wrote:

Paul please send me that code if you would please. this souns very interesting.


Joe,

Here is the OI I developed for a two socket parallel execution.  I must admit that the wiring doesn't look as clean as I had hoped.  Also, when I opened it up here all of the teststand controls didn't load.  I believe it is because it was made with TS 3.5 (and LV 8.2), I have TS 3.0 here.  If the TS activeX controls don't load for you at least you can see the what I did in the block diagram.  Also, it is based off the simple OI shipped from NI.

In reviewing the code I remembered that I also put in place some code that would allow a sequence be able to determine what OI was executing the sequence.  Basically it was just another UI message that set a local.  The sequence would disable or enable the default process modal dialog based on the returned number.  OI's that I didn't modify wouldn't set the number so I knew the sequence was being executed from either the sequence editor or one of the other shipped OI's.  The reason I added this was because the OI handling the continue testing boolean and would go into an annoying loop that was not easy to stop.

Also, one of the custom ring controls was delated and replace with a default picture ring to remove proprietary content but it shouldn't affect much.  I was just a status indicator.

I will also look into an example sequence...  I haven't tried to open the ones that I saved...

I am sure you can take this a lot further than I did with cleaner results.  I remember thinking one time of just spending more time creating a more flexible, scalable to the number of sockets, version but I left the job just after this was "working" and didn't get to improve on it.

Paul

P.S. I also had a tab control that hid the activeX controls that the manager requested not to see during production.  It was visible to the correct login permissions of TS.

Message 11 of 21
(3,246 Views)

FYI

It looks like I passed the testsocket index into the numeric data of the UI message.  I think I did this so I wouldn't have to retrieve it from the sequence context in the OI.

0 Kudos
Message 12 of 21
(3,241 Views)


@paulmw wrote:

I will also look into an example sequence...  I haven't tried to open the ones that I saved...


It looks like I can not open the sequence files with TS 3.0.  I would like to post them but I won't because I am not sure what info they may contain that I shouldn't share.
0 Kudos
Message 13 of 21
(3,236 Views)

Thanks Paul,

I will wade through all of this when I get back to working on my code. Right now I have to finish this board layout so that it can go out the door today.

Again thanks for the help




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 14 of 21
(3,234 Views)

I have another question. In the sequence editor.

automation server =  NI Teststand API 4.0

object reference = RunState.Thread

Object class - Thread

Call method        PostUIMessage.

 

What do I need to put in the parameters for the values if I want to be able to pass data that is an array of booleans and I also need to pass an array of clusters. How do you set that up.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 15 of 21
(3,213 Views)
Hey Joe,

I believe what you're referring to are the parameters for stringDataParam, numericDataParam, and activeXDataParam.  You do not need to put actual data in these parameters.  You can, for instance, pass "", 0, and Nothing, respectively ("Nothing" being a keyword).  What I sometimes do is use the stringDataParam to specify the lookup string of the variable that will be accessed from the UIMessage handler; for instance, in your case, I would pass in the lookup string of the array of containers (like "Locals.array").  This way the variable name can easily be modified from within the sequence without needing to modify the UI code.
Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 16 of 21
(3,206 Views)

Hi Paul

 

I'm new to TestStand and need to build a system similar to this situation.  Your example OI is really helpful at this case.

 

For what you mentioned, I'd like to go deeper at some points.

 

       1. You mentioned you could use a UImessage and a local variable to deteremine when a sequence is finished, could someone

           explain the detail?

           I use "EndExecution" callback, but this event only happens when a user stops testing.  What I need is the UI knowing when

           an UUT finishing its test so that the UI can scan the serial number for next UUT.  At this case, "Endexecution" is not the event

           I want but I don't know which one is necessary.

 

       2. Do you have some example sequence for your UI?

           I guess I know the importance of using notification to tell the UI when to send UUT info, but I am still confused with where and

           how to set notification step at my sequence file.

           If I understand you correctly, I need

                                                         a. create a notification

                                                         b. use UImessage to get serial number and parameter.continue from UI (Here I don't know the way you

 

 

0 Kudos
Message 17 of 21
(2,836 Views)

Hi Paul

 

I'm new to TestStand and need to build a system similar to this situation.  Your example OI is really helpful at this case.

 

For what you mentioned, I'd like to go deeper at some points.

 

       1. You mentioned you could use a UImessage and a local variable to deteremine when a sequence is finished, could someone

           explain the detail?

           I use "EndExecution" callback, but this event only happens when a user stops testing.  What I need is the UI knowing when

           an UUT finishing its test so that the UI can scan the serial number for next UUT.  At this case, "Endexecution" is not the event

           I want but I don't know which one is necessary.

 

       2. Do you have some example sequence for your UI?

           I guess I know the importance of using notification to tell the UI when to send UUT info, but I am still confused with where and

           how to set notification step at my sequence file.

           If I understand you correctly, I need

                                                         a. create a notification step

                                                         b. use UImessage to get serial number and parameter.continue from UI (Here I don't know the way you

                                                                                                                                                                               register the event at the UI)

                                                         c. wait for the step

           But I'm not sure at which callback I should set this and the notification configuration (at PreUUT or PreUUTloop?)

           If there is an sequence file example, it must be useful for me.

 

Best regards,

 

Kirika

0 Kudos
Message 18 of 21
(2,836 Views)

Hey Kirika,

 

The best way to get the serial number from the user interface is actually to post a UI Message from your process model and handle that event from your user interface.  What you are trying to do is use another existing event to signal that you're ready for the next serial number, but that really is not the best way to implement this.  If you look at the default process models, there's a place where the serial number is requested via a message popup (in the Pre-UUT callback).  You can replace this step with an ActiveX step that calls Thread.PostUIMessage with a specific user code (like 10001) that signals "I need the serial number now".  Make sure and post it as syncronous.  This is another advantage of you posting a specific message; your sequence will wait until your user interface handles the event before proceeding.

 

In the example below, a sequence shows how to post a UI Message from TestStand.

 

http://zone.ni.com/devzone/cda/epd/p/id/3879

 

Hope this helps!

Thanks,

Andy McRorie
NI R&D
0 Kudos
Message 19 of 21
(2,810 Views)

Hi everyone!

Just wanted to let you know that you literally saved my life with the info contained in this forum thread. Big thanks to "paulmw" for posting the example for a dual-socket OI. Based on that I figured out how to forward the UIMessage Event and all its data, passed from the sequence execution, to the event catcher structure in the main OI VI - this is a big lifesaver, as I have to update/enable/disable&grey-out a LOT of indicators. Now that all UIMessage events are handled the the main OI VI, this task became A LOT easier!

 

Regards,

Paul HARFAS

0 Kudos
Message 20 of 21
(2,358 Views)