9 Sending OPC Commands to Stepper Motor (ICICLE Kit)

After establishing the connection between client and server through the OPC UA channel, perform the following steps to start or stop the stepper motor that is connected to the ICICLE Kit Mikrobus connector.

  1. From the Address Space pane, drag-and-drop the Stepper Motor Controls object into the Data Access View pane as shown in the following figure.
    Figure 9-1. UAExpert Window - Stepper Motor Controls
    Important: A Recursive Add Notes dialog appears. Click Yes and continue with the next steps.
  2. All the functionality exported by Motor Control Board such as motor start, motor stop, and so on are made visible in the Data Access View pane as shown in the following figure.
    Figure 9-2. UAExpert - Data Access View
The following table lists the Stepper Motor OPC UA exported APIs and features.
Table 9-1. Stepper Motor OPC UA Exported APIs and Features
Display NameValid Values
Stepper Motor Start (1111-Start)Set the Motor Start value to 1111 to start the motor. The default is 0.
Stepper Motor RevolutionsSet the number of revolutions as follows:
  • Default Value: The default number of revolutions for the motor is set to 0.
  • Maximum Limit: The motor revolutions are limited to a maximum of 100. Attempting to set the number of revolutions beyond this limit will not increase the actual number of revolutions performed by the motor.
Stepper Motor Direction (0-Clockwise, 1-Anti-clockwise)Set the Motor Direction value to 1 to run the motor in anti-clockwise direction. The default is 0 (Clockwise direction).
Stepper Motor Rotation (1-Full, 2-Half, and 3-Quarter)Set the Motor Rotation value to 1|2|3 as required. By default, the stepper motor rotation is set to 1.
  • 1: Full (default)
  • 2: Half
  • 3: Quarter
Important: The following example demonstrates the procedure for sending OPC commands to the Stepper Motor:
  1. To start the stepper motor with default values (Clockwise, Full Rotation), change the Stepper Motor Start value from 0 to 1111. The stepper motor starts running in clockwise direction with the configured values.
  2. To change the stepper motor direction from clockwise to anti-clockwise direction, change the Stepper Motor Direction value from 0 to 1.
  3. To initiate 10 revolutions of the stepper motor.
    1. Change the Stepper Motor Revolutions value from 0 to 10.
    2. Change the Stepper Motor Start value from 0 to 1111. The stepper motor will start spinning in clockwise direction and should stop after 10 revolutions.