NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

station global run time

Hi, hope someone can give me some advice on this one.

I have 2 seperate 1D string arrays returning to Station Globals in Teststand 4.0 from seperate LAbview VIs.
The first array contains the names of LIN signals (which all stay the same for the length of test)
The second array contains the current state of the LIN signals ( which can change as the DUT activates its functionality )

For example, position 2 of the first array contains the string "TrunkLidState".
And position 2 of the second array can change between the following, "open", "close"

What I need to do is test for a status of any of the signals in such a way that I can say  :
   
    if Trunklidstate = "open" then Pass
        else
    if Trunklidstate = "closed" then Fail

rather than going :

    if Stationglobals.LIN_Array[1]= "open" then Pass
       else
    if Stationglobals.LIN_Array[1]= "closed" then Failed
 
because "Trunklidstate" may not always be in the second element of the array.


Thanks



0 Kudos
Message 1 of 4
(3,288 Views)
Hey Mike,
 
The problem here is that you don't know where in the array "TrunkLidState" will reside.  Therefore you will have to search the array for that index.  Then use that index to index the other array. 
 
Option 1- Have a 3rd VI that takes in 4 parameters: LIN State, LIN Names, State, Condition.  State = "TrunkLidState", Condition="open".  Inside the VI use the Search 1D Array function to get the index of State.  Then use the Index Array function to get the status (either open or closed).  Then compare that with the Condition.  If it equals the condition then return True if not then return False.  This could be a Pass/Fail Step type.  I have attached the VI for you. 
 
Option 2- Make the first array static so that you always know "TrunkLidState" will be in the same position.
 
I'm sure there are other options but these two came off the top of my head.
 
Let me know if you have any questions about this.  or if I'm missing the point completely.  I do that sometimes.
 
Later,
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(3,270 Views)
Hi Jigg,

Thanks for the advice.
Going the Labview route is what I figured I would have to do.
I was hoping there was some better array manipulation functions within TestStand so that I could just search for a string within an array and use that index to search the other array.

Thanks again !
0 Kudos
Message 3 of 4
(3,251 Views)
That would be a great function.
 
They would have to make it polymorphic for all the different datatypes.  Maybe you should suggest it: http://digital.ni.com/applications/psc.nsf/default?OpenForm
 
I think LabVIEW will be your best bet since you are already using it.  Technically you could get away with only using TestStand but then you would have to use the conditional steps and do some sort of algorithm to find that index.  If you do want to only use TS let me know and I'll throw together a subsequence.  It is not recommended though because it will not be as efficient as your LV step.
 
Regards,
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 4
(3,247 Views)