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: 

Multiple String Value Test

Hi,
I have a unit under test which dumps data from RS232 when powered on. How
can I use teststand to look for certain keywords from the data dump? The
keywords are spread all over the place. They are not next to each other.
Thanks,
Rahim


0 Kudos
Message 1 of 4
(5,186 Views)
Simba,

You would need to make a custom step type much like a multiple numeric limit test, mixed with a string test. Unfortunately, you would also need to create your own edit box as well. Check out the following link: How Do I Make a Custom Step Type?

Brandon Vasquez | Software Engineer | Integration Services | National Instruments
0 Kudos
Message 2 of 4
(5,171 Views)

Rahim

I have not had any luck doing that by TestStand alone.

But have had to write code that I pass in an array of regular expression of 'GOOD' strings and an array of 'BAD' strings to look for. The code looks for the expressions in order or all at once per a switch setting and returns an array of matches. The step 'Passes' if ALL 'GOOD' strings are found and no 'BAD' strings are found. I used a state machine for this.

This was used on a product boot up. The boot up messages were not all the same as different options could be added to the unit that would change the boot up messages. I also found that I had to monitor the boot up while it was running to deside if there were problems when they happened and not wait until the step returned to TestStand.

Jim D.

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

While this is probably best done in a code module, a quick and dirty option would be to use the Find expression function.

For example, you could call your code module with a Pass/Fail step and return the string of interest to a local variable. Then, you could set your Pass/Fail source for the step to an expression such as:

(

Find(Locals.rs232String, "expectedString1")) > -1 && (Find(Locals.rs232String, "expectedString2") > -1)

0 Kudos
Message 4 of 4
(5,161 Views)