项目作者: nikvoronin

项目描述 :
Git for TwinCAT 2 (CoDeSys)
高级语言: Batchfile
项目地址: git://github.com/nikvoronin/Tc2_Git.git
创建时间: 2019-10-10T16:58:14Z
项目社区:https://github.com/nikvoronin/Tc2_Git

开源协议:MIT License

下载


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

  1. .
  2. ├─ .git
  3. └─ ...
  4. ├─ .gitignore
  5. ├─ +commit.cmd
  6. ├─ +restore.cmd
  7. ├─ Git.mac
  8. ├─ README.md
  9. └─ src
  10. ├─ foo.pro
  11. ├─ bar.pro
  12. ├─ bar.tpy
  13. ├─ ~foo
  14. ├─ FILE111.EXP
  15. ├─ FILE222.EXP
  16. └─ ...
  17. └─ ~bar
  18. ├─ FILE111.EXP
  19. ├─ FILE222.EXP
  20. └─ ...

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