Example: Backgammon Game
Product: CODESYS Visualization
This Backgammon.project
example shows how to program the "Backgammon" game with CODESYS. The project is realized with the Sequential Function Chart (SFC). The Sequential Function Chart is a graphical oriented language which allows to describe the chronological order of particular actions within a program.
![]() |
Description
The central component of the game Backgammon.project
example is the PLC_PRG
program. The program is implemented in Sequential Function Chart (SFC). Each step of the game is represented by an AS action. The status of the game and the position of the tiles are stored in the FB_Board
function block. The Vis_Board
visualization displays the board and the state of the FB_Board
function block.
CODESYS plays with the blue tiles from the bottom right to the top right. You play with the red tiles from the top right to the bottom right.
New game: Starts a new game
Roll dice: Rolls the dice
You can move a tile by selecting its current field and then selecting the target field.
System requirements and restrictions
Programming system | CODESYS Development System (version 3.5.14.0 or higher) |
Runtime system | CODESYS Control Win (version 3.5.14.0) |
Add-on components | - |
Note
DOWNLOAD Project