Placing a TwinCAT3 Machine Under Source Control : Différence entre versions

[version en cours de rédaction][version en cours de rédaction]
(Page créée avec « {{Tuto Details |Description=<translate>Changing the directory structure to allow a PC used for PLC code editing to sync with the source code version control system</trans... »)
 
 
(3 révisions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
 
{{Tuto Details
 
{{Tuto Details
 +
|Main_Picture=Installing_SourceTree_Version_Control_Software_Annotation_2020-02-01_125845.jpg
 +
|Main_Picture_annotation={"version":"2.4.6","objects":[{"type":"image","version":"2.4.6","originX":"left","originY":"top","left":-1,"top":137,"width":336,"height":74,"fill":"rgb(0,0,0)","stroke":null,"strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":3.26,"scaleY":3.26,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"crossOrigin":"","cropX":0,"cropY":0,"src":"https://stuga.dokit.app/images/5/50/Installing_SourceTree_Version_Control_Software_Annotation_2020-02-01_125845.jpg","filters":[]}],"height":450,"width":600}
 
|Description=<translate>Changing the directory structure to allow  a PC used for PLC code editing to sync with the source code version control system</translate>
 
|Description=<translate>Changing the directory structure to allow  a PC used for PLC code editing to sync with the source code version control system</translate>
 
|Categories=Software
 
|Categories=Software
Ligne 5 : Ligne 7 :
 
|Duration=30
 
|Duration=30
 
|Duration-type=minute(s)
 
|Duration-type=minute(s)
 +
|Tags=Sourcetree, version, control
 
}}
 
}}
 
{{Introduction
 
{{Introduction
|Introduction=<translate>For many years, the source code for the PLCs has resided on the G:\drive and then a copy on each and every one of the PCs used to edit the code, so at least one on each machine. This is a recipe for disaster because maintaining all the copies and version numbers is incredibly difficult and adds a lot of  time overhead to fixes and changes. This has worked becasue there has been only one developer, but this is set to change in future as more programmers will be trained and tracking versions becomes more difficult
+
|Introduction=<translate>{{Warning|...Note - This dokit is now obsolete - the sourcetree system has been replaced by the internal one in TcXAEShell}}
 +
 
 +
Click [https://stuga.dokit.app/wiki/Changing_Version_Control_to_Visual_Studio here] for the latest procedure
 +
 
 +
 
 +
For many years, the source code for the PLCs has resided on the G:\drive and then a copy on each and every one of the PCs used to edit the code, so at least one on each machine. This is a recipe for disaster because maintaining all the copies and version numbers is incredibly difficult and adds a lot of  time overhead to fixes and changes. This has worked because there has been only one developer, but this is set to change in future as more programmers will be trained and tracking versions becomes more difficult
  
  
Ligne 20 : Ligne 28 :
 
{{Materials}}
 
{{Materials}}
 
{{EPI}}
 
{{EPI}}
 +
{{Tuto Step
 +
|Step_Title=<translate>Install Sourcetree on the PC</translate>
 +
|Step_Content=<translate>See this [https://stuga.dokit.app/wiki/Installing_SourceTree_Version_Control_Software tutorial] for installation instructions
 +
 +
<br /></translate>
 +
}}
 
{{Tuto Step
 
{{Tuto Step
 
|Step_Title=<translate>Backup the Old Project</translate>
 
|Step_Title=<translate>Backup the Old Project</translate>
Ligne 25 : Ligne 39 :
 
}}
 
}}
 
{{Tuto Step
 
{{Tuto Step
|Step_Title=<translate>Install Sourcetree on the PC</translate>
+
|Step_Title=<translate>Rename tcMulti and PLC_Reset</translate>
|Step_Content=<translate>See this tutorial for installation instructions
+
|Step_Content=<translate>Remove the version numbers at the end</translate>
 
 
<br /></translate>
 
 
}}
 
}}
 
{{Tuto Step
 
{{Tuto Step
Ligne 44 : Ligne 56 :
 
{{Tuto Step
 
{{Tuto Step
 
|Step_Title=<translate>Pull the latest tcMulti Projects</translate>
 
|Step_Title=<translate>Pull the latest tcMulti Projects</translate>
|Step_Content=<translate>This will get the latest file versions from the cloud of tcMulti and PLC_Reset and copy into PLC_Reset and tc3Multi</translate>
+
|Step_Content=<translate>This will get the latest file versions from the cloud of tcMulti and PLC_Reset and copy into PLC_Reset and tc3Multi folders</translate>
 
}}
 
}}
 
{{Tuto Step
 
{{Tuto Step
 
|Step_Title=<translate>Change the PLC Projects to versionControl</translate>
 
|Step_Title=<translate>Change the PLC Projects to versionControl</translate>
|Step_Content=<translate># Open the machine's standard Visual Studio project file
+
|Step_Content=<translate>#Open the machine's standard Visual Studio project file
# Right click on tc3Multi_6_24 and select Change Project
+
#Right click on tc3Multi_and select Change Project
# Navigate to the versionControl folder\tc3Multi</translate>
+
#Navigate to the versionControl folder\tc3Multi
 +
#Select Use Original Project Location
 +
#Repeat for PLC_Reset
 +
{{Pin|...Following this method will keep the io links in the project}}<br /></translate>
 +
|Step_Picture_00=Placing_a_TwinCAT3_Machine_Under_Source_Control_Annotation_2020-01-31_135541.jpg
 +
|Step_Picture_01=Placing_a_TwinCAT3_Machine_Under_Source_Control_Annotation_2020-01-31_135608.jpg
 +
|Step_Picture_01_annotation={"version":"2.4.6","objects":[{"type":"image","version":"2.4.6","originX":"left","originY":"top","left":0,"top":0,"width":535,"height":272,"fill":"rgb(0,0,0)","stroke":null,"strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1.12,"scaleY":1.12,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"crossOrigin":"","cropX":0,"cropY":0,"src":"https://stuga.dokit.app/images/7/70/Placing_a_TwinCAT3_Machine_Under_Source_Control_Annotation_2020-01-31_135608.jpg","filters":[]},{"type":"wfnumberedbullet","version":"2.4.6","originX":"left","originY":"top","left":12,"top":183,"width":25,"height":25,"fill":"rgb(0,0,0)","stroke":"#FF0000","strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"objects":[{"type":"circle","version":"2.4.6","originX":"center","originY":"center","left":0,"top":0,"width":24,"height":24,"fill":"#FF0000","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"radius":12,"startAngle":0,"endAngle":6.283185307179586},{"type":"text","version":"2.4.6","originX":"center","originY":"center","left":0,"top":0,"width":7.79,"height":15.82,"fill":"rgba(255,255,255,255)","stroke":null,"strokeWidth":1,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":1,"scaleY":1,"angle":0,"flipX":false,"flipY":false,"opacity":1,"shadow":null,"visible":true,"clipTo":null,"backgroundColor":"","fillRule":"nonzero","paintFirst":"fill","globalCompositeOperation":"source-over","transformMatrix":null,"skewX":0,"skewY":0,"text":"4","fontSize":14,"fontWeight":"normal","fontFamily":"arial","fontStyle":"normal","lineHeight":1.16,"underline":false,"overline":false,"linethrough":false,"textAlign":"left","textBackgroundColor":"","charSpacing":0,"styles":{} }],"number":4}],"height":305,"width":600}
 +
}}
 +
{{Tuto Step
 +
|Step_Title=<translate>Check the IO Links still Exist</translate>
 +
|Step_Content=<translate></translate>
 +
}}
 +
{{Tuto Step
 +
|Step_Title=<translate>Activate Configuration</translate>
 +
|Step_Content=<translate></translate>
 +
}}
 +
{{Tuto Step
 +
|Step_Title=<translate>Delete the Old PLC Projects</translate>
 +
|Step_Content=<translate>In the Project folder for the machine, delete tc3Multi and PLC_Reset folder
 +
 
 +
{{Info|...These folders now reside in the versionControl folder}}<br /></translate>
 
}}
 
}}
 
{{Notes}}
 
{{Notes}}
 
{{PageLang
 
{{PageLang
 +
|Language=en
 
|SourceLanguage=none
 
|SourceLanguage=none
 
|IsTranslation=0
 
|IsTranslation=0
|Language=en
 
 
}}
 
}}
 
{{Tuto Status
 
{{Tuto Status
 
|Complete=Draft
 
|Complete=Draft
 
}}
 
}}

Version actuelle datée du 21 mars 2022 à 12:07

Auteur avatarGareth Green | Dernière modification 21/03/2022 par Gareth Green en cours de rédaction

Introduction

...Note - This dokit is now obsolete - the sourcetree system has been replaced by the internal one in TcXAEShell

Click here for the latest procedure


For many years, the source code for the PLCs has resided on the G:\drive and then a copy on each and every one of the PCs used to edit the code, so at least one on each machine. This is a recipe for disaster because maintaining all the copies and version numbers is incredibly difficult and adds a lot of time overhead to fixes and changes. This has worked because there has been only one developer, but this is set to change in future as more programmers will be trained and tracking versions becomes more difficult


From 2020, the PLC code version control has been improved by using an industry standard source control system called "Git" along with "BitBucket" to store the PLC code in the cloud. The program "SourceTree" is used to commit, push and pull the changes


Click here for an introduction to version control using Git


This tutorial is a step by step guide to setting up an existing machine or diagnostic PC to a standard uses on all Stuga machines to enable quick, easy and stress free version control.

Étape 1 - Install Sourcetree on the PC

See this tutorial for installation instructions


Étape 2 - Backup the Old Project

See this tutorial for backing up (archiving) a TwinCAT3 project

Étape 3 - Rename tcMulti and PLC_Reset

Remove the version numbers at the end

Étape 4 - Clone the tcMulti repository

Clone the online repository to a new local directory c:\TwinCAT\stuga\versionControl

Check success by navigating to the folder - there should be 2 folders

PLC_Reset

tc3Multi


Étape 5 - Pull the latest tcMulti Projects

This will get the latest file versions from the cloud of tcMulti and PLC_Reset and copy into PLC_Reset and tc3Multi folders

Étape 6 - Change the PLC Projects to versionControl

  1. Open the machine's standard Visual Studio project file
  2. Right click on tc3Multi_and select Change Project
  3. Navigate to the versionControl folder\tc3Multi
  4. Select Use Original Project Location
  5. Repeat for PLC_Reset
...Following this method will keep the io links in the project


Étape 7 - Check the IO Links still Exist

Étape 8 - Activate Configuration

Étape 9 - Delete the Old PLC Projects

In the Project folder for the machine, delete tc3Multi and PLC_Reset folder

...These folders now reside in the versionControl folder

Commentaires

Draft