SerializationOptions
- Aktualisiert2025-07-21
- 2 Minute(n) Lesezeit
SerializationOptions
Use these constants with the Engine.SerializeObjects method.
- SerializationOption_NoOptions –(Value: 0) TestStand uses the INI format by default if you specify no options.
-
SerializationOption_SupportNonTypedefMatchingInstances
–(Value: 4) Normally, type instances must match the structure of the underlying type definitions. Although you can use the
PropertyObject
properties and methods to modify a type instance so it no longer matches the structure of the underlying type definition, National Instruments does not recommend doing so even though it can be useful in some limited cases. Use the
SerializationOption_SupportNonTypedefMatchingInstances
option only when you must serialize objects that contain these types of instances to preserve the modifications during unserialization.
If you do not use this option when you serialize objects, TestStand makes the type instances conform to the underlying type definition during unserialization. You do not need to use this option when unserializing the data. TestStand makes type instances conform to type definitions and removes any structural modifications you programmatically make in the following situations, even when you use the
SerializationOption_SupportNonTypedefMatchingInstances
option:
- When you modify the structure of a type definition or use the Apply to All Loaded Instances of the Type option to modify a type definition, TestStand makes all type instances in memory conform to the type definition.
- When you load a file and use automatic or manual type conflict resolution to replace the existing global definition of the type with a new version of the type definition, TestStand makes all instances of the type in memory conform to the new version of the type definition.
Note The SerializationOption_SupportNonTypedefMatchingInstances option does not support the .ini format. You must use this option with the bitwise-OR operator with the SerializationOption_UseXml or SerializationOption_UseBinary option. - SerializationOption_UseBinary –(Value: 1) Use this option to greatly enhance the speed of both serialization and unserialization. This option is the fastest and most memory efficient format.
- SerializationOption_UseXml –(Value: 2) Use this option if you want to read or parse the data as XML. This option is the most readable and parseable format. Normally, the data from the Engine.SerializeObjects method is passed as input to the Engine.UnserializeObjects and Engine.UnserializeObjectsAndTypes methods. In this case, National Instruments recommends using SerializationOption_UseBinary because that option is faster and more memory efficient.