Creating a Compound Object to Control a Motor

Create a compound object to display the motor start and stop states and rotation speed.

By using a [STRUCT] compound object property, start, stop, and rotation speed can be displayed in the [Properties] window of the Compound Object as associated properties. After placing the Compound Object on the screen, assign variables to each property.

Example Compound Object

Setting Workflow

  1. Create Compound Object Properties
  2. Set up Parts

Create Compound Object Properties

Compound Object Explorer: [Compound Object Library] → [Compound Object1] → [Properties]

Create the following properties

Compound Object Properties:

Parent element

[Name] [Display Name] [Type]
MOTOR MOTOR [STRUCT]

Child element

[Name] [Display Name] [Type] [Supported Values]
START START [BOOL] Select only [Variable]
STOP STOP [BOOL] Select only [Variable]
SPEED SPEED [DINT] [Select All]

Set up Parts

Compound Object Explorer: [Compound Object Library] → [Compound Object1]

Drag and drop the following objects from the [Tool Chest] to the [Layout].

Switch object (name: Switch1) property: START

Tab Sub Tab Property

Value

[Function] [Touch] [Operation] [Type] [Bit]
[Operation] [Set]
[Destination]

[Compound Object]

[Name]: START

Switch object (name: Switch2) property: STOP

Tab Sub Tab Property

Value

[Function] [Touch] [Operation] [Type] [Bit]
[Operation] [Set]
[Destination]

[Compound Object]

[Name]: STOP

Numeric Display object (name: NumericDisplay1) property: SPEED

Tab Sub Tab Property

Value

[Function]

[Basic]

[Current Value]

[Compound Object]

[Name]: SPEED

Predefined Image object (name: Motor41) property:

Default value