NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically edit Step.Datasource

Solved!
Go to solution

I'm creating a LabVIEW tool to update several step properties after some needed changes.

 

One of the changes was a step type went from a numeric limit test to a boolean pass/fail. 

 

Since I couldn't have all of the customers sequences (several hundred) loaded when I made the changes, I need the tool to change the Data Source for this step type from "Step.Result.Numeric" to "Step.Result.PassFail". Problem is I can't seem to find the right combination of properties/methods to make it happen.

 

I don't see a 'Step.DataSource' property like there is for the 'StatusExpression' and 'Precondition'. I've tried taking the "AsPropertyObject" ref from the Step ref, then using 'SetValString' method to set "Setp.DataSource" to "Step.Result.PassFail", but this returns a -17306 error that returns "Error accessing item 'Step.DataSource'."

 

Thanks

Ed



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 1 of 6
(4,586 Views)

Ed,

 

I'm surprised this is not working. Could you post a code snippet of where you are trying to set the DataSource, so that we can see what context you are in? We should be able to come up with an expression to allow you to set the data source.

 

Thanks!

0 Kudos
Message 2 of 6
(4,570 Views)

Here's the bit that's causing the issue.

 

Set Step.DataSource.jpg

 

The error is generated in the SetValString method.

 

So is there no "Step.DataSource" property that can be used?



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 3 of 6
(4,558 Views)
Solution
Accepted by topic author EdDickens

Ed,

 

Since you are already in a Step context at this point, with the "Step.AsPropertyObject()" call, try passing just "DataSource" as the lookup string, rather than Step.DataSource. I believe that will access the correct property within the Step container.

0 Kudos
Message 4 of 6
(4,554 Views)

I've made that exact mistake several times on this project. It's always the little things you just overlook.

 

(and people wonder why I don't like text based languages) 

 

Thanks Daniel



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 6
(4,548 Views)

How can I find all lookup strings available to request from? , I want to modify other properties from it

CLA, CTA
0 Kudos
Message 6 of 6
(1,699 Views)