NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Easy way of getting the step parameters?

Another one from the awkward question department...
 
I have a requirement to modify the result reporting so that the parameters that are passed to each step are recorded Smiley Sad .  The steps could be LabVIEW steps, sequence calls, anything in fact.
 
I can almost do this, but the mechanism I have so far is pretty awful.  I go along the following chain:
 
Step.Module
Module.AsPropertyObject
LabVIEWModule.Parameters
LabVIEWParameters.Count
(for loop iterating through Count)
   LabVIEWParameters.Item
(end of for loop)
 
The step into the LabVIEW module is for a LabVIEW step.  There is a need to have a switch at this point, dependent upon the adapter used.  This only gets me to an Object Reference relating to the parameter.  From this, I can get its name but I can't get its value directly.  I think several more steps are required, especially if there are clusters, arrays or whatever else.
 
Am I barking up the wrong tree?  Is there an easier way of getting a summary of a step's parameters, e.g. as a string, regardless of the particular adapter, instead of having to do all this?  Glorious adoration and ratings await whoever can tell me the thing I've missed!
0 Kudos
Message 1 of 11
(3,220 Views)

Hi Sean,

As far as I can see (and I have a full wall chart of all of the variables and parameters accessable) you are as close as you can get.

If you could fire over the sequence file you have managed to get to so far I'll see what I can do? (I feel like some nicce feedback so I'm going to earn it with this one Smiley Very Happy )

I'm going to look into this a bit more bit it's not a trivial thing to do.

Sorry

AdamB

 

Message Edited by AdamB on 12-05-2006 10:19 AM

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 2 of 11
(3,194 Views)

Thanks for being the brave volunteer!

I'll post my sequence tomorrow, after I've stripped out all the other guff.

If it's going to take a heap of nested loops and recursive calls to dive into the arrays and clusters then I think we'll make a decision to abandon this idea, as it would take some monster code that will slow the test system down to a crawl.

But if you can find a better way then that's great.  If you can't then please put this in the TestStand 4 suggestion heap.

 

0 Kudos
Message 3 of 11
(3,190 Views)
Hi Sean,

I think the easiest way to achieve what you want is to approach it from the other end. Going through the TestStand API will require a lot of work to get the information you want. If you don't have too many code modules to modify, you could just add an extra output to them which is a string containing all the input/outputs and their values. I know this would require changing your code modules but conceptually it is probably the easiest to implement. Alternitively for just the LabVIEW steps you could use VI server to determine the values of the controls and indicators on the code module just after it has been executed. You could implement this in either a poststep sub-step or a Post Step callback. You would have to make sure that the VI's are only unloaded when the execution finishes so their values are still retained in memory.

Regards

Jon B
Applications Engineer
NI UK & Ireland
0 Kudos
Message 4 of 11
(3,160 Views)
Thanks for the suggestion.  You're right, it could be easier to go via LabVIEW instead.  It would have to be via the VI Server, as the code in the steps belongs to others.  It's still a horrific task though.  What I'd like to end up with is something like this for an array:
 
MyArray[0] (String) = Banana
MyArray[1] (String) = Apple
MyArray[2] (String) = Orange
 
...and something like this for a cluster:
 
MyCluster.MyNumber (Number) = 3
MyCluster.MyString (String) = Grapefruit
MyCluster.MyBoolean (Boolean) = True
 
And an element of an array of clusters of arrays would be:
 
OuterArray[0].InnerArray[0] (Number) = 5
 
This is going to be fun, either via the TestStand API or the LabVIEW VI Server.  Unless anyone has a eureka moment and tells me the easy way, we'll have to think about whether to do this at all.
 
Is there any chance that parameter recording may be added to a future version of TestStand?  It would be very beneficial to anyone reading the results, particularly when things go wrong.

Message Edited by Sean on 12-08-2006 11:26 AM

0 Kudos
Message 5 of 11
(3,157 Views)
Hi Sean,

Hope you had a good Christmas. You can submit product suggestions via the link bellow. These are a valuable tool in determining feature set of future versions of our software products.

http://digital.ni.com/applications/psc.nsf/default?openform

Regards

Jon B
Applications Engineer
NI UK & Ireland
0 Kudos
Message 6 of 11
(3,080 Views)
In TestStand 1 & 2 we used LabVIEW to read all the container labels and values for vis called from TestStand.  These were then transferred to "Inputs" or "Parameters".  This was not simple.  There was no other way in TS 1 ro TS 2 to load complicated container information.  However, TS3 and higher gather this information in the "Specify Module" process.  So, we no longer use our LabVIEW code for this purpose.  I would like a NI representative to help locate this code and comment on how it can be used outside of the "Specify Module" process.  I would like to augment the <Tools> <Sequence File Documentation..> capability.
 
 
0 Kudos
Message 7 of 11
(3,072 Views)
Hi Paul,

I think this is a built in part of the TestStand API, it can be invoked from a Step method but I don't think we can supply source code of the dialog box itself.

Regards

Jon B
Applications Engineer
NI UK & Ireland
0 Kudos
Message 8 of 11
(3,024 Views)

I know this post is quite old, but I'll post what I found in case someone else has the same issue.

 

Module stepModule = myStep.Module;
PropertyObject[] stepParameters =      stepModule.AsPropertyObject().GetSubProperties("ActualArgs", 0);

 

Caveat: This is where I found the parameters for a Sequence Call.  I cannot vouch for other step types.

 

I sure wish NI would get rid of the COM-based API and move to something more modern.  COM-based doesn't allow searching through objects in real-time, which would make issues like this ("where can I get XYZ?") much simpler to resolve by searching through objects in the debugger.

0 Kudos
Message 9 of 11
(1,274 Views)

Hi Dave,

 

could you please share some images about your solution? Your solution might exactly what I am looking for. But with your description I can still not found the solution.

 

I went through like following :

 

ThisContext ---> PN Step--->PN Module ---> IN AsPropertyOberject ---> ...... can't find any related.

 

PN: Property Node

IN: Invoke Node

 

Thank you in advance.

 

Melo

0 Kudos
Message 10 of 11
(968 Views)