Variant¶
The Variants
and Variant
elements allow a single configuration file to be used in different use-cases.
Note
Variants
is used to define the default configuration, which will be applied when using LoadConfiguration without selecting the desired variant.
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | <Controller Name="Arcas 5EG-0">
<Variants>
<!-- Default variant selection, overruled by arguments in API call -->
<Variant Name="Simulated" Value="True"/>
</Variants>
<Variant Name="Simulated" Value="True">
<Template Name="PositionControlTemplate" TemplateType="ProcessingBlock">
<Updatable Name="Updatable">
<FilePath>PositionControlSimple-windows-x86_64.bin</FilePath>
</Updatable>
</Template>
<Template Name="PlantSecondOrderMechanicalTemplate" TemplateType="ProcessingBlock">
<Updatable Name="Updatable">
<FilePath>PlantSecondOrderMechanical-windows-x86_64.bin</FilePath>
</Updatable>
</Template>
</Variant>
<Variant Name="Simulated" Value="False">
<Template Name="PositionControlTemplate" TemplateType="ProcessingBlock">
<Updatable Name="Updatable">
<FilePath>PositionControlSimple-bb-armv8a_64.bin</FilePath>
</Updatable>
</Template>
<Template Name="PlantSecondOrderMechanicalTemplate" TemplateType="ProcessingBlock">
<Updatable Name="Updatable">
<FilePath>PlantSecondOrderMechanical-bb-armv8a_64.bin</FilePath>
</Updatable>
</Template>
</Variant>
<AxisControl Name="X" Template="LogicalAxisControlStandard3rdOrderTemplate">
<Variant Name="Simulated" Value="True">
<ProcessingBlock Name="Plant" Template="PlantSecondOrderMechanicalTemplate" CalculationStart="True">
<Input Name="Actuator" Source="X/PositionControl/ControlOutput"/>
<Signal Name="Mass">1.0</Signal>
<Signal Name="Damping">2.75</Signal>
<Signal Name="Stiffness">0.25</Signal>
</ProcessingBlock>
</Variant>
<TrajectoryInterpolator>
<Input Name="DemandPositionOffset" Source="X/PositionControl/DemandPositionOffset"/>
</TrajectoryInterpolator>
<CommandQueue>
<Input Name="IsClosedLoop" Source="X/PositionControl/IsClosedLoop"/>
<Input Name="InPosition" Source="X/TrajectoryInterpolator/InPosition/Event"/>
<Input Name="TrajectoryComplete" Source="X/TrajectoryInterpolator/TrajectoryComplete/Event"/>
</CommandQueue>
<ProcessingBlock Name="PositionControl" Template="PositionControlTemplate">
<Input Name="CloseLoopRequest" Source="X/CommandQueue/CloseLoopRequest"/>
<Input Name="DemandPosition" Source="X/TrajectoryInterpolator/DemandPosition"/>
<Variant Name="Simulated" Value="True">
<Input Name="PositionSensor" Source="X/Plant/Position"/>
</Variant>
</ProcessingBlock>
</AxisControl>
</Controller>
|
XML schema¶
1 2 3 4 | <xs:complexType name="BaseVariantType" abstract="true">
<xs:attribute name="Name" type="xs:string" use="required"/>
<xs:attribute name="Value" type="xs:string" use="required"/>
</xs:complexType>
|
Attribute |
Description |
---|---|
|
Defines the name of the variant. |
|
Defines the value of the variant. |
1 2 3 4 | <xs:complexType name="DefaultVariantType">
<xs:attribute name="Name" type="xs:string" use="required"/>
<xs:attribute name="Value" type="xs:string" use="required"/>
</xs:complexType>
|
Attribute |
Description |
---|---|
|
Defines the name of the default variant. |
|
Defines the value of the default variant. |
1 2 3 4 5 | <xs:complexType name="DefaultVariantsType">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Variant" type="DefaultVariantType"/>
</xs:choice>
</xs:complexType>
|
See also
LoadConfiguration implementations of IController interface.
- C++ API methods
- C# API methods