FactoryStudio projects can run several different ways:
|On this page:|
You can run the project in any of the following ways:
To define a project so it automatically starts, use the configuration interface available in the project management tools that are located on the Server tab.
We recommend that you manually start your project during development and installation because an operator is needed during these stages. Automated startup is more suitable when the project is setup for production.
The startup shortcut, a login option, should be used when testing a project or when the project has to always run in the same Windows user profile.
The Windows Service can be used on production servers that need different Windows user to login to the computer and keep the server side runtime components running at all times.
In order to be fully OPC compliant, we support OPC client activation. However, we do not recommend using it because it is not desirable to allow a remote client's connection status to control whether or not the server application is running.
The following sections describe what happens when a project is automatically started.
Using a Shortcut on Windows Startup
You can configure a Windows server to automatically start a project by using a startup shortcut. The startup shortcut starts the application when a user logs in to Windows, and the application stops running when the user logs off of Windows.
This procedure is automatically executed by the system when the startup mode is selected, as described above. This section will explain how to manually setup these shortcuts.
The runtime startup is executed by the program, TStartup.exe.
When using this example, make sure to change the installation path in the script and the FactoryStudio version to the installation on your computer.
The project is started from a command line window. The following command line parameters are available:
/project: Project Path and Name between double quotes /username: (optional), username that will be used to start the server , if you do not specify, the user guest will be used. /redundancy: indicates that the server redundancy is being used (requires ip1 and ip2) /ip1: IP Address of the Primary FactoryStudio Server /port1: TCP port of the Primary FactoryStudio Server /ip2: IP Address of the Secondary FactoryStudio Server /port2: TCP port of the Secondary FactoryStudio Server /viewonly: indicates that the project is in view only mode /wa: indicates that the project uses Windows Authentication
The modules that will be started are configured in the project and are located in Run > Startup.
Creating the shortcut
Go to Start > All Programs. Right-click the startup folder, and select Open.
In the examples below, be sure to change the installation path and version of FactoryStudio to the installation on your computer.
The project will automatically start the next time the computer is started.
Using a Windows Service to Startup
You can configure a Windows server to automatically start a project when the computer starts using a Windows Service. The Windows Service starts the application as soon as the computer is powered on and the Windows Operating System starts, even if no user has logged in to Windows.
This procedure is automatically executed by the system when selected for startup mode, as described above. This section will explain how to set it up manually.
These methods do not start the client (user interface with the displays). To automate the client startup, see "Automatically Starting Windows Clients", below.
Use the Windows Service only on production servers that are not being used as engineering stations, and only if you need the ability to differentiate between the logged in Windows users while the project is running.
The first several steps of the procedures shown below are required to set up the Windows Service.
To run your application as a Windows Service:
Primary Server IP and Target Port
Enter the IP address and port of the primary server.
Secondary Server IP and Target Port
Enter the IP address and port of the secondary server, if any.
On Primary Startup
Select the option you want.
Select how to handle historian replication.
Connection timeout time, in seconds, to switch to secondary server.
Server Command Line
Read-only field populated by the fields above. Click Copy to Clipboard to copy the command.
Rich Client command
The commands to start a Rich Client with the project's selected parameters.
Smart Client url
The URL to access the Smart Client with the project's parameters.
Web Client url
The URL to access the Web Client with the project's parameters.
If checked, apply View-Only parameter to Rich and Smart Client's url.
If checked, apply Windows Authentication logon parameter to Rich and Smart Client's url.
The whole command line should look something like this:
"C:\ProgramFiles(x86)\Tatsoft\FactoryStudio\fs-8.1\ tStartup.exe" /project:C:\Factory Studio Projects\ <project_name>.tproj /username:<username>
installutil <InstallPath>\<fs-version>\TStartupAsService.exe Example: C:\Windows\Microsoft.NET\Framework\v2.0.50727>installutil C:\Program files\Tatsoft\FactoryStudio\fs-8.1\ TStartupAsService.exe
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\ TStartup\ImagePath" Example: "C:\\tatsoft\fs-8.1\TStartupAsService.exe" "/project:C:\FactoryStudio Projects\Project1.tproj"