Join us today!

SCM Environment - T...
 
Notifications
Clear all

SCM Environment - TwinCat

18 Posts
5 Users
11 Likes
919 Views
raoliveira
Posts: 27
Topic starter
(@raoliveira)
Eminent Member
Joined: 2 years ago

Hei there huys.

I will open this topic in this "sub"forum because i think it suits here, but the admin could move it if this is not the right place :-).

 

So, like i said yesterday, i'm encharged to built a Source Control Environment for our Beckhoff PLCs and some other (german) brand. In this topic i'll try to mention my progress everytime i can, but for now i will tell what i have done in this past 2 weeks...for now.

Like i said, i'm new to the PLC world, but it's software :-), so, it should be easier adaptation since i have the previous (backend C#, Java, Python, JavaScript, bla bla...) knowledge.

Short resume for the environment requirements:

* Version Control;

* CI/CD;

* Pipelines;

* Unit tests;

* I/O tests;

* Safety tests;

* Metrics;

* Analytics;

At the moment my tests are laid down to GitHub, GitLab, Jenkins and Azure. Tests are beeing made in a VMachine and sometimes without VM. Already played a little bit with VersionDog and i'm still waiting for a 2nd meeting with the guys from Copia. All of these technologies are trial software, so as you can imagine it's a painfull task to test/experiment/use and abuse of these tools to achieve the best for the company interests.

Following the blog from the great Jakob Sagatowski - https://alltwincat.com/author/jakob/, i could say it was a really good start.

I successfully achieve the task of run TcUnit - Runner framework to make the Unit Tests (with GitHub Actions and Jenkins also, Azure haven't got the time yet), but this is only the first step, there's still a long path. Of course i have play with all of the options available by Jakob regarding Jenkins slave and solving some issues regarding to comunications between these technologies and some other problems that hate my last few hairs :-(, but hey, this is why it is called engineering right :-)?!

This week i started to connect to the physical hardware to reproduce the same tests, because the first contact/tests were made without PLC connected. But i'm having some problems about router connections with the VMare machine. Since i'm still waiting for my admin account permissions (Windows account), as you guys can imagine it's quite frustrating to be able to work like this (every single configuration ask admin privileges....bahahhhhh)...

=> So, at the moment i need advice on how to connect my PLC to the VMare machine? I tryied bridge connection but i lost Internet connection that i need to commit to GitHub. I added a new virtual network and put it to NAT and the other bridged and i could connect last Wednesday, now i can't comunicate no more. Outside the VMare machine i have no problems at all, to stablish the router communication.

Suggestions?

Reply
17 Replies
2 Replies
TwinControls
Admin
(@beckhoffsupport)
Joined: 2 years ago

Member
Posts: 71

@raoliveira Thank you for sharing your progress so far! It's the right sub forum 🙂  I am sure it will be great for everyone to learn more about your journey. 

You can use the Bridged network to connect to the IPC and you can buy an affordable Wifi adapter to give your VM internet access. When you connect the Wifi adapter to your computer, select the virtual machine option, not host. 

bridged
Reply
raoliveira
(@raoliveira)
Joined: 2 years ago

Eminent Member
Posts: 27

@beckhoffsupport, thank you for your suggestion, i'll give it a try next monday 👍 . But i also can say that i have tried with VMnet08(host), and after a broadcast search i saw the ethernet PLC connection, but it gaves me AdsError 1796 if i remember.

After a quick research, i read arround that the cause could be a previous connection with the "raw" PC operating system, so i removed that connection and tried again, but same error, couldn't connect the VMachine to the CX5240 PLC.

Now i'm at home and have to study Danish language hehe, and after that will play a little more with TwinCat configurations (physical hardware stays at work).

I'll keep you guys updated.

Reply
raoliveira
Posts: 27
Topic starter
(@raoliveira)
Eminent Member
Joined: 2 years ago

Hey there guys.

Anyone uses GitLab to build some pipelines? If so, i need a little help on how the WTF i can call batch files?

At the moment i'm calling like this:

script:
    - C:\Program Files (x86)\TcUnit-Runner\LaunchTcUnit.bat
 
 but runner gives me:
 
$ C:\Program Files (x86)\TcUnit-Runner\LaunchTcUnit.bat
18'C:\Program' is not recognized as an internal or external command,
19operable program or batch file.
21Cleaning up project directory and file based variables00:00
23ERROR: Job failed: exit status 9009
Reply
raoliveira
Posts: 27
Topic starter
(@raoliveira)
Eminent Member
Joined: 2 years ago

UPDATE

just needed to add the batch file to the repo and call it directly

 

script:

  - call LaunchTcUnit.bat

 

At least the file it's called...but lets see the result...

Reply
raoliveira
Posts: 27
Topic starter
(@raoliveira)
Eminent Member
Joined: 2 years ago

Yeah, it works 😀 😎 

Just need to add the AmsNetId for machine with TwinCat to run:

 

script:
    - call LaunchTcUnit.bat -a <AmsNetId_from_machine>
 
some minor issues to fix, but the results from the pipeline
Reply
raoliveira
Posts: 27
Topic starter
(@raoliveira)
Eminent Member
Joined: 2 years ago

UPDATE

Next week i'll start setting up the environment so the team can work and do some testings with the technologies i've been playing around.

I'll use GitHub and Azure for now, and will integrate Jenkins by the middle so, stay tuned for new updates.

 

P.S: Does anyone have an ideia on what is the best way to test the I/O and Safety for the PLC 🙄 ?!

Reply
2 Replies
rruiter
(@rruiter)
Joined: 2 years ago

Estimable Member
Posts: 63

@raoliveira maybe my article on creating a digital twin can help you out here?

Reply
raoliveira
(@raoliveira)
Joined: 2 years ago

Eminent Member
Posts: 27

Thank you @rruiter, i'll take a look 👍

Reply
Page 1 / 2
Share: