DEV Community

yohan
yohan

Posted on Originally published at cnblogs.com

CODESYS Applied Practice — Host/Controller Closed Loop

This post closes a practical loop: a minimal host/controller setup you can actually run.

Goal

Host PC talks to a soft PLC (CODESYS Control Win). The application exposes axes and variables. The host starts, stops, and exchanges data.

Host ↔ controller closed loop

Pieces

Piece Role
Host PC UI / scripts
CODESYS runtime Soft PLC
Application PLC_PRG + axes

Device setup

Create a standard project, add SoftMotion Win (or Control Win), define the program and axis objects, then compile and download.

New Standard Project dialog

Device tree

Application structure

Online view

Running animation

Simulated axes

The sample uses FB_SimAxis: the block parses commands and ramps position. The motion is real in the program; the “axis” is simulated. Good enough to prove the host/controller loop before touching hardware.

What you get

  • Download and start from the host
  • Read/write variables
  • A base for the later CODESYS AI and axes posts

This is the closed loop the rest of the CODESYS series builds on.

Top comments (0)