NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove programatically a substep

Solved!
Go to solution

Hello,

 

I'm trying to customize a Type.ini file in TestStand (4.0) with LabVIEW (8.5). I'd like adding/removing a substep to each created step type.

 

The method 'AddSubStep' is OK, my type.ini is updated.

 

But, before creating a new substep, i'd like removing all previous but an error is generated:

 

"Error -17331 occurred at Item is locked, protected, or in use and cannot be deleted."

 

I don't find a solution to remove the protection. Why can i add a new substep and can't remove it after?

 

thank you for your responses

 

 

 

 

0 Kudos
Message 1 of 5
(3,794 Views)
0 Kudos
Message 2 of 5
(3,771 Views)

What API are you using to remove the substeps?

 

-Doug

0 Kudos
Message 3 of 5
(3,742 Views)

YR42,

 

There appears to be an issue with the RemoveSubstep() method of the API. As a workaround you can use the following expression or equivalent API calls instead:

 

Locals.StepTypeReference.AsPropertyObject.GetPropertyObject("Substeps", 0).DeleteElements(0, 1, PropOption_OverrideNotDeletable)

 

We will look into this issue with the StepType.RemoveSubstep() method. Thank you for bringing this to our attention. Also, you might still want to read the document Aurelien posted a link to if you haven't already as it might contain information that is helpful to you.

 

Hope this helps,

-Doug

Message 4 of 5
(3,734 Views)
Solution
Accepted by topic author YR42

Hello,

 

Yes doug your workaround works fine.

YR42  in attachment you can find an example with 2 methods.
1) The expression
2) Active-X steps   (this will be helpfull using Labview).

Regards,

Message Edité par Nacer_M le 06-22-2009 07:53 AM

Nacer M. | Certified LabVIEW Architecte

0 Kudos
Message 5 of 5
(3,706 Views)