This document presents information about the server autostart options.
FactoryStudio projects can run several different ways:
The configuration for these options is a simple radio-box setup. This document describes those options, as well as presents the technical details on the configuration settings applied to the computer, when a selection is name. <<<<please check "when a selection is name". is it correct?>>>>
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. |
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.
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.
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:
cd "C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>" start "C:\Program Files (x86)\<CompanyName>\<ProductName>\<ProductVersion>\TStartup.exe" /project:"C:\Projects\MyNewProject.tproj" |
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.
You can run the project in any of the following four ways:
None: Projects are started Manually:
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.
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.
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.
"C:\Program Files\Studio\fs-8.1\TStartup.exe" /project:"C:\Studio Projects\Project1.tproj" |
More information on the parameters for the TStartup application are located here <<<<<<<. link startup open >>>>>>>>>>>>>>>>>>>>>>
Creating a Windows 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 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..
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.
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 <<<<< link >>>>>>>> section of the manual for information on starting client side applications. |
When running the application as a Windows Service, you need to take 4 actions:
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.
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 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.
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.
When the application is running as a service, the server components will run under the credentials of the “project user” defined in Run → 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.
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. |
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
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
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.
/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.
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