Install the PLC-CFX Gateway
Getting started: installation prerequisites
Before you begin, ensure that Microsoft SQL Server Management Studio is already installed on the computer where you will install the PLC-CFX Gateway and create the gateway database.
Copy the gateway installation files to the target machine
- On the gateway target machine, create this folder:
C:\Program Files (x86)\Aegis\PLCGateway\ - Copy the contents of the PLC-CFX Gateway Installation folder into the PLCGateway folder on the target machine.
Install the .NET 6 hosting bundle
- Download and install the .NET 6 Hosting Bundle which includes the .NET runtime and IIS support and is located here (under the heading ASP.NET Core Runtime 6.0.xx):
https://dotnet.microsoft.com/en-us/download/dotnet/6.0.
Create and configure the SQL database
Open Microsoft SQL Server Management Studio (SSMS).
- Create and name a new SQL database, for example PLC-CFX Gateway.
- Create a new user named AegisSQL.
Create ASP.NET core services
Start Windows PowerShell ISE (select Run as Administrator).
Edit the following script by entering the appropriate details for the following line: $userName = "[ComputerNameOrDomain]\[UserName]"
1 $exeFolder = "C:\Program Files (x86)\Aegis\PLCGateway\"
2 $exePath = "C:\Program Files (x86)\Aegis\PLCGateway\Aegis.CFX.Gateway.Web.Server.exe"
3 $userName = "[ComputerNameOrDomain]\[UserName]"
4 $serviceName = "Aegis PLC Gateway Service"
5 $serviceDesc = "IIoT Service Connecting PLCs to CFX enabled systems"
6 $acl = Get-Acl $exeFolder
7 $aclRuleArgs = $userName, "Read,Write,ReadAndExecute", "ContainerInherit,ObjectInherit", "None", "Allow"
8 $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($aclRuleArgs)
9 $acl.SetAccessRule($accessRule)
10 $acl | Set-Acl $exeFolder
11 New-Service -Name $serviceName -BinaryPathName ($exePath + " --contentRoot " + $exePath) -Credential $userName -Description $serviceDesc -DisplayName $serviceName -StartupType AutomaticSave your changes.
Execute the Powershell script and the Aegis PLC Gateway Service will be created.
Create the database configuration
- Download and install the hosting bundle of the latest version of .NET 6 ASP.NET Core Runtime.
- Create a new local or domain user account with local administrator rights on the target machine (or use an existing FactoryLogix service account).
- Create the ‘CreateASPNETCoreServices’.
- Right-click PLCGateway\AegisCFXGateway.pfx, then select Install PFX.
- Select Local Machine.
- Select Use Password GatewayAdmin123* .
- Select “Place Certificate in the Following Store…”, select “Trusted Root Certification Authorities”, then finish the wizard.
- Edit the appsetttings.json file in PLCGateway folder (see the following topic).
- Set the database connection string and PLCCFXGateway Server details.
- Go to services.msc to open the Services window.
- Right-click the Aegis PLC Gateway Service and select Start to start the service.
- Open a browser and navigate to https://localhost:5251.
- Log in using the following credentials:
ID: admin
password: GatewayAdmin123*
Configure the appsetting.json file
- Open the appsettings.json file located in the PLC-CFX Gateway installation folder.
Replace the bold items in square brackets [ ] as shown below:
{
/*
The following identity settings need to be configured
before the project can be successfully executed.
For more info see https://aka.ms/dotnet-template-ms-identity-platform
*/
"IdentityServer": {
"Key": {
"Type": "File",
"FilePath": "AegisCFXGateway.pfx",
"Password": "GatewayAdmin123*"
},
"Clients": {
"Aegis.CFX.Gateway.Web.Client": {
"Profile": "IdentityServerSPA"
}
}
},
"ConnectionStrings": {
"DefaultConnection": "Server=[DB Server];Database=[DB Name];MultipleActiveResultSets=True;User Id=[Username];Password=[Password];",
},
"Logging": {
"LogLevel": {
"Default": "Trace",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Kestrel": {
"Endpoints": {
"Http": {
"Url": "http://[PLCCFXGatewayServer]:5250"
},
"HttpsInlineCertFile": {
"Url": "https://[PLCCFXGatewayServer]:5251",
"Certificate": {
"Path": "AegisCFXGateway.pfx",
"Password": "GatewayAdmin123*"
}
},
}
},
"PagingData": {
"PageSize": 25
}
}- Save your changes.
Copyright © 2024 Aegis Industrial Software Corporation. All Rights Reserved.