NI TestStand Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Shawn_S.

Option to toggle on and off update of default values for newly created custom type elements

Status: New

A customer noticed odd behavior when modifying custom data types in TestStand.  After reproducing the behavior, I think it's a better product suggestion because it looks as if what the customer notices is more of a design choice implemented by our software developers than a feature that is not behaving correctly.

 

The customer, David, created a custom type called DavidsType which was composed of a container and within this container was a collection of strings:

 

 

image1.jpg

 

He then created an instance of this type in his DavidTest.seq file under the file global variables.  He called the instance MyType.

 

image2.jpg

 

Then he goes back to the Types pane and modifies the structure of the custom data type to include another string with a default value of "C".

 

image3.jpg

 

However, when he goes back to view the already created instance of his data type (MyType) within the variables pane of DavidTest.seq, he notices that only the structure is updated and not the default value.

 

image4.jpg

 

New instances of the custom data type, however, do show up with the default value as shown below by MyType_Instance2.

 

image5.jpg

 

The problem is that the customer has many instances of this type that already exist within his code.  He would currently have to create new instances of each type to load the new default value or he would have to hunt down all of the current instances and enter the default value of the new string manually.  I understand that the structure is updated, but shouldn't we build/provide an option to scan current instances of the custom data type and update default values for the elements that are new to a custom data type's structure?

 

I understand that it is expected behavior to load the default values of a custom data type only with a new instance of said custom data type, but I think we should provide an option/tool/function to our customers which updates all preexisting instances with the default value as well as the change in structure to the current types.  Currently only the structure is updated with a null string.

 

 

 

Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments
7 Comments
David@Work
Member

Adding this optional feature would help to make variable maintenance easier.  If one of these types are used across multiple test sequences and the string value needs to change for some reason, the maintenance would happen in a single location (very desirable).

dug9000
NI Employee (retired)

There is already a way to do something similar. In the types document, double click on the property in question to bring up the properties dialog. Notice there is a checkbox at the bottom to apply the update to all currently loaded instances of the type. Since you have already changed the value, you might need to change it to something else first and then change it back. If this feature does not meet your needs and/or if you have a suggestion for how we can better expose this feature or a similar feature that works better for your use case, please let us know.

 

-Doug

RayFarmer
Trusted Enthusiast

It's not obvoius, and it's not available at the container level. Maybe it needs a little button similar to the Change Type control.

 

RayF

Regards
Ray Farmer
Shawn_S.
NI Employee (retired)

I agree with Ray.  I wish there was something at the top level of the type that could optionally update all instances of the container.

Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments
dug9000
NI Employee (retired)

Just to make sure I understand correctly. At the container level, you want to be able to say, make all instances have identical settings and values for all properties underneath the container, correct?

 

I agree that the current implementation is not obvious enough.

 

-Doug

Shawn_S.
NI Employee (retired)

Yes, I would say that your clarification of the feature is correct.  Another option that could gives users more control would be to offer a feature where users could toggle the properties they would like updated in every instance of the data type.  Say a customer has a container, Dimension, which contains two numbers, Length, Width, and Depth.  These dimensions may represent the sizes of parts. If the customer learns that Depth is consistently a length of 3 and Length is consistently 5 for a test, it would be nice to somehow set the value for length to 5 and the Depth to 3, while leaving Width alone completely so that it's previous values are retained in each data type instance.

 

~Shawn

Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments
warren_scott
Active Participant

Implementation Idea:

 

Within the types palette file, after I am done "editing" the type, I can right click on any part of the type, and get a "apply value to all loaded instances" option. (I can choose a single element, or a the container and it applies the value of all elements within that container, and importantly also works for applying changes to LV module parameter mappings)  This could also be done without actually having to edit the type.  This is useful for the case where I make a type change that might impact 20 different sequence files, and can't have all of them open at once, but want to have the default value change be applied to all of the sequence files. 

applyvalue.png