Changing Version Control to Visual Studio : Différence entre versions

[version en cours de rédaction][version en cours de rédaction]
 
(2 révisions intermédiaires par le même utilisateur non affichées)
Ligne 22 : Ligne 22 :
 
|Step_Title=<translate>Take a backup of the current build project</translate>
 
|Step_Title=<translate>Take a backup of the current build project</translate>
 
|Step_Content=<translate>[[Archiving a TwinCAT Project]]</translate>
 
|Step_Content=<translate>[[Archiving a TwinCAT Project]]</translate>
 +
}}
 +
{{Tuto Step
 +
|Step_Title=<translate>Ensure the PLC Project Names are Compatible</translate>
 +
|Step_Content=<translate>Check the PLC Projects are called
 +
 +
 +
tc3Multi
 +
 +
PLC_Reset
 +
 +
 +
If they have a number after them (as in picture, they will need to be '''renamed first'''</translate>
 +
|Step_Picture_00=Changing_Version_Control_to_Visual_Studio_Screenshot_2022-09-12_130423.jpg
 +
|Step_Picture_00_annotation={"version":"2.4.6","objects":[{"type":"image","version":"2.4.6","originX":"left","originY":"top","left":0,"top":0,"width":292,"height":229,"fill":"rgb(0,0,0)","stroke":null,"strokeWidth":0,"strokeDashArray":null,"strokeLineCap":"butt","strokeDashOffset":0,"strokeLineJoin":"miter","strokeMiterLimit":4,"scaleX":2.05,"scaleY":2.05,"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/6/6a/Changing_Version_Control_to_Visual_Studio_Screenshot_2022-09-12_130423.jpg","filters":[]},{"type":"wfrect","version":"2.4.6","originX":"center","originY":"center","left":290.22,"top":273,"width":290.22,"height":100,"fill":"rgba(255,0,0,0)","stroke":"#FF0000","strokeWidth":2,"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,"rx":0,"ry":0}],"height":471,"width":600}
 
}}
 
}}
 
{{Tuto Step
 
{{Tuto Step
Ligne 56 : Ligne 70 :
 
}}
 
}}
 
{{Tuto Step
 
{{Tuto Step
|Step_Title=<translate>Create the Repository</translate>
+
|Step_Title=<translate>Clone the Repository</translate>
 
|Step_Content=<translate>#Open Team Explorer
 
|Step_Content=<translate>#Open Team Explorer
 
#Clone a new Git Repository
 
#Clone a new Git Repository

Version actuelle datée du 12 septembre 2022 à 13:15

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

Introduction

In March 2022 the password policy of the system behind SourceTree / Bitbucket and Atlassian changed - link. This meant all machine would need a complex password login change for the SourceTree program used for version control of the PLC code.


This was not straight-forward to resolve, so the decision was made to change the version control system to the one that is packaged with the Visual Studio system by default. This is a better method anyway, but it needs the "TcXaeShell" installed.

...The TcXaeShell is simply a newer version of Visual Studio that includes Source control, rebadged for TwinCAT3

Étape 1 - Take a backup of the current build project

Archiving a TwinCAT Project

Étape 2 - Ensure the PLC Project Names are Compatible

Check the PLC Projects are called


tc3Multi

PLC_Reset


If they have a number after them (as in picture, they will need to be renamed first



Étape 3 - Backup the Mappings information

Creating Backup of TwinCAT Mapping


...This is really, really important to do

Étape 4 - Ensure TcXAEShell is installed

  1. Right click on TwinCAT service in the task bar
  2. If TcXaeShell is installed you will see the gold Icon with the cog inside


There is a Visual Studio icon here instead, you will need to install TcXaeShell.

Procedure is here




Étape 5 - Open TwinCAT Shell



Étape 6 - Open the Machine Solution File



Étape 7 - Clone the Repository

  1. Open Team Explorer
  2. Clone a new Git Repository
  3. URL to clone: https://bitbucket.org/StugaMachinery/tc3Multi
  4. Click on the destination setup
  5. Create a new folder under the machine build folder called "source"
  6. Click 'Clone'

Étape 8 - Enter Git Credentials (if required)

Atlassian Username is StugaMachinery

Password is stored in the file


G:\IT Department\SourceTree BitBucket App Password.txt

...Sometimes, the password credentials are already stored and the password entry is not necessary

Étape 9 - Move The PLC_Reset and tc3Multi Project

  1. Right click the PLC_Reset Project
  2. Select Change Project
  3. Navigate to the repository you have created in Step 6 c:\TwinCAT\Stuga\BuildNo\source\PLC_Reset\PLC_Reset.plcproj
  4. Repeat for the tc3Multi project



Étape 10 - Check if the IO links have disappeared

If so, this is probably due to the PLC project having no "Instance":

  1. Build the solution
  2. Import the mappings file taken in step 2

...The "Instance" is created when the PLC project is built. This has all the IO definitions in it (ie axes, outputArray, inputArray, etc) If it does not exist, the IO cannot be linked. Once built, you can then import the old links back in again


Étape 11 - Delete the versionControl Folder

Delete the versionControl folder completely

...This prevents confusion in the future of where the project exists



Étape 12 - Update Control Systems Log

Update the Version Control column on the board to "VisualStudio" to log the completion of this task



Commentaires

Draft