Alarm DB Logger — различия между версиями
Admin (обсуждение | вклад) |
Admin (обсуждение | вклад) (→Скрипт Старт/Стоп alarm bd logger) |
||
(не показано 16 промежуточных версии 2 участников) | |||
Строка 1: | Строка 1: | ||
как сервис: техноты 821, 872, 725. | как сервис: техноты 821, 872, 725. | ||
+ | == Резервирование сбора алармов и БД алармов == | ||
+ | В целом рекомендации по резервированию алармов: | ||
+ | * хранить две БД алармов, на двух серверах, AlarmDBLogger запускать на том же ПК где и БД алармов. Например: Alarm logger запущенный ПК с сервером Historian должен сохранять в свою БД на том же компьютере, а второй AlarmDBLogger запустить на узле GR и БД хранить там же | ||
+ | * клиентов исторических алармов настроить на обе БД с помощью Alarm Hot Backup Manager (см. руководство "Руководство по алармам и событиям в InTouch HMI" стр. 400 - раздел "Повышение безопасности объекта управления за счет избыточности алармов") | ||
− | + | == Скрипт Старт/Стоп alarm bd logger == | |
+ | '''Для Windows 7 и Windows 2008 Server Alarm DB Logger должен стартовать только как приложение (не сервис).''' в версиях InTouch 2017 для Windows 10 опять вернулся запуск как службы | ||
+ | В '''TN 725''' – есть текст bat файла для старта InTouch + Alarm DB Logger при старте Windows. При этом alarm bd logger должен стартовать ПОСЛЕ приложения Window Viewer – VIEW и не как сервис, а как приложение. | ||
+ | |||
+ | <PRE> | ||
+ | :: Tested on Window7 x64 | ||
+ | :: May work with earlier Operating Systems, but directory paths will be different and must be adjusted | ||
+ | :: | ||
+ | :: INSTRUCTIONS: | ||
+ | :: (1) Configure AutoLogon of well-known user (for this example, we used user DomainX\UserX) in Windows Registry | ||
+ | :: (see: Knowldege Base article Q315231 located at http://support.microsoft.com/kb/315231 ) | ||
+ | :: (see: Wonderware Tech Note 49 - General Configuring Automatic Log Ons for Windows NT ) | ||
+ | :: | ||
+ | :: (2) Place this bat file on the node that you want to autostart WW programs, for example C:\bat\WonderwareAutoStart.bat | ||
+ | :: Copy C:\bat\WonderwareAutoStart.bat file and paste a shortcut to it in | ||
+ | :: C:\Users\UserX\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup | ||
+ | :: (Note1: replace UserX with your user name) | ||
+ | :: (Note2: above path is for Windows7, adjust accordingly for Vista or Windows XP) | ||
+ | :: (Note3: I chose to put batfile shortcut in specific user's (e.g. UserX's) startup folder and not in "all users" | ||
+ | :: startup folder so on "server" machines (Win2003Svr and Win2008R2) if a 2nd user remote | ||
+ | :: desktop's in to the machine as a different user (not UserX) the first session will continue to run fine | ||
+ | :: and we won't kick off the bat file a 2nd time. | ||
+ | :: | ||
+ | :: (3) use dos> dir /X *. command to find the 8.3 name of your root "program files" directory | ||
+ | :: and replace \PROGRA~2\ below with yours if yours is different | ||
+ | :: | ||
+ | :: REFERENCES - Wonderware Tech Notes (http://wdn.wonderware.com) | ||
+ | :: 049 - General Configuring Automatic Log Ons for Windows NT | ||
+ | :: 348 - InTouch Autostart of the InTouch® Alarm Utilities | ||
+ | |||
+ | |||
+ | |||
+ | @echo on | ||
+ | :: VIEW start - Spawns view off ("start" command allows bat file to complete and not just wait on this command) | ||
+ | start C:\PROGRA~2\Wonderware\InTouch\view.exe | ||
+ | |||
+ | :: wait 5 seconds for prior command to complete (may not be needed at all, but it's a cool example of how to wait) | ||
+ | ping -n 5 127.0.0.1 > NUL | ||
+ | |||
+ | :: ALMPTR start - The "-q" is recognized to autostart the alarm printer | ||
+ | start C:\PROGRA~2\Wonderware\InTouch\almprt.exe -q C:\Data\AlarmPrinterConfiguration\AlarmPrinterConfig1.alc | ||
+ | |||
+ | :: WWALMLOGGER start | ||
+ | start C:\PROGRA~2\Wonderware\InTouch\wwalmlogger.exe | ||
+ | |||
+ | :: Write execution time of this bat file to log for later examination (if needed) | ||
+ | echo %date% %time% >> C:\Data\Bat\BatFileLastRunTime.txt | ||
+ | |||
+ | :: wait 25 seconds, then lock desktop if so desired (uncomment the rundll32 command) | ||
+ | ping -n 25 127.0.0.1 > NUL | ||
+ | rundll32.exe user32.dll, LockWorkStation | ||
+ | </PRE> | ||
+ | |||
+ | === Запуск Alarm DB Logger как служба === | ||
+ | *Для InTouch 2017 и выше и windows 10 | ||
+ | </Pre> | ||
+ | Case1: System is connected as console mode. | ||
+ | |||
+ | => Stop the Alarm DB Logger Manager, If it is running. | ||
+ | |||
+ | =>Add the below DWORD key named "Session0LegacyMode" and value "0" in the below mentioned registry path. | ||
+ | On a 32-bit system, HKEY_LOCAL_MACHINE\Software\Wonderware\AlarmManager\ | ||
+ | On a 64-bit system, HKEY_LOCAL_MACHINE\Software\Wow6432Node\Wonderware\AlarmManager\ | ||
+ | For more information Please find the attached "TN570_V11.0_AlarmMgr support on vista and later OS.PDF" document. | ||
+ | |||
+ | => Restart the Alarm DB Logger Manage as service. | ||
+ | |||
+ | Case2: System is connected as remote mode. | ||
+ | |||
+ | => Stop the Alarm DB Logger Manager, If it is running. | ||
+ | |||
+ | => Go to Query Selection page in Alarm DB Manager, change the Alarm Query as mentioned below | ||
+ | \\IntouchApplication Installed IP : Remote Desktop Machine IP \InTouch!$System | ||
+ | |||
+ | Note: The Remote Desktop machine IP is listed in SMC as "Registering AlarmMgr with SLSSVC as "AlarmMgr10.231.138.89" . | ||
+ | In above SMC log, 10.231.138.89 is Remote Desktop Machine IP. | ||
+ | For more information please find the attached image file "ALMDBManager_RemoteMode.png". | ||
+ | => Start the Alarm DB Logger Manage as service. | ||
+ | |||
+ | </pre> | ||
==Autostart Alarm DB Logger== | ==Autostart Alarm DB Logger== | ||
Строка 14: | Строка 97: | ||
To start Alarm DB Logger automatically when starting the InTouch application, put the following in the Application '''OnStartup script''': | To start Alarm DB Logger automatically when starting the InTouch application, put the following in the Application '''OnStartup script''': | ||
StartApp "WWAlmLogger.exe"; | StartApp "WWAlmLogger.exe"; | ||
+ | |||
+ | |||
+ | == Скрипты AS == | ||
+ | === Как опеределить что Alarm DB Logger запущен и в случае проблем запустить его === | ||
+ | Execute script, whileTrue with expression of me.StartAlarmLoggerCmd | ||
+ | |||
+ | Dim procRunning as System.Boolean; | ||
+ | Dim cp AS System.Diagnostics.Process; | ||
+ | procRunning = False; | ||
+ | For Each cp In System.Diagnostics.Process.GetProcessesByName("wwalmlogger") | ||
+ | procRunning = True; | ||
+ | Me.AlarmLoggerRunning = True; | ||
+ | Me.StartAlarmLoggerCmd = False; | ||
+ | Exit For; | ||
+ | Next; | ||
+ | If NOT procRunning Then | ||
+ | Dim app As System.String; | ||
+ | app = System.String.Format("{0}\wwalmlogger.exe", Me.PathToLogger); | ||
+ | System.Diagnostics.Process.Start(app); | ||
+ | EndIf; | ||
+ | For Each cp In System.Diagnostics.Process.GetProcessesByName("wwalmlogger") | ||
+ | procRunning = True; | ||
+ | Me.AlarmLoggerRunning = True; | ||
+ | Me.StartAlarmLoggerCmd = False; | ||
+ | Exit For; | ||
+ | Next; | ||
+ | |||
+ | == Разные вопросы == | ||
+ | === Поддерживается ли работа нескольких Alarm DB logger для сохранения данных в одну БД === | ||
+ | *нет, см. FAQ13829 | ||
+ | *Возможная проблема: | ||
+ | Error: ! OLEDB ERROR = 2147500037; | ||
+ | The Transaction (Process ID 61) was deadlocked on lock resources with another process due to a deadlock and was chosen as the deadlock victim. Execute the transaction again.\ |
Текущая версия на 13:38, 21 ноября 2018
как сервис: техноты 821, 872, 725.
Содержание
Резервирование сбора алармов и БД алармов
В целом рекомендации по резервированию алармов:
- хранить две БД алармов, на двух серверах, AlarmDBLogger запускать на том же ПК где и БД алармов. Например: Alarm logger запущенный ПК с сервером Historian должен сохранять в свою БД на том же компьютере, а второй AlarmDBLogger запустить на узле GR и БД хранить там же
- клиентов исторических алармов настроить на обе БД с помощью Alarm Hot Backup Manager (см. руководство "Руководство по алармам и событиям в InTouch HMI" стр. 400 - раздел "Повышение безопасности объекта управления за счет избыточности алармов")
Скрипт Старт/Стоп alarm bd logger
Для Windows 7 и Windows 2008 Server Alarm DB Logger должен стартовать только как приложение (не сервис). в версиях InTouch 2017 для Windows 10 опять вернулся запуск как службы
В TN 725 – есть текст bat файла для старта InTouch + Alarm DB Logger при старте Windows. При этом alarm bd logger должен стартовать ПОСЛЕ приложения Window Viewer – VIEW и не как сервис, а как приложение.
:: Tested on Window7 x64 :: May work with earlier Operating Systems, but directory paths will be different and must be adjusted :: :: INSTRUCTIONS: :: (1) Configure AutoLogon of well-known user (for this example, we used user DomainX\UserX) in Windows Registry :: (see: Knowldege Base article Q315231 located at http://support.microsoft.com/kb/315231 ) :: (see: Wonderware Tech Note 49 - General Configuring Automatic Log Ons for Windows NT ) :: :: (2) Place this bat file on the node that you want to autostart WW programs, for example C:\bat\WonderwareAutoStart.bat :: Copy C:\bat\WonderwareAutoStart.bat file and paste a shortcut to it in :: C:\Users\UserX\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup :: (Note1: replace UserX with your user name) :: (Note2: above path is for Windows7, adjust accordingly for Vista or Windows XP) :: (Note3: I chose to put batfile shortcut in specific user's (e.g. UserX's) startup folder and not in "all users" :: startup folder so on "server" machines (Win2003Svr and Win2008R2) if a 2nd user remote :: desktop's in to the machine as a different user (not UserX) the first session will continue to run fine :: and we won't kick off the bat file a 2nd time. :: :: (3) use dos> dir /X *. command to find the 8.3 name of your root "program files" directory :: and replace \PROGRA~2\ below with yours if yours is different :: :: REFERENCES - Wonderware Tech Notes (http://wdn.wonderware.com) :: 049 - General Configuring Automatic Log Ons for Windows NT :: 348 - InTouch Autostart of the InTouch® Alarm Utilities @echo on :: VIEW start - Spawns view off ("start" command allows bat file to complete and not just wait on this command) start C:\PROGRA~2\Wonderware\InTouch\view.exe :: wait 5 seconds for prior command to complete (may not be needed at all, but it's a cool example of how to wait) ping -n 5 127.0.0.1 > NUL :: ALMPTR start - The "-q" is recognized to autostart the alarm printer start C:\PROGRA~2\Wonderware\InTouch\almprt.exe -q C:\Data\AlarmPrinterConfiguration\AlarmPrinterConfig1.alc :: WWALMLOGGER start start C:\PROGRA~2\Wonderware\InTouch\wwalmlogger.exe :: Write execution time of this bat file to log for later examination (if needed) echo %date% %time% >> C:\Data\Bat\BatFileLastRunTime.txt :: wait 25 seconds, then lock desktop if so desired (uncomment the rundll32 command) ping -n 25 127.0.0.1 > NUL rundll32.exe user32.dll, LockWorkStation
Запуск Alarm DB Logger как служба
- Для InTouch 2017 и выше и windows 10
</Pre> Case1: System is connected as console mode.
=> Stop the Alarm DB Logger Manager, If it is running.
=>Add the below DWORD key named "Session0LegacyMode" and value "0" in the below mentioned registry path.
On a 32-bit system, HKEY_LOCAL_MACHINE\Software\Wonderware\AlarmManager\ On a 64-bit system, HKEY_LOCAL_MACHINE\Software\Wow6432Node\Wonderware\AlarmManager\ For more information Please find the attached "TN570_V11.0_AlarmMgr support on vista and later OS.PDF" document. => Restart the Alarm DB Logger Manage as service.
Case2: System is connected as remote mode.
=> Stop the Alarm DB Logger Manager, If it is running.
=> Go to Query Selection page in Alarm DB Manager, change the Alarm Query as mentioned below
\\IntouchApplication Installed IP : Remote Desktop Machine IP \InTouch!$System
Note: The Remote Desktop machine IP is listed in SMC as "Registering AlarmMgr with SLSSVC as "AlarmMgr10.231.138.89" .
In above SMC log, 10.231.138.89 is Remote Desktop Machine IP. For more information please find the attached image file "ALMDBManager_RemoteMode.png". => Start the Alarm DB Logger Manage as service.
</pre>
Autostart Alarm DB Logger
- Method 1
Configure as an NT Service. This option is found in Settings within the Alarm DB Logger Manager.
- Method 2
To start Alarm DB Logger automatically without starting it as a Service, add the executable WWAlmLogger.exe to the Startup folder.
- Method 3
To start Alarm DB Logger automatically when starting the InTouch application, put the following in the Application OnStartup script:
StartApp "WWAlmLogger.exe";
Скрипты AS
Как опеределить что Alarm DB Logger запущен и в случае проблем запустить его
Execute script, whileTrue with expression of me.StartAlarmLoggerCmd
Dim procRunning as System.Boolean; Dim cp AS System.Diagnostics.Process; procRunning = False; For Each cp In System.Diagnostics.Process.GetProcessesByName("wwalmlogger") procRunning = True; Me.AlarmLoggerRunning = True; Me.StartAlarmLoggerCmd = False; Exit For; Next; If NOT procRunning Then Dim app As System.String; app = System.String.Format("{0}\wwalmlogger.exe", Me.PathToLogger); System.Diagnostics.Process.Start(app); EndIf; For Each cp In System.Diagnostics.Process.GetProcessesByName("wwalmlogger") procRunning = True; Me.AlarmLoggerRunning = True; Me.StartAlarmLoggerCmd = False; Exit For; Next;
Разные вопросы
Поддерживается ли работа нескольких Alarm DB logger для сохранения данных в одну БД
- нет, см. FAQ13829
- Возможная проблема:
Error: ! OLEDB ERROR = 2147500037; The Transaction (Process ID 61) was deadlocked on lock resources with another process due to a deadlock and was chosen as the deadlock victim. Execute the transaction again.\