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

Compare with Current View Page History

« Previous Version 11 Next »

Overview

FactoryStudio projects can run several different ways: 

  • Local or Remote manual command
  • On user login
  • Projects as a Service (On Computer PowerUP)
  • Remote OPC Activation

The configuration for these options utilizes a straightforward radio-box setup. This document outlines those options and provides technical details on the configuration settings applied to the computer when a selection is made.

Projects on Remote Computers

These tools can also setup an Auto-start option in a remote computer. Just connect with a remote ProjectServer. See more information on ProjectServer here.

On this page:


Launching the Application with a Shortcut

TStartup.exe

TStartup.exe is the executable which runs the project. There are many different parameters that can be added to the TStartup command line that provide more features to a project as well as more debugging tools.

In order to use TStartup.exe,  you will need to create a shortcut for the executable and edit the shortcut properties to add the parameters.

Creating a TStartup Shortcut

Go to your product’s installation folder (see usual path below), and search for the TStartup.exe application. Right-click it, select Create Shortcut, and copy the file. Then, paste it in any folder.

C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe

Then, right-click on the created shortcut, select Properties, and change the Target field (command line) as you desire.

Right-click the shortcut icon and select Properties


Creating a .bat file

A batch file is a script file in DOS and Microsoft Windows. It consists of a series of commands that are executed by the command-line interpreter and are stored in a plain text file.

The following steps describe how to launch a customizable TStartup application with a .bat file:

  • Create a text file (extension .txt)
  • Write the full command line that will launch the application, as seen below
cd "C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>"

start "C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe"
/project:"C:\Projects\MyNewProject.tproj"
  • Add the desired additional parameters (see examples in the next sections)
  • Save and close the file
  • Right-click the icon and change its extension name form .tex to .bat. A warning message will popup on the screen. Click Yes.


Click Yes to change the name

  • Double-click the newly created file to launch the TStartup application.

Required Parameters

The most important parameter for launching your application is related to the Project file. It is the only thing that is really necessary for the command line.

The syntax for this parameter is presented below.

/Project:"C:\Projects\Project4.tproj

After that parameter, you can add any of the remaining available parameters.


Project AutoStart Setup

Select the Runtime Autostart Option

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

Start the Project Manually:

Projects are started manually:

  • From the Project Management Tool list. To do this, Select a Project and click the Runtime Startup button or right-click the project and select Run Project.
  • When you are configuring the project. To do this, go to Runtime → Startup and click Run Startup.
  • Creating a windows shortcut to start the Project.

Login: Application starts when an user logs in and stops when user logs out

Service: Application run as a Windows Service and starts when the computer powers up

OPC Activation: Application is activated when the first remote OPC client request is received. In order to be fully OPC compliant, we support OPC client activation. However, it is not recommended in many scenarios, as it allows a remote client's connection status to control whether or not the server application is running. 

To set a project to start automatically, use the configuration interface available in the project management tools that are located on the Server tab. 

In “Select runtime auto startup mode”, choose the Service option to run the project as a service when the computer starts, and select which project you want. Finally, click the Apply Settings button.

Server tab options

After completing the configuration, click Apply Settings


Starting Projects manually

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.

Starting Projects with an User Login or shortcut

When the second option is selected (Auto-Start with User Login), a shortcut is automatically created and placed on the Windows Startup folder to all users. So when the first user on that computer logs in, the project is started.

This section explains the behind-the-scenes setup that is executed with this option, as well as the details you want to setup that startup shortcut manually. 


Using a Shortcut on Windows Startup

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 Authenticatio


The modules that will be started are configured in the project and are located at Run → Startup.

Run Modules options

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

More information on the parameters for the TStartup application are located here.


Creating a Windows 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. <<<<.please check this sentence. what should be pasted? all three options above?>>>>
  • 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 on the next user login if you place that startup icon on the Windows Startup folder. Or you can use the shortcut to start the application manually..

Auto-Start the Project as a Windows Service

When the third second option is selected, Auto-Start running as a Windows Service, the project will start running when the computer powers up. 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.

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. Use the Windows Service on production servers that are not being used as engineering stations if you need the ability to differentiate between the logged in Windows users while the project is running. 

This section explains the behind-the-scenes setup on the Windows Service that is executed with this option, as well as the details you want to move the Windows Services configuration

Client Displays

When running as a Windows Service, you cannot start the Client Displays, as the service server side components run independently from any user logged in. Refer to Running Displays Clients section of the manual for information on starting client side applications.


Running the Project as a Windows Service

When running the application as a Windows Service, you need to take 4 actions:

  • Setup the Run-time startup: By using the FactoryStudio configuration tools or directly editing the Windows Service system, you define a FactoryStudio project to start as a Windows Service that will run the “server” components of the project. The graphical user interface always runs in a Windows User Mode in the same computer or started in a remote computer.
  • Setup a Web Server: If you want remote access to this project — for project configuration or to access the displays in runtime —, you need to setup a Web Server. This is accomplished with the built-in TWebServer software or with the Microsoft IIS (Internet Information Services). Refer to the TWebServices page about installing a Web Server.
  • Verify the security settings: Verify the security settings of the Windows Service and the security settings of the project
  • Define the client startup: When a FactoryStudio project is starting as a Windows Service, the Displays will not run, despite the project configuration, due to the restrictions of it running as a service. Therefore, you need to setup the client displays, either in a startup shortcut on the same computer or in a remote computer. Information on starting client displays can be located here <<<<<<<<<<. >>>>>>>>>>>>>>>>>>>>>>>>>


In “Select runtime auto startup mode”, choose the Service option to run the project as a service when the computer starts, and select which project you want. Finally, click the Apply Settings button.

Select the Service option


When the Apply Settings button is clicked. the following actions are automatically executed by the platform 

1)  A Command line, based on the project configuration is created. 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>

2) A command at the <.NET Framework Install Path> is executed:

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

3) In the Windows Registry, the following entry is added


"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\ TStartup\ImagePath" 
Example: "C:\\tatsoft\fs-8.1\TStartupAsService.exe" "/project:C:\FactoryStudio Projects\Project1.tproj"

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


Check the Windows Service Security Settings

Check the Windows Security settings for Log On.

When you setup the project to run as a Windows Service, it will run by default under the built-in “Local System” Window Credentials. For some projects, especially if accessing external databases or folders, you may need to run under a specific user's Windows Security Log On credentials. The configuration is executed in the Windows Service Configuration directly. For most scenarios, the default configuration will suffice.


Optionally, you can delay the start of the service

If the application is using external resources, services, or applications, you may want to delay the start of the project to allow the other services to start first. This is also executed in the Windows Service configuration.


Setup the Security in the Project Configuration  Project

When the application is running as a service, the server components will run under the credentials of the “project user” defined in Runtime → Startup. By default, the user is a “guest”. For most projects, that user will be changed to Administrator, which will allow the user to make changes to the project with online configuration or have access to all application objects.

Startup tab options



Starting the Module Monitor interfaces

When you start the application in the user mode, you have the TStartup.exe application, which shows a dialog page with all the modules running, and you can start and stop the modules individually using that interface. The application is not visible when the project server (TServer application) is started as a Windows Server.

If you want to access the same interface when running as a service, you need to start the PropertyWatch.exe located in the FactoryStudio installation folder (typically, C:\Program Files (x86)\Tatsoft\FactoryStudio\fs-2014.2\PropertyWatch.exe).

When running as a service, you need to define the parameters /ip1 and /port1 with the computer name or with the computer IP. The default configuration will not allow a connection in this case. You can define other optional parameters, such as /username. E.g.: "C:\Program Files (x86)\Tatsoft\FactoryStudio\fs-2016.2\PropertyWatch.exe" /ip1:W10-VS /username: Administrator

Another way to start these tools is to open the project configuration, Run Startup, and click the connect button. This will enable a button on that dialog that will open the monitoring Tools.


In order to setup Microsoft IIS, see the project documentation.

Startup Parameters

Main parameters

/ip1

The Primary Server Name or IP

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /ip1:<IpAddress>


/port1

The Port number of the primary, default is 3101.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /ip1:<IpAddress> /port1:<PortNumber>


Advanced Diagnostic Information

The list below contains the available parameters that can be added to a project's startup for additional debugging information.

/debugstart

The logs are created in the folder:

C:\ProgramData\<ProductName>

It is worth remembering that this folder is used to log system errors. When a critical error occur, this folder will contain important information that can be used to solve the issue.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /debugstart


/AutoRunDiagnostics: (time in minutes)

The logs are created in the folder:

C:\ProgramData\<ProductName>

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj"/AutoRunDiagnostics:30


/LogDeviceWriteStartup

The logs are created in the folder:

C:\ProgramData\<ProductName>\Device

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj"/LogDeviceWriteStartup


Redundancy

/redundancy

It has no parameters. It just needs to be included to enable redundancy.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj"/redundancy


/autoswitch

It has no parameters. If included, the Primary takes over as the Active node if the secondary was acting as the Active.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj"/redundancy /autoswitch


/timeautoswitch

The number of seconds the Primary will wait before becoming active if the autoswitch option is enabled. This is typically set to 60 seconds.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj"/redundancy /timeautoswitch:30


/ip1

The Primary Server Name or IP

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /ip1:<IpAddress>


/port1

The Port number of the primary, default is 3101.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /ip1:<IpAddress> /port1:<PortNumber>


/ip2

The Secondary Server Name or IP

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /ip1:<IpAddress> /ip2:<IpAddress>


/port2

The Port number for the secondary, default is 3101.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj"/ip1:<IpAddress> /ip2:<IpAddress> /port2:<PortNumber>


/connectiontimeout

The Watch-dog timeout in seconds that is found on Info → Redundancy.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /connectiontimeout:5


/connectionretry

The Connection retry attempts. By default, it is set as 1.


/ProjectIPPath

The path of the project on the remote server.

The ProjectIPPath is used by the system to allow one station to automatically update the project in the redundant pair when doing online project changes and HotStart commands.

Example:

/ProjectIPPath:192.168.0.1;C:\Projects\test.tproj

Note

The TimeAutoSwitch time is connected when you are using the /autoswitch option. In this scenario, when the computer designed as the Primary starts, it will ”auto switch” from standby to active after it starts.


It is important that the switch happens only after the process had time to get all the synchronization from the active computer. Typically, 60 seconds should be enough for that, but you should increase that settings for large projects or slow networks.


Advanced Parameters

/username

The RuntimeUser that is logged in.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /username:<UserName>


/password

The custom password to log in as the user defined above.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj"/username:<UserName> /password:<Password>


/wa

Flag (True or False) to set if Windows Authentication will be used.

  • True:
  • False = Remote

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /wa:true


/port1WA

The listening port using Windows Authentication

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /wa:true /port1Wa:<PortNumber>


/NumberOfDevicesAtSameTime

The number of devices online at the same time. By default, it is set as 3.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /NumberOfDevicesAtSameTime:1


/TimeBetweenModules

The waiting time between modules being started. Time in seconds.

The target of your shortcut will be something like this:

"C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /Project:"C:\ Projects\Project4.tproj" /TimeBetweenModules:30


/nocache

Flag (true or false) to see if project will use data stored in cache or not. For SmartClient Only.

The target of your shortcut will be something like this:

http://<IpAddress>/<ProductVersion>/TSmartClient.application?nocache=true



In this section...

The root page @parent could not be found in space v10.

  • No labels