NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I return a Boolean array from LabView to TestStand?

I am trying to return a Boolean array from Labview to TestStand and have TS evaluate the results. I can do this for arrays of integers or reals but booleans do not work. I tried copying the PassFailTest step type and adding an array of Bool but I couldn't get it to evaluate the array. It simply always passed. How can this be done?
 
Bob A.
0 Kudos
Message 1 of 6
(4,467 Views)
One way to evaluate a Boolean array is to write the array to a TestStand variable and use the 'None' adapter pass/fail step to evaluate each element in the array. I'm assuming that when you evaluate the numeric array, you are using the multiple numeric step type so if you wanted to create your own custom step type, that is the type to base your new step on. Of course, that would involve quite a bit of work to create something that would also evaluate the boolean array and also do the logging and reporting.
0 Kudos
Message 2 of 6
(4,455 Views)
I have thought about evaluating the Boolean data in TestStand but, as you say, this is a lot of work. What I have been doing is to map the boolean data to integers in LV (very easy) and then use the multiple numeric step type to evaluate the integer array automatically. This feels kludgy and I have tried a couple of times to create a "multiple boolean" step type with little success. I'm surprised TS hasn't anticipated a test returning multiple pass/fail results. I do this all the time for production code.
 
What I have tried is to copy MultipleNumericLimitsTest data type to a custom type and add a BooleanArray with a data type Array of Boolean[0..empty]. Then when I specify module, I select Step.BooleanArray as the value. The last step (that I know of) is to select Step.BooleanArray as the data source in the edit limits window. At this point if I run the test, I get the error "expect numeric, found boolean" (or something similar). When I look at the properties of my custom step type, the Substeps has DoMultiNumericMeasEvaluation as the Post-Step. I believe this is the root of my problem but I can't figure out how to change this to "DoMultiBooleanMeasEvaluation" or similar. Any Ideas?
0 Kudos
Message 3 of 6
(4,438 Views)
As there doesn't exist a DoMultipleBooleanArrayMeasEvaluation, this is something that you would have to write yourself. You could modify the CommonSubsteps.dll. The source code is provided (C++) or you could write a VI to do it. You would edit the custom step and use the new post-step. As I mentioned, you would also have to modify the reporting and logging functions as neither of these are able to handle a Boolean array. I simply use a None adapter and a for loop with the iteration set to GetNumElements(Locals.BooleanArray).
0 Kudos
Message 4 of 6
(4,434 Views)
Depending on the size of your array, you could convert the boolean array into one integer in labview and evaluate the whole array with a single numeric limit test.  You can change the numeric format to binary to see what each array element was.
0 Kudos
Message 5 of 6
(4,413 Views)
I thought about the binary approach but that would require more work in TS than I need to do for the MultiNumeric approach (yes, I'm lazy!). I would rather have all my TS evaluation functions the same. This lets me standardize on one format and simplifies the code for the product engineers when they maintain the production code.
0 Kudos
Message 6 of 6
(4,397 Views)