Changing Version Control to Visual Studio

Cette page contient des modifications qui ne sont pas marquées pour la traduction.

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