Program a Multi-Core Controller

A multi-core controller operates slightly differently to take advantage of the extra performance provided by a multi-core CPU.

Consequently, there are some differences in programmingClosed The act of performing a sequence of instructions or commands. a multi-core controller from programming a single-core controller.

This page lists those differences.

Cached Data

A multi-core controller gains most of its performance by running PLCClosed Programmable Logic Controller - A digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. Used to synchronize the flow of inputs from (physical) sensors and events with the flow of outputs to actuators and events. code and motion code at the same time.

To avoid race conditions, function blocks that read motion data reports the data that the motion code used or calculated during the last cycle.

Function Blocks - Return Cached Data

Call Function Blocks Multiple Times in the Same Cycle

A given function blockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. can usually be called multiple times without causing problems when using a single-core controller.

Example

It is possible to call MC_MoveVelocity multiple times to start velocityClosed For a group of axes this means: In ACS the velocities of the different axes. In MCS and PCS it provides the velocity of the TCP moves on multiple axes.

Set the Execute input to False between every call to start a new velocity move.

  • When doing this, the ability to monitor the status of the velocity moves is lost because the axis parameter is changed for each call.
  • If there is no concern with monitoring the status of the velocity moves, call MC_MoveVelocity any number of times in a given cycle.

Function blocks that start a motion-related action need to avoid race conditions when using a multi-core controller.

The function blocks have to save argument data so that calculations and error detection can be determined during the next controller cycle.

There are two consequences to this:

  • With the possible exception of the multicoreFbExecuteDuplicateValueInCycle error 76, the Error and ErrorID outputs report no error on the first cycle.
    • The Error and ErrorID outputs reports their status in the next VM cycle.
  • The function block cannot be called with the same Execute state twice in a single VM cycle.
    • If a function block is called with the same Execute state twice in a single VM cycle, a multicoreFbExecuteDuplicateValueInCycle error 76 is returned immediately.

Function Blocks - Start Motion-related Actions