NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate sequence steps programatically

I have a list of command strings and expected responses from UUT. With this list I want to create a sequnce file programatically such that each step will send a command and receive a string response from UUT and comapare to the expected value. I think the sequence can be created programatically before I call the sequence from my model sequnce. I know there is a way but I just can't find a good how-to instruction or an example code.
0 Kudos
Message 1 of 6
(3,740 Views)
Hi,

TestStand is a sequence editor and test executive. As it is shipped, it doesn't "know" how to send your strings to or how to read from ECU. For that, some device drivers must be called from the steps, as in the test system there is such device capable of sending/receiving commands to ECU.
Thus, an approach is to create/use the drivers in TestStand "Custom Steps" which are calling code modules which are using device drivers to exchange data with the ECU.
These "Custom Steps" must define a "place" at TestStand level to read/write the ECU commands/responses. Since you have to compare to expected values, the "Custom Steps" may be derived out of the "Tests" built-in NI step types.

For an example on how to create your own code modules and step types, consult the "TestStand API Reference", "TestStand User Manual", the examples shipped with TestStand located in the "TestStand\Components\NI\StepTypes" and "TestStand\Examples\StepTypes" folders on your harddrive.

Regards,
Silvius.
Silvius Iancu
0 Kudos
Message 2 of 6
(3,729 Views)
Silius,

Thank you for your comment. I started my program in a different approach. The list of commands are an array parameter in my program and based on the size of the array, a LV step that send commands and receive responses gets cloned as many as the size of the array. The reponse is always 0 or -1, relatively easy to implement PASS/FAIL criteria. Now I have a working program that can clone step programatically and runs fine. The only problem is that when cloning is done I can't seem to chnage individual step name unique. I programmed such that each step name gets changed to a unique name including command string so that I can see what test is being in processed from my Operator Interface. But, if I change one of them they all follow the last name change. All cloned steps have same step names that doesn't look very intuitive for operators. Do you know if there is a way to change the cloned step names uniquely?
0 Kudos
Message 3 of 6
(3,726 Views)
Hello Silius,

When you clone a step, you should use the step method, "CreateNewUniqueStepID", to change the ID. Merely set the step property, "Name", to change the name to whatever you would like.

Regards,

Aaron B.
National Instruments
0 Kudos
Message 4 of 6
(3,713 Views)
Aaron,

I used the method that assigned computer-generated unique IDs. But, the IDs are not meaningful names. I tried to change steps names again after created unique IDs. The result is the same. All steps names are changed to identical name. Allways the last name change takes over all cloned steps.
0 Kudos
Message 5 of 6
(3,710 Views)
Hi,

Can you post an example of what you are doing?

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 6 of 6
(3,696 Views)