You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

FactoryStudio projects can run several different ways: 

  • Local or Remote manual command
  • On user login
  • Projects as a Service
  • Remote OPC Activation



On this page:




Setup the Server to Start the Runtime

You can run the project in any of the following ways:

  • Manually starting from the project list on FactoryStudio's main menu. To do this, right-click the project and select Run Project.
  • Manually starting when you are configuring the project. To do this, go to Run > Startup and click Run Startup.
  • Automatically starting, which is the best option for production environments. See below for the best way to do this:

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.

Examples

"C:\Program Files\Studio\fs-8.1\TStartup.exe"
/project:"C:\Studio Projects\Project1.tproj" 
"C:\Program Files\Studio\fs-8.1\TStartup.exe"
/project:"C:\Studio Projects\Project1.tproj" /port1:3101 
Server Redundancy:
"C:\Program Files\Studio\fs-8.1\TStartup.exe" /project:"C:\Studio Projects\Project1.tproj" /username:Administrator /redundancy /ip1:192.168.1.1 /port1:3101 /ip2:192.168.1.2 /port2:3101


Creating the shortcut

Go to Start > All Programs. Right-click the startup folder, and select Open.

  • In the Startup folder, right-click and select New > Shortcut.
  • In the Create Shortcut window, paste into the field that displays.
  • If you are not using redundancy, delete the redundancy part of the text.

In the examples below, be sure to change the installation path and version of FactoryStudio to the installation on your computer.

  • Type or paste the full command line, for example: "C:\Program Files\Studio\fs-8.1\TStartup.exe" /project:"C:\Studio Projects\Project1.tproj"
  • Click Next.
  • Enter a name for the shortcut.
  • Click Finish.

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:

  • Go to Info > Project > Redundancy.
  • Enter or select the information, as needed.

Field

Description

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.

Historian Replication

Select how to handle historian replication.

Connection Timeout

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.

View-Only

If checked, apply View-Only parameter to Rich and Smart Client's url.

Windows Authentication

If checked, apply Windows Authentication logon parameter to Rich and Smart Client's url.

  • Next to the Server Command Line field, click Copy to Clipboard. This copies the read-only field that was populated based on the fields above it.
  • Open a text file, paste, and continue to the next steps in the file.
  • If you are not using redundancy, delete the redundancy part of the text.
  • At the beginning of the command line, enter or paste the full path to the FactoryStudio installation folder and put quotes around it. It should look something like this: "C:\Program Files (x86)\Tatsoft\FactoryStudio\fs-8.1\tStartup.exe"
  • Before the "tproj" text, enter or paste the full path to the project. It should look something like this: /project:C:\FactoryStudio Projects\<project_name>.tproj

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>
  • Leave the text file open for later use.
  • From the command line prompt, go to the <.NET Framework Install Path> and execute the following command:
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
  • Copy and paste the command you created in the text file.
  • In the Windows Registry, set up the parameters on:
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\ TStartup\ImagePath" 
Example: "C:\\tatsoft\fs-8.1\TStartupAsService.exe" "/project:C:\FactoryStudio Projects\Project1.tproj"


  • In the Windows Services (Administrative Tools), set "TStartup Service" to automatic, so the selected project will start when the computer starts.




  • No labels