Create the Setup Workflow#
For the Automation Controller to communicate with the equipment, each driver needs a setup workflow that configures the driver, connects it to the equipment, and completes the setup phase of the connection. With the Automation Tasks Library (ATL) core tasks, this workflow uses three tasks for each driver: Driver Event OnInitialize, Equipment Configuration, and Driver Command.
To open the workflow designer, select the Workflow tab of the Automation Controller page, as shown in the following image.
Setup Page#
When you create an Automation Controller with the Connect IoT scope and at least one driver definition, a page named Setup is created automatically with the workflow type selected in the wizard. If the controller extends a parent controller, the page is named <ControllerName>_Setup to avoid conflicts with the inherited pages. See Create Automation Controller.
The page contains, for each driver definition, the three tasks already associated with the driver and linked in the following order:
- Driver Event with the Event setting set to
OnInitialize. It triggers when the controller establishes the connection with the driver instance. - Equipment Configuration, which sends the connection parameters to the driver.
- Driver Command with the Command setting set to
Connect, which orders the driver to connect to the equipment.
Each task is displayed with the color of its driver, specified when the driver definition is added to the controller. In a Control Flow workflow, the Equipment Configuration and Driver Command tasks are placed inside the handler branch of the Driver Event task.
Settings#
To change the settings of a task, open the menu in the header of the task and choose Settings. The Driver field of each generated task is already set and cannot be changed.
The Driver Event task has the following Behavior settings:
- Auto Enable - subscribes the event when the workflow starts. Keep it enabled for the setup tasks.
- Event - the driver event to subscribe. Keep
OnInitializefor the setup tasks. - Automatic Setup - completes the setup phase automatically with a
SetupSuccesscommand. It is enabled by default and is available only for theOnInitializeevent. See Complete the Setup Phase.
The Equipment Configuration task holds the timeouts and timers of the connection with the equipment on its General tab: Connecting Timeout, Setup Timeout, Reconnect Interval, and Heartbeat Interval. The protocol-specific parameters, such as the network address or the port, are listed on the Communication Parameters tab. Select a parameter on the left side of the page to change its value.
Note
The legacy On Equipment Setup and Equipment Setup Result tasks are replaced by these three tasks. The reconnect interval, reconnect max attempts, and require buffering settings of the legacy task are no longer available. The connection between the controller and the driver instance uses the defaults of the Driver Event task.
Workflow#
The generated tasks are linked so that the driver starts the communication with the equipment when the driver instance becomes available. If you rebuild the page, or add a driver later, create the following links for each driver:
- Connect the Success output of the Driver Event task to the Activate input of the Equipment Configuration task. The parameters are sent to the driver when the
OnInitializeevent occurs. - Connect the Success output of the Equipment Configuration task to the Activate input of the Driver Command task. The
Connectcommand is sent after the driver accepts the configuration.
To run one controller on several machines, read the values of each machine from MES between the Driver Event and Equipment Configuration tasks. See How to: Configure Each Machine from MES and Connect IoT Runbook.
Complete the Setup Phase#
After the driver connects to the equipment, it enters the setup phase and raises the OnSetup event. The driver only starts communicating after the workflow reports the result of this phase, within the Setup Timeout of the Equipment Configuration task. There are two ways to complete it:
- Automatic Setup - keep the Automatic Setup setting of the Driver Event task enabled. The task sends the
SetupSuccesscommand as soon as the setup phase starts. Use it when the equipment does not require any initialization. - Custom initialization - disable Automatic Setup and add a second Driver Event task for the driver with the Event setting set to
OnSetup. Link the tasks that initialize the equipment to its Success output, for example, to enable event reports or to check the equipment identification. After the initialization, activate a Driver Command task with the Command setting set toSetupSuccess. To abort the setup and force a reconnection, activate a Driver Command task set toSetupFailureinstead.
Several Drivers#
Each driver of a controller runs in its own driver process, with its own connection, communication parameters, and events. Every task that talks to a driver names one driver in its Driver field, and acts on that driver only: events and commands never cross between drivers.
- Keep one chain for each driver, with the Driver Event, Equipment Configuration, and Driver Command tasks bound to the same driver. A Driver Command fails with
Connection with driver instance was not yet established or it was not yet configuredwhen the Equipment Configuration of its own driver has not run, and a driver without a chain is never told to connect. - Do not rely on the order in which the drivers become available. Each chain runs when its own driver becomes available, so keep work that needs two drivers out of the setup chain of either one.
- Join the work of two drivers inside one workflow with a link, for example from an event of one driver to a command of the other. Across workflows, carry the data with a function call, the data store, or the message bus.
- The running instances of a controller have no driver instance for a driver added later. When the new driver has none, replace the instances, or add the driver in a new version and update the instances to it. See Connect IoT Runbook.





