You are on page 1of 7

@echo off

rem +--------------------------------------------------------------------------+
rem | |
rem | ///// ///// ///// ////// / OOOOO OOO OOO O OOOO |
rem | / / / / / / O O O O O O O |
rem | /// ///// /// / / O O O O O O OOO |
rem | / / / / / / O O O O O O O |
rem | / / / / / / O O O O O O O |
rem | / / / ///// / / O OOO OOO OOOO OOOO |
rem | |
rem +--------------------------------------------------------------------------+
rem | * GEN * |
rem +--------------------------------------------------------------------------+
rem | Module identification |
rem +--------------------------------------------------------------------------+
rem
rem Module Name : fast_start
rem
rem Version : 1.10
rem
rem Copyright (c) : Yokogawa
rem
rem Author : H. Koekoek
rem
rem +--------------------------------------------------------------------------+
rem | Module specification |
rem +--------------------------------------------------------------------------+
rem
rem Description : This module starts all available fast tools
rem
rem +--------------------------------------------------------------------------+
rem Changes ....
rem +--------------------------------------------------------------------------+
rem Who When Change What
rem +--------------------------------------------------------------------------+
rem KKO Sep-90 1311 First release
rem WRD Mar-91 1601@3 Generation error solved
rem WRD Mar-91 1601@3 Add some sleeps
rem HUR May-92 e168 FAST/TOOLS port RS6000
rem KKO Aug-92 e234@92 Add support set startup
rem HFM Sep-92 e234@99 Testing
rem KKO Feb-93 e299@10 Start sequence: item-integration-alarm
rem KKO Aug-93 e316@25 Start sequence: integration-hist-item-alarm
rem WRD Sep-93 e306 Add AUDIT/FAST
rem KKO Sep-93 e318@1 Add fast_env
rem KKO Jan-94 e318@29 Remove fast_env
rem UNW Jan-94 e307 Add PROCESS/FAST
rem KKO Jun-95 e4033@250 test on *ini.sup i.s.o. *start
rem KKO Aug-95 e4033@275 Add process/fast support set
rem KKO Oct-95 e4847@33 change process_sup_init in prcss_sup_init
rem HVS Feb-97 e5931 Port to Windows NT
rem LVN Apr-97 e5699 Add ACCESS/FAST
rem HVS Aug-97 e6096@237 Integrate Areadat
rem HVS Sep-97 e6096 Swap history and integration
rem HBR Sep-98 e7277 NTPort
rem HBS Sep-99 e7665 Added test for durtim and user_start
rem HVS Nov-99 e7699 Add cd /d %TLS_ROOT_PATH% to make sure we are on
rem the correct drive
rem STM Mar-00 e7665 Do not go exit when 'histr_sub_init' not present
rem Added 'exist' keyword after 'item_sup_init' label
rem HVS Apr-00 e7665 Do not call colourws_start.cmd
rem HVS Jun-01 e8209 Start umhlogtoo for background start
rem HVS Aug-01 e8209 Start umhlogtoo for background start with timeout
rem HVS OCT-01 e8209 Disable default start of areadat
rem HVS Nov-01 e8292 Create %TLS_ROOT_PATH%\tls\started to signal
rem complete startup
rem STM Nov-01 e8292 Create folders missing under certain circumstances
rem STM Nov-01 e8292 Start DURM and INTMON at end of fast_start
rem HVS Jun-02 e9052 Use durwfp -r for testing running BUS/FAST
rem HVS Jul-02 e9185 Change way of creating 'started' file
rem HVS May-03 e9239 Add initialisation/start of FAST/Start
rem STM Sep-03 e9281 - Start DURM before REPORT/ACCESS/USER
rem - Use fmfutl to wait for presence of DSS-dict.
rem HVS Oct-03 e9281 Remove loop when history support is not there
rem HVS Nov-03 e9281 Printer management move to here and correct again
rem UNW Dec-03 e9281 Wait for printer management DB befoer quickload
rem HVS Apr-05 e9435 Add tls environment variables
rem BSH Aug-06 e9728 Move integration_start to the end
rem HVS Aug-06 e9728 Add start of OPC-DA Tunneler
rem BSH Sep-06 e9728 Repair integration start problem (SCR #4)
rem BHS Oct-06 e9728 Generate "tls_versions.lst" for version info ftmonitor
rem HVS Nov-06 e9728 Use -s instead of -r for durwfp
rem BHS Nov-06 e9728 Move printer management start to integration_start
rem BHS Jun-08 i10028 Correct label in test of datbs_sup_init.cmd
rem HVS Feb-10 e10100 web-HMI Phase 2
rem HVS May-10 e10307 Use TLS_LST_PATH
rem HVS Feb-11 e10467 Create TLS_LOG_PATH directory if not existing
rem HVS Feb-11 e10467 Add check on TLS_LOG_PATH
rem BHS Apr-11 i10511 Add check on wflini.sup for starting USER/FAST
rem BGR Oct-12 e10635 Fixed fast_lite load synchronisation together with wait
fmfprt in integration_start.cmd
rem KKO Aug-13 e10813 Remove areadat
rem HVS Feb-15 e11033 Correct looping if fast_lite_start.cmd doesn't exist
rem NMK Sep-18 e12021 Start of F/T based on the status of PC Redudancy Platform
rem NMK Sep-18 e11929 Start of PRCCHK after BUS
rem SWA JAN-18 e12021 Start PRCCHK before BUS as it does not need BUS
connection
rem HSB Dec-18 e????? Added permissions check

title FAST/TOOLS

if "%TLS_ROOT_PATH%" == "" set TLS_ROOT_PATH=c:

cd /d %TLS_ROOT_PATH%

if "%TLS_LOG_PATH%" == "" goto no_tls_log_path

:start_fast_tools
rem The "setup" package created by InstallShield does not create all folders
rem needed by some of the FAST/TOOLS functions. E.g. the \tls\his folder is
rem not automatically created for a front-end configuration, although it is
rem used by EQP to dump logging information. Therefore at this point in the
rem fast_start script we create folders not automatically created by "setup".

if not exist %TLS_HIS_PATH% mkdir %TLS_HIS_PATH%


if not exist %TLS_LST_PATH% mkdir %TLS_LST_PATH%
if not exist %TLS_LOG_PATH% mkdir %TLS_LOG_PATH%

if exist %TLS_ROOT_PATH%\upgrade\PreparationDone.txt goto upgrade_in_progress

REM Check current user permission if we do not have admin rights exit
net session >nul 2>&1

if not %errorLevel% EQU 0 (


echo You need administrator priveleges in order to start FAST/TOOLS
echo FAST/TOOLS start-up procedure has been aborted!
goto script_exit_point
)

%TLS_ROOT_PATH%\tls\exe\durwfp -s
if errorlevel 1 goto fast_tools_already_started

SET start=0

start /B /NORMAL /WAIT %TLS_ROOT_PATH%\tls\exe\prcchk


SET exitCode=%errorlevel%
if %exitCode% EQU 1 SET start=1
if %exitCode% EQU 0 SET start=1

if %start% EQU 0 goto prc_not_active


:start_bus_start
REM Assume bus_start.cmd and durini.sup are always present
call %TLS_ROOT_PATH%\tls\com\bus_start.cmd
start /B /NORMAL /WAIT %TLS_ROOT_PATH%\tls\exe\durwfp.exe -p umhlog -t 10
start /B /NORMAL %TLS_ROOT_PATH%\tls\exe\umhlogtoo -t 300

:start_database_start
if not exist %TLS_ROOT_PATH%\tls\sup\isfini.sup goto database_sub_init

call %TLS_ROOT_PATH%\tls\com\database_start.cmd
goto start_history_fast

:database_sub_init
if not exist %TLS_ROOT_PATH%\tls\com\datbs_sup_init.cmd goto start_history_fast

if exist %TLS_SAV_PATH%\datbs_sup_init.cmd goto start_history_fast

call %TLS_ROOT_PATH%\tls\com\datbs_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\datbs_sup_init.cmd %TLS_SAV_PATH% > nul

:start_history_fast
if not exist %TLS_ROOT_PATH%\tls\sup\hisini.sup goto history_sub_init

call %TLS_ROOT_PATH%\tls\com\history_start.cmd
goto start_audit_fast

:history_sub_init
if not exist %TLS_ROOT_PATH%\tls\com\histr_sup_init.cmd goto start_audit_fast

if exist %TLS_SAV_PATH%\histr_sup_init.cmd goto start_audit_fast


call %TLS_ROOT_PATH%\tls\com\histr_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\histr_sup_init.cmd %TLS_SAV_PATH%
:start_audit_fast
if not exist %TLS_ROOT_PATH%\tls\sup\adtini.sup goto audit_sup_init

call %TLS_ROOT_PATH%\tls\com\audit_start.cmd
goto start_item_fast

:audit_sup_init
if not exist %TLS_ROOT_PATH%\tls\com\audit_sup_init.cmd goto start_item_fast

if exist %TLS_SAV_PATH%\audit_sup_init.cmd goto start_item_fast

call %TLS_ROOT_PATH%\tls\com\audit_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\audit_sup_init.cmd %TLS_SAV_PATH% > nul

:start_item_fast
if not exist %TLS_ROOT_PATH%\tls\sup\itmini.sup goto item_sup_init

call %TLS_ROOT_PATH%\tls\com\item_start.cmd
goto start_alarm_fast

:item_sup_init
if not exist %TLS_ROOT_PATH%\tls\com\item_sup_init.cmd goto start_alarm_fast

if exist %TLS_SAV_PATH%\item_sup_init.cmd goto start_alarm_fast


call %TLS_ROOT_PATH%\tls\com\item_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\item_sup_init.cmd %TLS_SAV_PATH% > nul

:start_alarm_fast
if not exist %TLS_ROOT_PATH%\tls\sup\almini.sup goto alarm_sup_init

call %TLS_ROOT_PATH%\tls\com\alarm_start.cmd
goto start_equipment_fast

:alarm_sup_init
if not exist %TLS_ROOT_PATH%\tls\com\alarm_sup_init.cmd goto start_equipment_fast

if exist -f %TLS_SAV_PATH%\alarm_sup_init.cmd goto start_equipment_fast

call %TLS_ROOT_PATH%\tls\com\alarm_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\alarm_sup_init.cmd %TLS_SAV_PATH% > nul

:start_equipment_fast
if not exist %TLS_ROOT_PATH%\tls\sup\eqpini.sup goto eqpmn_sup_init

call %TLS_ROOT_PATH%\tls\com\equipment_start.cmd
goto start_compute_fast

:eqpmn_sup_init
if not exist %TLS_ROOT_PATH%\tls\com\eqpmn_sup_init.cmd goto start_compute_fast

if exist %TLS_SAV_PATH%\eqpmn_sup_init.cmd goto start_compute_fast

call %TLS_ROOT_PATH%\tls\com\eqpmn_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\eqpmn_sup_init.cmd %TLS_SAV_PATH% > nul

:start_compute_fast
if not exist %TLS_ROOT_PATH%\tls\com\compute_start.cmd goto compute_sup_init

call %TLS_ROOT_PATH%\tls\com\compute_start.cmd
goto start_process_fast

:compute_sup_init
if not exist %TLS_ROOT_PATH%\tls\com\compute_sup_init.cmd goto start_process_fast

if exist %TLS_SAV_PATH%\compute_sup_init.cmd goto start_process_fast

call %TLS_ROOT_PATH%\tls\com\compute_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\compute_sup_init.cmd %TLS_SAV_PATH% > nul

:start_process_fast
if not exist %TLS_ROOT_PATH%\tls\sup\opcini.sup goto prcss_sup_init

call %TLS_ROOT_PATH%\tls\com\process_start.cmd
goto durm_start

:prcss_sup_init
if not exist %TLS_ROOT_PATH%\tls\com\prcss_sup_init.cmd goto durm_start

if exist %TLS_SAV_PATH%\prcss_sup_init.cmd goto durm_start

call %TLS_ROOT_PATH%\tls\com\prcss_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\prcss_sup_init.cmd %TLS_SAV_PATH% > nul

REM Start the durm-processes and optionally INTMON


REM Keep start of DURM processes and INTMON, together
REM DURM must be started before REPORT and USER because these TOOLS use dssqld
(dssqld
REM needs the datadictionary, which is not transferred to WS/FE if no DURM
connection
REM exists).
REM DURM must not be started before PROCESS, otherwise the PROCESS manager may draw
REM wrong conclusions about the availability of an OPCEXE process on the front-end.
REM If there is no durm_start.cmd script and we are not a host then copy durm_start
REM from the tpl file to com.
:durm_start
if exist %TLS_ROOT_PATH%\tls\com\durm_start.cmd goto start_durm
start /B /WAIT %TLS_ROOT_PATH%\tls\exe\fmfutl.exe host_node
if not errorlevel 1 goto start_report_fast
copy %TLS_ROOT_PATH%\tls\tpl\durm_start.cmd %TLS_ROOT_PATH%\tls\com\durm_start.cmd
:start_durm
call %TLS_ROOT_PATH%\tls\com\durm_start.cmd

rem start /B /NORMAL %TLS_ROOT_PATH%\tls\exe\intmon -n intmon

:wait_dss_dict
REM Waiting here for DSS-dictionary to prevent processes starting hereafter
REM and waiting for data-dictionary, to time-out. In this way we can control
REM whether or not to abort the start-up procedure.
REM echo Waiting till DSS dictionary becomes available......
start /B /WAIT %TLS_ROOT_PATH%\tls\exe\fmfutl.exe wait_dss_dict_avail 90 2
if errorlevel 1 goto no_dss_dict
REM echo Found DSS dictionary, continuing.
REM echo.

:start_report_fast
if not exist %TLS_ROOT_PATH%\tls\sup\rptini.sup goto reprt_sup_init

call %TLS_ROOT_PATH%\tls\com\report_start.cmd
goto start_access_fast

:reprt_sup_init
if not exist %TLS_ROOT_PATH%\tls\com\reprt_sup_init.cmd goto start_access_fast

if exist %TLS_SAV_PATH%\reprt_sup_init.cmd goto start_access_fast


call %TLS_ROOT_PATH%\tls\com\reprt_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\reprt_sup_init.cmd %TLS_SAV_PATH% > nul

:start_access_fast
if not exist %TLS_ROOT_PATH%\tls\sup\odbini.sup goto access_sup_init

call %TLS_ROOT_PATH%\tls\com\access_start.cmd
goto start_user_fast

:access_sup_init
if not exist %TLS_ROOT_PATH%\tls\com\access_sup_init.cmd goto start_user_fast

if exist %TLS_SAV_PATH%\access_sup_init.cmd goto start_user_fast


call %TLS_ROOT_PATH%\tls\com\access_sup_init.cmd
copy %TLS_ROOT_PATH%\tls\com\access_sup_init.cmd %TLS_SAV_PATH% > nul

:start_user_fast
if not exist %TLS_ROOT_PATH%\tls\sup\wflini.sup goto start_integration_fast
call %TLS_ROOT_PATH%\tls\com\user_start.cmd

:start_integration_fast
if not exist %TLS_ROOT_PATH%\tls\sup\intini.sup goto start_fast_lite
call %TLS_ROOT_PATH%\tls\com\integration_start.cmd

:start_fast_lite
if not exist %TLS_ROOT_PATH%\tls\com\fast_lite_start.cmd goto end_fast_tools
call %TLS_ROOT_PATH%\tls\com\fast_lite_start.cmd

:end_fast_tools
echo FAST/TOOLS started
goto signal_started

:fast_tools_already_started
echo FAST/TOOLS is already running
durwfp -k
goto signal_started

:signal_started
REM Create %TLS_LST_PATH%\started to signal the faststarter process
REM that FAST/TOOLS has been started
echo started >%TLS_LST_PATH%\started
REM Signal the upgrade utility that FAST/TOOLS is started
echo you may delete this file >%TLS_LST_PATH%\started2

REM Generate a version CSV for ftmoni.exe


%TLS_ROOT_PATH%\tls\com\tls_versions.cmd -c >%TLS_LST_PATH%\tls_versions.lst

title Message log


goto script_exit_point

:upgrade_in_progress
echo.
echo The upgrade procedure is not yet finished.
echo Execute the jupgrade.cmd script found in tls/com before starting FAST/TOOLS.
echo.
echo FAST/TOOLS start-up procedure has been aborted!
goto script_exit_point

:no_dss_dict
echo.
echo DSS dictionary did not became available on this node within timeout-period
echo FAST/TOOLS start procedure will be aborted.....
echo.
call %TLS_ROOT_PATH%\tls\com\fast_stop.cmd
echo FAST/TOOLS start-up procedure has been aborted!
goto script_exit_point

:no_tls_log_path
echo.
echo The environment variable TLS_LOG_PATH does not exist.
echo.
echo FAST/TOOLS start-up procedure has been aborted!
goto script_exit_point

:script_exit_point

You might also like