FactoryTalk Optix Handshakes Coordinate PLC and C# Data Operations
- Michal Gumulak
- 925 reads
FactoryTalk Optix uses variable change events and C# handshakes to confirm tasks between a PLC and Optix, whether either side initiates the operation.

FactoryTalk Optix can coordinate PLC tag changes with database operations and other C# tasks using a handshake that tracks whether each side has completed its part. The design addresses a common integration gap: a standard PLC may not detect when external software reads or writes its tags, so a value change alone may not confirm that the associated work has finished.
The pattern has two forms. A PLC tag change can trigger an Optix function, which runs a task and reports completion to the PLC. Or Optix can start a task, signal the PLC, and wait for the PLC to acknowledge receipt. DMC engineers Ben Clare and Otto Gottlieb presented this approach at Rockwell Automation Fair 2026. The examples below show how variable change events and custom C# NetLogic connect the two sequences.
PLC changes can trigger Optix tasks
In the first arrangement, the model object variable PhaseL1Filling.StartSent, of type Phase, is bound to a PLC tag. When the PLC changes that tag, Optix updates the variable. A variable change event on the object then calls the StartPhase method in the StartPhaseService C# class.

The method extracts the Phase object that triggered it and calls the handshake function. It is marked with Optix’s [ExportMethod] attribute, allowing the application to invoke it through the configured event. The service class supplies the task that the handshake will run. In the example, the derived StartPhasesService class overrides TaskToRun to record a phase start time in a database. The same structure can be assigned other C# work, such as updating another tag.



The base class, BaseEnumerationHandshakeService, processes the handshake values. In this implementation, a value from 1 through 9 tells Optix to run the assigned task using RunTaskAndSetReceived. Once the task has run, that function sets a received bit for the PLC, giving the controller an explicit indication that the work completed.


The PLC then acknowledges that response with a value from 10 through 19. Optix processes that final state and resets its received bit, completing the exchange. The important feature is the sequence of confirmations: the initiating tag change starts the work, Optix signals task completion, and the PLC acknowledges that signal. The specific value ranges are part of this example’s implementation, not a universal handshake convention.

Optix can initiate the exchange
The second arrangement reverses the direction of initiation. Here, an Optix object called PalletPrinter starts the procedure rather than waiting for a PLC-bound variable to change. Optix runs its backend C# logic and writes the sent value to the PLC. The sent and received bindings are arranged for this direction of operation.


Unlike the first example, the task does not wait for an incoming handshake value before it runs. The backend calls RunTaskAndSendHandshake, which starts an asynchronous task and sends the handshake to the PLC. That signal tells the controller that Optix has initiated the operation.

After receiving the signal, the PLC returns an acknowledgment through ScanReceived. A variable change event on that value invokes ProcessPrinter1ReceivedHandshake, which uses the base class’s ProcessHandshake logic. The function resets the sent bit, closing the exchange and confirming that the PLC responded.

Use the sequence to match the application
Both examples use a pair of status signals to make task progress visible across the Optix and PLC boundary. Their order depends on which system starts the work. With a PLC-triggered event, Optix receives the changed value, runs its task, signals completion, and waits for the PLC’s acknowledgment. With an Optix-triggered event, Optix runs its task and sends the handshake, then processes the PLC’s acknowledgment.
That distinction matters when choosing where to place event handling and what each bit means. A tag update can trigger work, but the handshake adds confirmation that the task ran and that the other side registered the result. The code shown is a general implementation pattern; its description does not cover every error-handling case. For a real application, the task, state values, and reset behavior need to fit the equipment’s communication sequence. Database writes, PLC tag updates, and other C# operations can all use the same basic coordination model when their completion needs to be acknowledged.