08-25-2008 05:45 PM - edited 08-25-2008 05:47 PM
Hi, all,
I have a main test sequence that will have subsequences added to it by other developers.I'd like to develop a way for testers to select the number of iterations of each subsequence, without going through one popup per subsequence. (A single window where all iteration counts could be set at the same time would be best.)
Furthermore, I'd like to not have to force test developers to code in anything other than TestStand (e.g., LabVIEW, ActiveX, or Intercal) when they add subsequences.
The application integration is being done in LabVIEW.
Is there a way to do this? It sounds like the sort of thing that will, er, pop up now and then.
Thanks,
- Steve.
08-26-2008 04:45 PM
Hey Steve,
So basically your popup has to be dynamic in that it will go out and search the main sequence to determine how many subsequences it is calling? Then once it figures out how many subsequences are being called dynamically it will have to populate a list of them along with a box for each subsequence that will allow the operator to insert the number of iterations? Am I understanding you correctly? All this being done of course before any steps in the main sequence execute?
You would be best off to build a VI and put it in a callback that gets called before the Main Sequence does. In the VI (we'll call it Popup) you would use ActiveX to iterate through the sequence and find all the subsequence calls. Then populate the popup with the list of sequences and boxes for the iteration count. The problem here with LabVIEW is that you cannot dynamically create controls. Therefore you would have to have a presized array and hide and show only the elements that you need. Then once the operator fills in the info then take it and use the step loop properties to populate the sequence calls with the correct looping info. If you have questions on how to do that let me know.
Let me know if you have any questions or concerns as well.
08-26-2008 04:56 PM
Hello SPM,
Thank you for posting on the NI Discussion Forums. I take it you have already implemented a looping series of subsequences, and are currently passing the number of iterations through several separate Message Popups. If you wish to have one Message Popup to take in several different inputs (one for each loop iteration count) then you will have to (a) create a custom step type or (b) create a code module to perform the task. If you do not wish to do this, then you could try entering all of the iteration counts in one Response Text Box on the Message Popup, separated by some kind of delimiter (comma perhaps?), and then parse the return string and store the iteration counts that way. Unfortunately there is no built-in solution to what you are trying to do, unless I am missing something.
With regards to code modules for your steps, you do not necessarily have to force development in any particular language. Although modularity is preferable when creating a test sequence, you can select to have language adapter for a step by selecting the Adapter pull-down menu from the toolbar, and then selecting <None> for the adapter. Then when you place a step down, if it uses an adapter, it will not prompt you to load any external code modules for the step.
08-27-2008 10:06 AM
Threw together a simple example of what I was talking about. It only works for the Main Step group in the MainSequence. In the PreUUTLoop callback is when I call the SetSubIters.vi which allows you to set loop iterations for each subsequence call. Just save them both in the same directory and execute the SetSubSeqLoopIterDynamically.seq with TestUUTs.
By the way my coding in LV isn't that great so just ignore the poor coding.
Hope this sheds a little more light on it.
08-27-2008 04:35 PM
Wow, jiggawax, this is WAY more than I was looking for! I would have been happy with just a way to set the iteration counts from a LV pane!
(Now if there was only a way to limit the number of entries in the loop count control...)
Thanks!
- Steve.
08-27-2008 04:41 PM
SPM,
If you use the code that Jiggawax provided, make sure to close all of the references (teal wires) that are created. Especially all the step references in the loop. If you don't, then when you close TestStand, you will get a dialog that there are unreleased property objects.
08-27-2008 05:14 PM - edited 08-27-2008 05:15 PM
Heh, yeah, like I said that code is just a rough idea of what you may or may not want to do. You will definitely have to clean it up.
You mean something like the VI attached. I made the arrays dynamically change to only show the number of rows necessary.
I also added the reference closes to make Josh happy. And your memory.
08-28-2008 07:58 AM
Sorry to be nitpicky.
Make sure to close your step references in the false case of your for loop. That way if they don't get added to the array for later use, you're also closing the reference.
Prevent Memory Leaks. Campain '08 to make memory happy!
-Josh
08-28-2008 12:46 PM - edited 08-28-2008 12:48 PM
Second question: Is there any way to make the subsequence names and the iteration counts scroll together?
I've looked at listboxes, multicolumn listboxes, and tables, and nothing seems to be quite right for the purpose.
Thanks,
- Steve.
08-28-2008 01:07 PM
Yeah you can cluster a string and a numeric together and put them in an array. Probably the best way to do it because then you truly have them paired together. OR....
You can look at my funny hack here.
I even fixed the Ref closes that Josh pointed out... AGAIN! ha ha Josh is such a good PSE.
You have to remember Steve- The only reason I'm coding this is because I thought it was a very interesting project and because I see the usefulness of something similar and I wanted to learn. Good luck on ya and let me know if you have any more questions or concerns.