Sysmac Studio Project Version Control Function Startup Guide
Sysmac Studio Project Version Control Function Startup Guide
Startup Guide
for Project Version Control Function
SYSMAC-SE2@@@
SYSMAC-TA4@@L
P125-E1-01
NOTE
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior
written permission of OMRON.
No patent liability is assumed with respect to the use of the information contained herein. Moreover, because
OMRON is constantly striving to improve its high-quality products, the information contained in this manual is
subject to change without notice. Every precaution has been taken in the preparation of this manual. Neverthe-
less, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages
resulting from the use of the information contained in this publication.
Trademarks
• Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and other
countries for OMRON factory automation products.
• Microsoft, Windows, Excel, and Visual Basic are either registered trademarks or trademarks of Microsoft Corpora-
tion in the United States and other countries.
• EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.
• ODVA, CIP, CompoNet, DeviceNet, and EtherNet/IP are trademarks of ODVA.
Copyrights
Microsoft product screen shots reprinted with permission from Microsoft Corporation.
Table of Contents
INTRODUCTION ································································································ 3
2 TERMINOLOGY ······················································································· 6
6.1 Overview of Project Record Control Using the Version Control Function ..... 27
6.2 Operation Example of Record Control Function ............................................ 28
6.3 Preparing for Starting Project Control (Creating a Base Project and Saving It)
........................................................................................................................ 28
6.3.1 Creating a Base Project ..................................................................... 29
6.3.2 Registering the project in the Local Repository ................................. 30
6.3.3 Synchronizing the Local Repository and Remote Repository ........... 33
6.4 Updating the Project ....................................................................................... 37
Intended Audience
This manual is intended for the following personnel, who must also have knowledge of electrical systems
(an electrical engineer or the equivalent).
• Personnel in charge of introducing FA systems.
• Personnel in charge of designing FA systems.
• Personnel in charge of installing and maintaining FA systems.
• Personnel in charge of managing FA systems and facilities.
For programming, this manual is intended for personnel who understand the programming language
specifications in international standard IEC 61131-3 or Japanese standard JIS B 3503.
Applicable Products
• WARRANTY
• The warranty period for the Software is one year from the date of purchase, unless otherwise
specifically agreed.
• If the User discovers defect of the Software (substantial non-conformity with the manual), and return it
to OMRON within the above warranty period, OMRON will replace the Software without charge by
offering media or download from OMRON’s website. And if the User discovers defect of media which
is attributable to OMRON and return it to OMRON within the above warranty period, OMRON will
replace defective media without charge. If OMRON is unable to replace defective media or correct the
Software, the liability of OMRON and the User’s remedy shall be limited to the refund of the license
fee paid to OMRON for the Software.
• LIMITATION OF LIABILITY
• THE ABOVE WARRANTY SHALL CONSTITUTE THE USER’S SOLE AND EXCLUSIVE REMEDIES
AGAINST OMRON AND THERE ARE NO OTHER WARRANTIES, EXPRESSED OR IMPLIED,
INCLUDING BUT NOT LIMITED TO, WARRANTY OF MERCHANTABILITY OR FITNESS FOR
PARTICULAR PURPOSE. IN NO EVENT, OMRON WILL BE LIABLE FOR ANY LOST PROFITS OR
OTHER INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF USE
OF THE SOFTWARE.
• APPLICABLE CONDITIONS
USER SHALL NOT USE THE SOFTWARE FOR THE PURPOSE THAT IS NOT PROVIDED IN THE
ATTACHED USER MANUAL.
• CHANGE IN SPECIFICATION
The software specifications and accessories may be changed at any time based on improvements and
other reasons.
• ERRORS AND OMISSIONS
The information in this manual has been carefully checked and is believed to be accurate; however, no
responsibility is assumed for clerical, typographical, or proofreading errors, or omissions.
Safety Precautions
Refer to Sysmac Studio Version 1 Operation Manual (Cat.No.W504) and Sysmac Studio Project Version Control
Function Operation Manual (Cat.No. W589).
This product incorporates certain third party software. The license and copyright information associated with this
software is available at http://www.fa.omron.co.jp/nj_info_e/.
Revision History
Revision code appears as a suffix to the catalog number on the front and back covers of the guide.
As the scale of production machines increases, the following problems in the development of production machines
are becoming more serious.
• The development scale of controller programs has been increased and the development period has become
longer.
• The workload of changing controller programs has increased due to the increased variation of production
machines
To offer solutions for these issues, new development environment with the following features is now required.
• Environment to develop controller programs with multiple developers
• Development environment where changes made to the common program can be applied to relevant machines
with minimum operations
Sysmac Studio will offer functions to control Sysmac Studio project versions (hereinafter referred to as Version
Control Function) as a solution for these issues. The version control function realizes various control capabilities by
combining the Sysmac Studio with an open source software version control system commonly used in software
development.
This document describes the procedures of installing the open source version control system, initial settings on
Sysmac Studio, change record management which is the most basic function of the version control, development by
multiple developers, and the steps to carry out derived development.
The Sysmac Studio version control function operates in an environment that consists of the Sysmac Studio, Git
(version control system), “TortoiseGit” (client software for Git), and repositories (folders managed by Git).
The following figure illustrates the minimum configuration in which a single user has access to Sysmac Studio
projects.
Sysmac Studio
TortoiseGit
Git Repository
Sysmac Studio version control function works with Git which has a feature of distributed version control system and
they offer a mechanism to share the repository with multiple users.
The configuration consists of local repositories registered in the computers of each user and the remote repository
shared by multiple users. At a certain timing of each user, the local repository and remote repository can be
synchronized.
To share changes in the local repository with other users, perform a push operation to the remote repository. To
apply changes made by other users to the local repository, perform a pull operation from the remote repository.
There are the following three practical configurations depending on the difference in how the remote repository is
shared.
(1) Using a shared folder on the computer to share it as the remote repository
(2) Building a dedicated Git server to share it as the remote repository
(3) Utilizing a Git Server Service on the Internet to Share the Remote Repository
In the following description, we use a remote repository that is built in this way.
Local
Repository
(3) Utilizing a Git Server Service on the Internet to Share the Remote Repository
Remote
Repository
Internet Local
Repository
This section describes the basic operation of Version Control System on the Sysmac Studio.
Sysmac Studio version control system on Sysmac Studio version control system of
User A computer User B computer
Local Local
TortoiseGit TortoiseGit
Repository Repository
2) Push 3) Pull
2) Push 3) Pull
Git Git
Remote
Repository
Shared folder
The version control function is applicable to devices that are registered in the project, as well as the following data
of each device.
• Data in Configurations and Setup and lower-level folders in the Multiview Explorer
• Depending on the device, however, there is other version-controlled data in addition to the above, or some of
the above data is not version-controlled.
Refer to the Sysmac Studio Project Version Control Function Operation Manual (Cat. No. W589) for information on
devices with relevant data.
Note that display settings for windows, such as the layout of each pane in the main window, are not version-
controlled.
The function is applicable to Controller unit version 1.16 or later. With the Unit of unit version 1.15 or earlier, version
control function cannot be used.
This section describes the procedure to setup the software and basic settings in a configuration where the remote
repository is shared in the shared folder in a computer.
5.1 Installing the Sysmac Studio
To activate the version control function, register the Sysmac Studio Team Development Option license on the
Sysmac Studio.
For details on the registration procedure of the Sysmac Studio Team Development Option, refer to Sysmac Studio
Project Version Control Function Operation Manual (Cat.No. W589).
https://git-scm.com/downloads
Depending on the operating system installed on the computer, download the 32-bit or 64-bit edition of the
installer.
4. Click the Yes button in the User Account Control dialog box.
The Setup dialog of Git is displayed.
6. Select a folder to install Git, and then click the Next button.
The Select Components dialog box is displayed.
8. Enter the folder name for the Start menu, and click the Next button.
The below dialog box is displayed to confirm whether to use Git in the command line.
If you use a method of sharing the remote repository using the Windows shared folder, you can choose either
of them. If you are using Git server, please contact the system administrator of the server. In this example, Use
the OpenSSL library is selected.
Select the terminal software to use the command line tool “Git Bash”. To use the Sysmac Studio version control
function, you can choose either of them. In this example, you select the first option Use MinTTY (the default
terminal of MSYS2).
https://tortoisegit.org/download/
Depending on the operating system installed on the computer, download the 32-bit or 64-bit edition of the
installer. In addition, language packs are also posted on the same URL site. Please download the appropriate
one as necessary.
If you use a method of sharing the remote repository using the Windows shared folder, you can choose either
one. If you are using Git server, please contact the system administrator of the server. Here, select the first
TortoiseGitPink based on PuTTY; optimized for TortoiseGit and integrates better with Windows option.
To use the Sysmac Studio version control function, do not change the option selected by default.
10. Deselect Run first start wizard option, and then click the Finish button.
11. Please download the applicable language pack from the following URL site and set it up as necessary.
https://tortoisegit.org/download/
When installation of the “TortoiseGit” is completed, perform initial settings to use it.
1. In the Settings dialog box of “TortoiseGit”, select General and then Re-run First Start Wizard.
You can open the Settings dialog box by selecting the Start menu, and then All programs - TortoiseGit -
Settings.
Set the path to Git execution module “Git.exe”. If you did not change the install path when installing Git, leave it
as default.
The user name and email address that you enter here will be used as change record information.
6. To use the Sysmac Studio version control function, do not reduce the option selected from default.
This section utilizes the configuration in which a shared folder on the computer is used as the remote repository as
an example.
For this configuration, create a shared folder in which to store a remote repository, and then create a folder that
serves as the remote repository in the shared folder.
5. Select the check box on the dialog box and click the OK button.
Note that you can control only one Sysmac Studio project per repository. Create a directory for each project to use
version control function.
In “TortoiseGit”, add settings to enable graphical comparison of Sysmac Studio projects from “TortoiseGit”.
5. Enter the following text string, and then click the OK button.
Items Text string to enter
Extension .oem
External Program (Sysmac Studio install folder*1)\ SysmacDiff.exe
-gitdiff %base %mine %bpath %brev %yrev
*1: The Sysmac Studio installation folder is by default as follows.
Windows 32bit edition: C:\Program Files\OMRON\Sysmac Studio
Windows 64bit edition: C:\Program Files (x86)\OMRON\Sysmac Studio
6.1 Overview of Project Record Control Using the Version Control Function
The version control system “Git” which works with the Sysmac Studio has the following four basic functions.
• Generates an identification number that uniquely identifies changes in saved software data and stores it with
comments
• Searches for changes in specific software data by date information, comments, user name, etc.
• Comprehends (compares) differences from arbitrary software data
• Restores to software data at specific change time
The Git controls records of Sysmac Studio project data using above basic functions.
From To
Every time changes are applied to the master, The version control function controls the change
it takes time to copy and rename the project records of the projects.
file. It is impossible to know who changed what.
It takes time to
merge the changes
by copying and
pasting them one by
one to reflect on the
master.
This section describes an operation example to use the record control function.
E.g. Executing Commit four times to update the information in the repository.
Commit: 4 times
1. Create a new project.
2. Add a rung in the Section0
3. Create the Program1
4. Modify the program in the Section0
When above course of operation is explained with the idea of change set which is a control unit of the version
control system, the change information is managed as a sequential information of revision 2 -> revision 3 -> revision
4 (*) that started from the starting point of revision 1 (*). Since the information of differences between revisions and
change set are combined and managed, a project opened on the Sysmac Studio can be restored to a specific
revision.
*The revisions are expressed as 1, 2, 3, and 4 for simplicity of explanation, but in reality it is a numeric value of 40
digits hexadecimal number generated by the SHA - 1 algorithm, and it is not serial numbers that increase one by
one.
6.3 Preparing for Starting Project Control (Creating a Base Project and Saving It)
To start controlling the versions of a Sysmac Studio project, create a base project, save it in the local repository and
configure the synchronization settings of the local and remote repository.
1. From the Start menu, select All Programs – OMRON – Sysmac Studio – Sysmac Studio to start the Sysmac
Studio.
The User Account Control dialog box is displayed according to the Windows version or user authority. Click
the Yes button.
1. On the Start page of the Sysmac Studio, select Version Control Explorer.
The Version Control Projects window is displayed.
3. Select the project which you created and then click the Import button.
The selected project is copied to the working folder for version control.
The dialog box asking for attention during Commit operation is displayed.
(Hereafter, this dialog box is omitted in the explanation of operating procedure in this manual.)
5. Confirm the description on the dialog box, select the Don't show this again check box, and then click the OK
button.
The “TortoiseGit” Commit dialog box is displayed.
6. Enter a message that you want to leave as a record in the message area and click the Commit button.
“Push” the project data for version control from the local repository to the remote repository.
1. Right-click the target project in the Version Control Projects window and select TortoiseGit - Push from the
pop-up menu.
2. Select the Push all branches check box, and then click the Manage button under Destination.
A dialog box appears for setting the location of the remote repository of the repository "MachineA".
3. In the Remote field, enter the name of this connection (usually "Origin") and the URL (here, enter the path of
the remote repository created in Section 5.5) and click the Add New / Save button.
5. Confirm the description on the dialog box, select the Don't show this message again check box, and then
click the Yes button.
In the “TortoiseGit” Push dialog box, the connection named “Origin” is set.
This section describes the procedure to change project data and reflect it in the repository.
1. On the Start page of the Sysmac Studio, select Version Control Explorer to open the Version Control
Projects window. Select the project to edit and click the Open button.
2. Modify the project data. In this example, BOOL variables “WorkDetect” and “LightLamp” are added as global
variables and ladder rungs are added in the Program0-Section0.
Apply the changes made to the project to the local repository. This operation is called Commit.
1. Right-click the folder icon in the Multiview Explorer and select Git Commit -> “master” from the pop-up menu.
3. Enter a message that you want to leave as a record in the message area and click the Commit button.
The below dialog shows that Commit is successfully completed.
Apply the changes made to the project in the local directory to the remote repository. This operation is called Push.
1. Right-click the folder icon in the Multiview Explorer and select TortoiseGit - Push from the pop-up menu.
2. Make sure that the Push all branches check box is selected and Remote item is correctly set (“Origin” is set in
this example), and then click the OK button.
When you made a wrong change while editing a project, you might want to restore the previous project data and
resume editing. In that case, you check the change contents of the past projects, change date, person who made
changes, and change history information, or open the projects to identify the project revision to return.
If you use the version control function, you can search for a revision of the project by the following procedure.
In a case that data in the remote repository is the master, it is necessary to update the local repository in the
computer to the latest state.
This section describes the steps to be taken after updating the local repository and remote repository since some
changes were made in the same procedure described in 6.4 Updating the Project.
1. Right-click the target project in the Version Control Projects window and select TortoiseGit - Pull from the
pop-up menu.
2. Make sure that the registered remote name is correctly set (in this example, “Origin” is set) for the “Remote”
item, and then click the OK button.
2. Right-click the folder icon in the Multiview Explorer and select Show Change History for Project from the pop-
up menu.
In the search field at the top of the window, enter the keyword to search.
For example, if you enter "Lamp", only the revisions with message containing “Lamp” are displayed in the list.
You can compare the revision searched and a project which is currently opened.
1. On the “TortoiseGit” Log Messages dialog box, right-click on the target revision and select Compare with
working tree.
The Sysmac Diff dialog box shows up and the project of the selected revision and one currently opened are
compared on it.
The contents with differences are shown with red bars.
Then, the ladder diagrams are displayed, and you can grasp the difference between the revisions.
Open the project of the revision that was searched and restore the project data.
1. Right-click the folder icon in the Multiview Explorer and select TortoiseGit – Show log from the pop-up menu.
2. Select one row after another up to the revision whose contents you want to restore while holding down the Shift
key, right-click it and select Revert change by these commits from the pop-up menu.
In the Message area, comments on the revert processing are automatically displayed.
4. Confirm that the check boxes for all files listed under Changes made are selected, and click the Commit
button.
A dialog box is displayed to indicate the completion of the commit processing.
In order to shorten the development period of controller systems, some projects are carried out concurrently by
multiple developers. This development method is called “development by multiple developers”. In addition, as
variations of production machine increase, it is required to develop a common program for derived machines with
different hardware configurations. This development method is called “derived development”.
This section explains the development by multiple developers and derived development which utilize the version
control function of the Sysmac Studio projects.
• Utilization of version control function in development by multiple developers and derived development
• “Branch” and “Merge” which are essential for development by multiple developers and derived development
• Operating procedure of development by multiple developers and derived development
7.1 Utilization of version control function in development by multiple developers and derived
development
From To
Change records
Since it is can be checked
It takes time to impossible to easily.
know who When a
merge the malfunction occurs,
changed what, To apply the
changes by the project data
it takes time to changes, just
copying and can be compared
fix an issue. check-in the
pasting them GIT with an arbitrary
master.
one by one to revision and cause
the master. can be identified
immediately.
Branch MachineA
Branch MachineB
Branch MachineC
Because it is difficult to
know the derivation
relation of the projects,
when a correction is
The branch tree
made to one project, it
It takes time to shows the
takes time to search It is possible to
apply the derivation
for projects to apply changes compare You can easily
relationship of
the same changes. manually to arbitrary apply the
the projects.
multiple projects. projects and changes to
You can find
the project to check the other projects.
apply the changes.
changes.
If you use the branches in concurrent development by multiple developers or development for version upgrading,
project data can be managed separately so that it does not affect other projects which other developers are editing
or ones for already released products.
In development by multiple developers or derived development, changes made in branches may also be applied to
the original branch.
At this time, we use the function called "merge" that combines the original branch with other branches.
As shown in the above figure, a branch main is created to be the starting point. From the main branch, to carry
out development for “requirement a” and” b” concurrently, create feature a, a branch for “requirement a” and
feature b, a branch for “requirement b”.
When development in both branches is completed and satisfactory quality is achieved, merge them to the main
branch.
As shown in above figure, when you develop A2 which is a derivative product of product A1, create a branch
Product A2 from the change set of branch Product A1 at the time of product release.
When a problem occurs in product A1 and it is necessary to modify the project, create a branch Fix Bug 12345
for defect correction from the change set at the time of product A1 release. When quality is secured in the
branch, merge it to the original branch Product A1.
If it is necessary to apply this modification not only to Product A1 but also to Product A2, you can apply the
changes in the branch Fix Bug 12345 all together to the branch Product A2. Merge the change set of branch for
Product A1 after merging fix bug branch into the branch of Product A2.
This section describes how to develop the Sysmac Studio project concurrently by multiple developers, example of
sharing the development works and operation procedure.
The version control function has a feature to help multiple developers to edit one project concurrently and to
combine their changes when they “Push” their changes to the remote repository.
However, if multiple developers edit the same portion at the same time and try to merge the changes, a conflict
occurs and merging fails. To avoid this problem, a specific developer edits the data which does not support the
development by multiple developers (“No” in below table), and data which allows multiple developers to edit (“Yes”
in below table) can be edited by multiple developers.
This section describes how to divide the roles of developers and the scenario as a prerequisite of the next section.
Developer A
Developer A
Developer B
Developer A
The Developer A and B work on above mentioned tasks of the project in the procedure of the below table.
No. Developer A tasks Developer B tasks Reference for the tasks
1 Register a project in the remote - 7.3.3.1 Register a project in the
repository remote repository (No.1:
*Developer A registers the base project in the Developer A)
repository.
2 Load the project from the remote - 7.3.3.2 Load the project from the
repository remote repository (No.2:
Developer A)
3 Configure Configurations and Setup - 7.3.3.3 Commit the project in
4 Set the Data Types, Global Variables, - which Configurations and Setup,
and program POUs Data Types, Global Variables,
5 Commit the project in which - and program POUs are
Configurations and Setup, Data registered (No. 3,4,5: Developer
Types, Global Variables, and program A)
POUs are registered
6 Push the changes in the local - 7.3.3.4 Push the changes in the
repository to the remote repository local repository to the remote
*After this operation, Developer A and B can repository (No.6: Developer A)
concurrently edit the project data.
7 Create the working branch of ・ Copy the target project in the <Developer A>
Developer A in the local repository 7.3.3.6 Create the working branch
remote repository to the of Developer A (No.7 Developer
computer of Developer B and A)
create the local repository <Developer B>
・ Create the working branch 7.3.3.5 Create the local repository
in the Developer B computer
(No.7: Developer B)
7.3.3.9 Create the working branch
of Developer B (No.7: Developer
B)
8 Develop Program A Develop Program B 7.3.3.7 Commit changes of
Add Global Variables Change the initial values of Program A and Global Variables
Global Variables to the working branch (No.8, 9:
9 Commit changes of Program A and Commit changes in Program B Developer A)
Global Variables to the working and Global Variables to the 7.3.3.10 Commits changes of
branch working branch Program B and Global Variables
to the branch (No.8, 9: Developer
B)
10 Merge the changes of working branch - 7.3.3.8 Merges the changes of
to the main branch working branch to the main
* The project in the local repository created in branch (No.10: Developer A)
No,1 is the main branch of Developer A.
11 Push the changes in the local - 7.3.3.11 Push the changes in the
repository of Developer A to the local repository of Developer A to
remote repository the remote repository (No.11:
* After this operation, changes made by Developer A)
Developer A and B can be merged.
12 - Obtain the latest data from the 7.3.3.12 Merges the changes in
main branch and merge it to the working branch of Developer
Developer B’s working branch. B to the main branch (No.12:
Then, remerge the data after Developer B)
merging to the main branch
13 - Push the changes in the main 7.3.3.13 Push the changes in the
branch of Developer B from the main branch of Developer B to
local repository to the remote the remote repository (No.13:
repository Developer B)
-: No task
The numbers next to ◯ in the figure correspond to the task numbers of Developers A and B shown in the above
table.
Remote Repository
6 11 13
1
This section explains the operating procedure along with the description in 7.3.2.2 Scenario.
2. Registering the local repository and creating and saving the base project
Create a new project and register it in the local repository.
Here, create a project “MachineA” in the Developer A’s computer, commit it to the local repository, and then
push it to the remote repository.
Refer to 6.3 Preparing for Starting Project Control (Creating a Base Project and Saving It) for details.
7.3.3.2 Load the project from the remote repository (No.2: Developer A)
After the project is registered in the remote repository, there is a possibility that other developers are updating the
target project of the remote repository. In order to synchronize the local repository in the Developer A’s computer
with the remote repository which functions as the master, take the following steps.
1. On the Start page of the Sysmac Studio, select Version Control Explorer and open the Version Control
Projects window.
2. Right-click the MachineA and select TortoiseGit - Pull from the pop-up menu.
3. Check that “Origin” is selected in Remote (the path to the remote repository is set as C:\Git\MachineA.git) and
click the OK button.
7.3.3.3 Commit the project in which Configurations and Setup, Data Types, Global Variables, and program
POUs are registered (No. 3,4,5: Developer A)
1. Select the project MachineA in the Version Control Explorer, and then click the Open button.
The new project is opened.
3. In order to Commit it to the local repository, right-click the folder icon in the Multiview Explorer and select Git
Commit -> “master” from the pop-up menu.
5. Enter comment in the Message area and click the Commit button.
Commit is completed.
8. In order to Commit them to the local repository, right-click the folder icon in the Multiview Explorer and select Git
Commit -> “master” from the pop-up menu.
A confirmation dialog box is displayed.
10. Enter comment in the Message area and click the Commit button.
11. Click the Close button in the Complete Commit dialog box.
13. Commit the POUs in the same way as data types and global variables were committed.
7.3.3.4 Push the changes in the local repository to the remote repository (No.6: Developer A)
Before Developer B starts working concurrently with Developer A, Developer A pushes his/her working result of
common data (Configurations and Setup, Data Types, Global Variables, and program POUs) to the remote
repository.
1. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window, and select TortoiseGit - Push.
2. Make sure that the Push all branches check box is selected and Remote item is correctly set (“Origin” is set in
this example), and then click the OK button.
7.3.3.5 Create the local repository in the Developer B computer (No.7: Developer B)
By the operation so far, data that Developer A edited (Configurations and Setup, Data Types, and Global Variables)
has been registered in the remote repository.
From this point forward, in order to make it possible for Developer B to work concurrently, obtain the target project
from the remote repository and create a local repository in the Developer B's computer.
It is assumed that setup and basic settings of software in the Developer B's computer have been completed.
2. Right-click on the arbitrary position in the VC folder and select Git Clone.
After the project was registered in the remote repository, there is a possibility that other developers are updating the
target project in the remote repository. In order to synchronize the local repository in the Developer A’s computer
with the remote repository which functions as the master, take the following steps.
1. On the Start page of the Sysmac Studio, select Version Control Explorer and open the Version Control
Projects window.
2. Right-click the MachineA and select TortoiseGit - Pull from the pop-up menu.
The “TortoiseGit” Pull dialog box is displayed.
5. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window, and select TortoiseGit - Create Branch.
7. To confirm that the branch has been created, right-click the folder icon in the MultiView Explorer or the project in
the Version Control Projects window and select TortoiseGit - Show log.
7.3.3.7 Commit changes of Program A and Global Variables to the working branch (No.8, 9: Developer A)
Switch the branch to work on in the Developer A’s computer and modify Program A and global variables.
1. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window, and select TortoiseGit - Switch/Checkout.
2. Select Branch option and ProgramA_work which is the working branch of Developer A created in 7.3.3.6
Create the working branch of Developer A (No.7 Developer A), and then click the OK button.
4. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window. You can check that the branch name that follows Git Commit -> is changed.
5. Develop the ProgramA and modify the settings of the Global Variables.
Here, the following edits were made.
Add new Global Variable “P1_Input2”.
6. From the Main menu, select File - Save to save the project.
8. Right-click the target project in the Version Control Projects window and select Git Commit ->
“ProgramA_work” from the pop-up menu.
7.3.3.8 Merges the changes of working branch to the main branch (No.10: Developer A)
Switch the branch you work on to the main branch and then merge the changes in the working branch to the main
branch.
1. Right-click the target project in the Version Control Projects window and select TortoiseGit -
Switch/Checkout from the pop-up menu.
4. To merge the changes to the main branch, right-click the target project in the Version Control Projects window
and select TortoiseGit - Merge from the pop-up menu.
5. Select Branch option, then the working branch ProgramA_work to merge to the main branch master, and then
click the OK button.
7. Right-click the folder icon in the MultiView Explorer or the project in the Version Control Projects window and
select TortoiseGit - Show log.
The “TortoiseGit” Log Messages dialog box is displayed.
On the top of the upper pane, ProgramA_work and master are shown, and in the middle pane Add Global
variable ‘P1_Input2 and Add LD in ProgramA are indicated. You can know that it is the latest revision of the
After registering the local repository in the Developer B’s computer, there is a possibility that other developers are
updating the target project in the remote repository. In order to synchronize the local repository in the Developer B’s
computer with the remote repository which functions as the master, take the following steps.
1. On the Start page of the Sysmac Studio, select Version Control Explorer and open the Version Control
Projects window.
2. Right-click the MachineA and select TortoiseGit - Pull from the pop-up menu.
The “TortoiseGit” Pull dialog box is displayed.
3. Check that Origin is selected in Remote (the path to the remote repository is set as
\\SLRA0383\Git\MachineA.git in this explanation) and click the OK button.
5. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window, and select TortoiseGit - Create Branch.
The “TortoiseGit” Create Branch dialog box is displayed.
6. Enter the branch name (in this example, ProgramB_work), and click the OK button.
For Base On, select the latest revision. Select Head (master).
7. Right-click the folder icon in the MultiView Explorer or the project in the Version Control Projects window and
select TortoiseGit - Show log.
The “TortoiseGit” Log Messages dialog box is displayed.
On the top of the upper pane, ProgramB_work, master, origin/master and origin/HEAD are shown. You can
know that the working branch ProgramB_work was successfully created.
This line shows that the changes named as Add and Modify Program POUs applied in the latest revision by
Developer A exists in ProgramB_work which is the working branch of the Developer B’s local repository, the
main branch master, and the master in the remote repository (connecting to Origin).
Switch the branch to work on in the Developer B’s computer and modify Program B and Global Variables.
1. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window, and select TortoiseGit - Switch/Checkout.
The “TortoiseGit” Switch/Checkout dialog box is displayed.
2. Select Branch option and ProgramB_work which is the working branch of Developer B created in 7.3.3.9
Create the working branch of Developer B (No.7: Developer B), and then click the OK button.
4. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window.
6. From the Main menu, select File - Save to save the project.
8. Right-click the target project in the Version Control Projects window and select Git Commit ->
“ProgramB_work” from the pop-up menu.
7.3.3.11 Push the changes in the local repository of Developer A to the remote repository (No.11:
Developer A)
In order to merge the changes made by Developer A and Developer B, first push the changes in the Developer A’s
local repository to the remote repository, and then apply the changes in the remote repository to the Developer B’s
local repository. Then, merge the changes of Developer B.
This section explains how to push changes in Developer A's local repository to the remote repository.
1. Right-click the target project in the Version Control Projects window and select TortoiseGit - Push from the
pop-up menu.
2. Make sure that the Push all branches check box is selected and Remote item under Destination is correctly
set (“Origin” is set in this example), and then click the OK button.
7.3.3.12 Merges the changes in the working branch of Developer B to the main branch (No.12: Developer
B)
Switch the branch you work on to the main branch and then acquire the changes made by Developer A from the
remote repository. After that, switch to the working branch of Developer B and merge the changes made by
Developer A in the main branch to the working branch of Developer B. Since the changes made by Developer A
conflict with the changes of Developer B, merge processing fails. In this case, resolve the conflicts and complete
merging.
1. Right-click the target project in the Version Control Projects window and select TortoiseGit -
Switch/Checkout from the pop-up menu.
2. Select Branch option, then master (main branch), and click the OK button.
4. Since the remote repository includes the changes made by Developer A, take the following steps to synchronize
the remote repository and the local repository of the Developer B’s computer.
On the Start page of the Sysmac Studio, select Version Control Explorer and open the Version Control
Projects window.
5. Right-click the MachineA and select TortoiseGit - Pull from the pop-up menu.
6. Check that Origin is selected in Remote (the path to the remote repository is set as
\\SLRA0383\Git\MachineA.git in this explanation) and click the OK button.
8. Next, switch to the ProgramB_work in order to merge the changes made by Developer A in the main branch
master to the working branch of Developer B ProgramB_work. Right-click the target project in the Version
Control Projects window and select TortoiseGit - Switch/Checkout from the pop-up menu.
9. Select Branch option and ProgramB_work which is the working branch of Developer B, and then click the OK
button.
11. Right-click the target project in the Version Control Projects window and select TortoiseGit - Merge from the
pop-up menu. The “TortoiseGit” Merge dialog box is displayed.
12. Select Branch option, then the main branch master to merge it to the working branch ProgramB_work, and click
the OK button.
Merge fails.
14. Right-click the target project in the Version Control Projects window and select TortoiseGit - Resolve
Conflicted by Preferring Theirs from the pop-up menu.
The menu Resolve Conflicted by Preferring Theirs forcibly merges the data with a conflict caused by
changes made in the same files. This command prioritizes the changes in merge target data specified in the
From section in the “TortoiseGit” Merge dialog box, assuming that changes in the merge source data are invalid.
In this example, changes in the master are given priority in merge processing.
In this explanation, a conflict occurred in the Global Variables. If you select Resolve Conflicted by Preferring
Theirs menu, merge result is shown on the Sysmac Diff dialog box.
15. Click the ... button of the Global Variables with conflicts.
The Detailed Comparison dialog box is displayed.
The data of the working branch ProgramB_work (changes of Developer B) before merging is displayed on the
left pane and the right pane shows the data being edited to which data was merged preferring the main branch
(changes of Developer A).
17. Click the Copy Selected from Left to Right button. The value of variable Parameter1 is set to the data being
edited on the right pane.
19. Make sure there is no other conflict (with purple bar) and click the Close button.
When the project is opened, you can find, in the working branch ProgramB_work, the variable P1_Input2 which
was registered by Developer A.
The conflict was resolved and changes made by Developer A and B were successfully merged.
20. Next, commit the changes (merge result) to the local repository. Right-click the folder icon in the Multiview
Explorer and select Git Commit -> “ProgramB_work” from the pop-up menu.
When the project is not yet saved, a confirmation dialog box is displayed to ask if you need to save the project.
Click the Yes button.
The following dialog box is displayed with the “TortoiseGit” Commit dialog box.
22. The Message area of the “TortoiseGit“Commit dialog box automatically shows comments that conflicts occurred
when merging the branches. If necessary, add or change comments in the Message area and click the Commit
button.
24. Then, switch to the main branch and apply it the data in the branch ProgramB_work after merging.
Right-click the target project in the Version Control Projects window and select TortoiseGit -
Switch/Checkout from the pop-up menu.
27. Right-click the target project in the Version Control Projects window and select TortoiseGit - Merge from the
pop-up menu.
28. Select Branch option, then the working branch ProgramB_work to merge it to the main branch master, and click
the OK button.
30. Right-click the folder icon in the Multiview Explorer and select TortoiseGit - Show log from the pop-up menu.
The “TortoiseGit” Log Messages dialog box is displayed.
On the upper pane, you can know that the edits made by Developer B on the working branch PrgramB_work
have been merged to the main branch master. Click the OK button to close the dialog box.
7.3.3.13 Push the changes in the main branch of Developer B to the remote repository (No.13: Developer
B)
Apply (Push) the changes merged in the Developer B’s computer into the remote repository.
1. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window, and select TortoiseGit - Push.
2. Make sure that the Push all branches check box is selected and Remote item under Destination is correctly
set (“Origin” is set in this example), and then click the OK button.
On the upper pane, you can find that the edits made by Developer B on the working branch PrgramB_work are
taken into the main branch master and the master of the remote repository (origin) also synchronizes. Click the
OK button to close the dialog box.
This section describes the operating procedure to promote derived development of Sysmac Studio projects on an
example.
This example uses a configuration in which the remote repository is shared using the shared folder.
In this example, Machine B is developed and derived from Machine A. While the Machine B is being developed,
defects were found and corrected in the common program of Machine A and Machine B. The correction is applied to
the project of Machine B to complete the development.
It is assumed that, based on the project of Machine A, one developer develops a project of derivative Machine B.
ProjectA: the project of Machine A. On the base of this project, the project of the derived Machine B is developed.
ProjectB: the project of Machine B derived from Machine A project. It has different configurations and setup. This
project utilizes the same program as that of ProjectA.
7.4.1.2 Scenario
Create and manage branches master, ProductA, and ProductB; master is for common program management,
ProductA is for Machine A, and ProductB is for Machine B. The common program is modified in the master and the
changes are applied to the ProductA and ProductB.
1. In the development of Machine A, create a new project ProjectA and incorporate it into the Machine A as
Ver.1.0. Register this ProjectA to the master as the master project of derivation development.
2. In the development of Machine B, create ProjectB on the base of ProjectA Ver.1.0 and change the settings in
Configurations and Setup.
3. Defects are found in the program of Machine A and the program is modified to fix them. Modify the program in
the master project and apply the corrections to the Machine A as Ver.1.1.
4. In the same way, apply the corrections to the ProjectB which is being developed and incorporate it to the
Machine B as its Ver.1.0.
No. Machine A development Machine B development Correction of Reference for the tasks
defects
1 Register a project in the - - 7.4.3.1 Register a project in
remote repository the remote repository (No.1:
Machine A development)
2 Create a branch for Machine - - 7.4.3.2 Create a branch for
A in the local repository and Machine A in the local
push it to the remote repository and push it to the
repository remote repository (No.2:
* The project of Machine A is Machine A development)
developed in this branch.
3 Create the program of - - 7.4.3.3 Create the program of
Machine A, commit it, and Machine A, commit it, and
push it to the remoter push it to the remoter
repository repository (No.3: Machine A
* The tag as Ver.1.0 is applied development)
to this project and the project is
incorporated in the Machine A.
4 Merge the changes in the - - 7.4.3.4 Merge the changes in
master
1 4 8
(V1.0) (V1.1)
Machine A branch
(ProductA) 2 3 9
(V1.0)
Machine B branch
(ProductB)
5 10
Local Repository
master
1 8
4
Branch for correcting
defects
(BugFix) 7 8
Machine A branch
(ProductA) 2 3 9
Machine B branch
(ProductB) 5 6 10
2. Registering a local repository and creating and saving the base project
Create a new project and register it in the local repository.
Here, create a project MachineA, commit it to the local repository, and then push it to the remote repository.
Refer to 6.3 Preparing for Starting Project Control (Creating a Base Project and Saving It) for details.
2. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window, and select TortoiseGit - Create Branch.
3. Enter the branch name (in this example, ProductA), and click the OK button.
For Base On, select the latest revision. Select Head (master).
4. Push the created branch ProductA from the local repository to the remote repository. For the procedure to push
the project data to the remote repository, refer to 6.4.3 Registering the Changes to the Remote Repository
(Push).
7.4.3.3 Create the program of Machine A, commit it, and push it to the remoter repository (No.3: Machine
A development)
Switch the working branch on the developer’s computer and register Global Variables and create programs. After
creation, consider this as a finished data and apply the tag as "Version 1.0". Then, push this to the remote
repository.
1. Switch to the branch for Machine A ProductA to edit it. For the procedure to switch to the branch to edit, refer to
7.3.3.7 Commit changes of Program A and Global Variables to the working branch (No.8, 9: Developer A).
2. Create the program for the product A. The figure below illustrates an example of the program.
3. From the Main menu, select File - Save to save the project.
5. Right-click the target project in the Version Control Projects window and select Git Commit -> “ProductA”
from the pop-up menu.
6. Enter comment in the Message area and click the Commit button.
Commit is completed.
8. Right-click the target project in the Version Control Projects window and select TortoiseGit - Create Tag
from the pop-up menu.
10. Right-click the folder icon in the MultiView Explorer or the project in the Version Control Projects window and
select TortoiseGit - Show log.
The “TortoiseGit” Log Messages dialog box is displayed.
11. You can see that the tag name is displayed in the Working tree changes field.
12. Push the changes (entry of a program) in the branch of Machine A from the local repository to the remote
repository. Refer to 6.4.3 Registering the Changes to the Remote Repository (Push) for details of the procedure.
In the “TortoiseGit” Push dialog box, select the check box for Include Tags under Options, and then click the
7.4.3.4 Merge the changes in the Machine A into the master in the local repository and push it to the
remote repository (No.4: Machine A development)
Switch to the master branch and then merge the changes in the the Machine A branch ProductA into the master
branch.
1. Switch to the master branch to edit it. For the procedure to switch to the branch to edit, refer to 7.3.3.7Commit
changes of Program A and Global Variables to the working branch (No.8, 9: Developer A).
2. To merge the changes to the master branch, right-click the target project in the Version Control Projects
window and select TortoiseGit - Merge from the pop-up menu.
3. Select Branch option, then the working branch ProductA, and click the OK button.
In this scenario, since the contents of the ProductA branch and Tag V1.0 are the same, you can also select Tag
option and V1.0.
5. Push the changes (entry of program) in the branch of Machine A from the local repository to the remote
repository. For the procedure to push the project data to the remote repository, refer to 6.4.3 Registering the
Changes to the Remote Repository (Push).
7.4.3.5 Create a branch for Machine B in the local repository and push it to the remote repository (No.5:
Machine B development)
Here, create a branch ProductB from the master, and then push the changes to the remote repository. For details
on the series of procedure, refer to 7.4.3.2 Create a branch for Machine A in the local repository and push it to the
remote repository (No.2: Machine A development).
In the “TortoiseGit” Create Branch dialog box, configure the settings as follows.
Create the ProductB branch in the local repository and then push this change to the remote repository.
After Push operation, the “TortoiseGit” Log Messages dialog box is displayed as shown below.
7.4.3.6 Modify the settings in Configurations and Setup of the Machine B and commit them (No.6:
Machine B development)
Create the project for the Machine B and commit it. In this scenario, it is assumed that Machine B project is
developed on the base of Machine A project and they utilize the same program, but their Configurations and Setup
differ.
1. Switch to the branch of Machine B to edit it. For the procedure to switch to the branch to edit, refer to 7.3.3.7
Commit changes of Program A and Global Variables to the working branch (No.8, 9: Developer A).
In the “TortoiseGit” Switch/Checkout dialog box, select Branch option and ProductB.
2. Modify the settings in Configurations and Setup for the Machine B. For example, add an EtherCAT slave.
5. Right-click the target project in the Version Control Projects window and select Git Commit -> “ProductB”
from the pop-up menu.
6. Enter comment in the Message area and click the Commit button.
Commit is completed.
7.4.3.7 From the master in the local repository, create a branch for correcting defects (No.7: Correction of
defects)
In order to apply correction of defects found in the Machine A to the Machine B, fix defects in the BugFix branch that
is branched from the master. First create the BugFix branch.
1. Switch to the master branch to edit it. For the procedure to switch to the branch to edit, refer to 7.3.3.7 Commit
changes of Program A and Global Variables to the working branch (No.8, 9: Developer A).
2. Right-click the folder icon in the Multiview Explorer or on the target project in the Version Control Projects
window, and select TortoiseGit - Create Branch.
3. Enter the branch name (in this example, enter BugFix), and click the OK button.
For Base On, select the latest revision. Select Head (master).
7.4.3.8 Commit correction of the defects, merge it to the master and push it to the remote repository
(No.8: Correcting defects)
Switch to the BugFix branch and modify the program. After that, merge the changes to correct defects to the master,
and push it to the remote repository.
1. Switch to the BugFix branch to fix the defects. For the procedure to switch to the branch to edit, refer to 7.3.3.7
Commit changes of Program A and Global Variables to the working branch (No.8, 9: Developer A).
3. From the Main menu, select File - Save to save the project.
5. Right-click the target project in the Version Control Projects window and select Git Commit -> “BugFix” from
the pop-up menu.
8. Switch to the master branch to edit it. For the procedure to switch to the branch to edit, refer to 7.3.3.7 Commit
changes of Program A and Global Variables to the working branch (No.8, 9: Developer A).
9. To merge the changes in the BugFix branch to the master branch, right-click the target project in the Version
Control Projects window and select TortoiseGit - Merge from the pop-up menu.
10. Select Branch option, then the BugFix branch, and click the OK button.
13. Push the changes in the branch to correct defects and master branch from the local repository to the remote
repository. For the procedure to push to the remote repository, refer to 6.4.3 Registering the Changes to the
Remote Repository (Push).
7.4.3.9 Merge correction of defects into the branch of the Machine A and push it to the remote repository
(No.9: Machine A development)
Merge the changes to fix defects of the Machine A merged into the master to the branch of Machine A. After
merging, consider this as a finished data after correcting defects and apply the tag as "Version 1.1". Then, push this
to the remote repository.
1. Switch to the branch for Machine A ProductA to edit it. For the procedure to switch to the branch to edit, refer to
7.3.3.7Commit changes of Program A and Global Variables to the working branch (No.8, 9: Developer A).
2. To merge the changes to the ProductA branch, right-click the target project in the Version Control Projects
window and select TortoiseGit - Merge from the pop-up menu.
3. Select Branch option, then master of the master branch, and click the OK button.
5. Right-click the target project in the Version Control Projects window and select TortoiseGit - Create Tag from
the pop-up menu.
The “TortoiseGit” Create Tag dialog box is displayed.
6. Enter the version No. or other text string to identify the tag in the Tag text box and click the OK button. In this
example, enter V1.1.
7. Push the changes in the branch of Machine A (applying defect correction) from the local repository to the
remote repository. Refer to 6.4.3 Registering the Changes to the Remote Repository (Push) for details of the
procedure.
In the “TortoiseGit” Push dialog box, select the check box for Include Tags under Options, and then click the
OK button.
Merge modifications to correct defects in Machine A merged into the master to the branch of the Machine B. After
merging, consider this as a finished program of the Machine B and apply the tag as "Version 1.0". Then, push this to
the remote repository.
1. Switch to the ProductB branch of the Machine B to edit it. For the procedure to switch to the branch to edit, refer
to 7.3.3.7 Commit changes of Program A and Global Variables to the working branch (No.8, 9: Developer A).
2. To merge the changes to the ProductB branch, right-click the target project in the Version Control Projects
window and select TortoiseGit - Merge from the pop-up menu.
The “TortoiseGit” Merge dialog box is displayed.
Merging is completed.
6. Right-click the target project in the Version Control Projects window and select TortoiseGit - Create Tag from
the pop-up menu.
The “TortoiseGit” Create Tag dialog box is displayed.
7. Enter the version No. or other text string to identify the tag in the Tag text box and click the OK button. In this
example, enter ProductB_V1.0.
8. Push the changes (changing Configurations and Setup and applying defect correction) in the branch of Machine
B from the local repository to the remote repository. Refer to 6.4.3 Registering the Changes to the Remote
Repository (Push) for details of the procedure.
In the “TortoiseGit” Push dialog box, select the check box for Include Tags under Options, and then click the
OK button.
In the Message field, you can know that changes made in the BugFix branch were applied to the master branch
and ProductA branch, and contents in the master branch (reflection of changes in BugFix branch) is applied to
the ProductB branch.
OMRON ASIA PACIFIC PTE. LTD. OMRON (CHINA) CO., LTD. © OMRON Corporation 2017 All Rights Reserved.
No. 438A Alexandra Road # 05-05/08 (Lobby 2), Room 2211, Bank of China Tower, In the interest of product improvement,
Alexandra Technopark, 200 Yin Cheng Zhong Road, specifications are subject to change without notice.
Singapore 119967 PuDong New Area, Shanghai, 200120, China
Tel: (65) 6835-3011/Fax: (65) 6835-2711 Tel: (86) 21-5037-2222/Fax: (86) 21-5037-2200 Cat. No. P125-E1-01 1017