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 programming 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 PLC 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 block 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 velocity 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.