Skip to content

nikvoronin/Tc2_Git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git for TwinCAT 2 (CoDeSys)

GoTwinCAT: Git Macro for CoDeSys or TwinCAT 2. // Oct 2019

How To...

It is a good idea to close PLC Control before using +commit.cmd

  • +commit.cmd does:
    1. looking for the .pro files inside %ProjectDir%
    2. exports several .exp files from the one .pro file to the ~%ProjectName% folder
    3. git add * (all)
    4. git commit -m with-current-date-n-time

From command line, execute git branch or git checkout before running +restore.cmd

  • +restore.cmd does:
    1. looking for .pro files inside %ProjectDir%
    2. import from the .exp files to the .pro one

Project Structure

.
├─ .git
│  └─ ...
├─ .gitignore
├─ +commit.cmd
├─ +restore.cmd
├─ Git.mac
├─ README.md
└─ src
   ├─ foo.pro
   ├─ bar.pro
   ├─ bar.tpy
   ├─ ~foo
   │  ├─ FILE111.EXP
   │  ├─ FILE222.EXP
   │  └─ ...
   └─ ~bar
      ├─ FILE111.EXP
      ├─ FILE222.EXP
      └─ ...

Macro

Open options menu in the PLC Control then add Git.mac as a macrolibrary to the working project: Project → Options → Macros → Macrolibrary... → Include...

00_macro

After that, you can find it under the Edit → Macros → Git → Commit menu items

01_macro_menu

PLC-Control Command Line

"When TwinCAT PLC Control is started, you can add commands in the command line which will be asserted during execution of the program." Read the rest at the infosys' topic: Command Line/Command File Commands

Understanding Git Series