I am new to test stand and have just finished my first sequence. I have a couple of questions about how to make it better.
My sequence has about 100 steps it executes. One of the steps that occur quite frequently is a pause so that the previous VI output can take affect. At the moment I'm just using a VI with a that takes an integer as an input and pauses for that amount of time. Is there a more elegant way of doing this?
Another VI that I am using logs some data and is run every 6th step or so. The only difference between each run is a path parameter for the log fill to be outputted. I'd like the sequence to be as neat and tidy as possible. Is there any clever way of shorting the number of steps down?
Solved! Go to Solution.
There is a Wait step type in TestStand, it would be better to use it instead of a LabVIEW VI.
Your sequence contains 100 steps, have you considered using subsequences?It would be neater.
What are you loggin?
Thank you for your answers!
Great, I'll use the wait step then.
I'm already using subsequences in some cases. If there are several of the same VI executing, but with different parameters, but mostly I have sequences that go something like this:
Move the servos to some position
Log type A in file 1
Log type B in file 2
Log type A in file 3
Log type A in file 4
log type B in file 5
and so forth.
There are 2 logging VIs, they both take 1 parameter, then there is the pause and move servos VI.
Can you think of any way of making this type of setup neat?
I'm logging data from a gyro.
It's a long story, but I have to log several different files for further processing. It's sort of out of my hands.
But lets say I did only log to one file, woudn't it be pretty much the same? It would be something like this:
Log 5 min
Log 2 min
and so on.
Any cleaver way of making this approach neater?
Thanks again for you time
Basically it seems that you have essentially 3 things that could potentially happen: Move Sensor, Log, Pause.
So why not create a datatype for each thing. For instance your MoveSensor datatype would be a container that looks like this:
Your Log datatype would look like this:
Your Pause would just be a number (PauseTime)
Then you make a container with each datatype in it. And then make an array of those containers.
Now using the flow control step type ForEach you can iterate the array. The pseudo code would look like this:
ForEach element in my array
If CurrentElement.MoveSensor.SensorFlag is true
MoveSensor to CurrentElement.MoveSensor.NewPosition
CurrentElement.MoveSensor.CurrentPosition equals new position
If LogFlag is true
Log to LogPath (maybe loop on this for a certain amount of time)
Wait (CurrentElement.PauseTime) set it to 0 if you don't need to pause
That way you would just simply add elements to the array. You could also write the array out to a property object file (read about those in the help) and depending on the test just read in a different property object file which would fill your array with different values.
Hope this helps some,
This sounds like what I'm looking for, but I'm not quite sure if I compleatly understand it. Is this datatype created in TS or in LV? The way I understand it, I would created a new VI that makes the datatypes and the array that contains them, and use the output of this VI in the for loop?
Never mind I understand now! Great advice, thanks a lot! I had to change your approach a bit, but this is much better!
I have one question though;
I'm using a case structure inside my ForEach loop. My array has a string variable that can be "Initial Log", "Sequence Log", "Pause" and so forth. If the string is "Sequence Log" I would like to run one of the 13 sequences I have created. I have another variable that specifies which one, going from 1 to 13. My question is; how can I use this variable to run the corresponding sequence without creating a nested case structure with one case of each of the 13 sequences?
I think your question was answered in the other thread. However, instead of having a number as a part of your datatype make it a string and the string would sequence name to which it would call. Then just do the Specify By Expression and put that variable in there.