alarm alarm_name; rem = string; bubble = string; timer = timer_name; owner = owner_name; position = integer, integer, integer, integer; win_disable = [ identifier, ... ]; win_title = string; access = integer; tab_select = integer; send_same_data; driver_exception = driver_name; file_name = string; file_type = identifier; file_length = integer; file_start = integer, integer, integer, integer; file_history = integer; file_access = real; file_name_type = identifier; file_mask_expression = real_expression; file_delete = boolean_expression; content = [ identifier, ... ]; date_item name = string; expression = real_expression; disable; end_date_item; time_item name = string; expression = real_expression; disable; end_time_item; odbc enable; dsn = string; user_name = string; password = string; file_extension = string; end_odbc; font = font_identifier, integer, style_identifier; record_structure = [ identifier, ... ]; message_content = [ identifier, ... ]; sort_mode = identifier; condition = boolean_expression; output = boolean_dataelement; journal = journal_name; disable_backup; receivers = [ identifier, ... ]; synchronize output = string_dataelement; receivers = [ identifier, ... ]; end_synchronize; item text = string; group = string; alarm_id = string; priority = integer; condition = boolean_expression; finish_condition = boolean_expression; expression = any_expression; rise_action = [ identifier, ... ]; rise_sound = file_name; rise_output = boolean_dataelement; rise_time = real_expression; finish_action = [ identifier, ... ]; finish_sound = file_name; finish_output = boolean_dataelement; finish_time = real_expression; confirm_action = [ identifier, ... ]; confirm_sound = file_name; confirm_output = boolean_dataelement; text_for_true = string; text_for_false = string; receivers = [ identifier, ... ]; end_item; item ... end_item; mask_item text = string; group = string; alarm_id = string; priority = integer; condition = boolean_expression; finish_condition = boolean_expression; value = data_element; rise_action = [ identifier, ... ]; rise_sound = file_name; rise_output = boolean_dataelement; rise_time = real_expression; finish_action = [ identifier, ... ]; finish_sound = file_name; finish_output = boolean_dataelement; finish_time = real_expression; confirm_action = [ identifier, ... ]; confirm_sound = file_name; confirm_output = boolean_dataelement; text_for_true = string; text_for_false = string; receivers = [ identifier, ... ]; end_mask_item; mask_item ... end_mask_item; array_item index_range = integer, integer; text = string; group = string; alarm_id = string; priority = integer; condition = boolean_expression; finish_condition = boolean_expression; value = array_data_element; rise_action = [ identifier, ... ]; rise_sound = file_name; rise_output = boolean_dataelement; rise_time = real_expression; finish_action = [ identifier, ... ]; finish_sound = file_name; finish_output = boolean_dataelement; finish_time = real_expression; confirm_action = [ identifier, ... ]; confirm_sound = file_name; confirm_output = boolean_dataelement; text_for_true = string; text_for_false = string; receivers = [ identifier, ... ]; end_array_item; array_item ... end_array_item; colors text = color; background = color; top_shadow = color; bottom_shadow = color; select = color; button_up_background = color; button_up_top_shadow = color; button_up_bottom_shadow = color; button_down_background = color; button_down_top_shadow = color; button_down_bottom_shadow = color; active_alarm = color; active_confirmed_alarm = color; inactive_alarm = color; inactive_confirmed_alarm = color; end_colors; end_alarm;
Podrobný popis parametrů pro definici archivních souborů je uveden v kapitole Databáze a archivace dat.
Definici alarmů pomocí těchto položek je výhodné používat všude tam, kde je potřeba nadefinovat řadu alarmů pro různé datové elementy, které však odpovídají nadefinované masce. Jako zástupný znak se používá hvězdička (*).
Například jsou definovány následující kanály
channel chrTH01 = real, 201, virtual, input, 'Tank č.01 - hladina'; chTH02 = real, 202, virtual, input, 'Tank č.02 - hladina'; ... chrTH10 = real, 210, virtual, input, 'Tank č.03 - hladina'; chbTV01 = boolean, 301, virtual, output, false, 'Tank č.01 - ventil'; chbTV02 = boolean, 302, virtual, output, false, 'Tank č.02 - ventil'; ... chbTV10 = boolean, 310, virtual, output, false, 'Tank č.03 - ventil'; end_channel;
maska chrTH* vyhovuje pro následující kanály
chrTH01, chrTH02 až chrTH10
Masku pro datové elementy mohou obsahovat položky condition, finish_condition, value, rise_output, finish_output, confirm_output.
Položky text a alarm_id mohou obsahovat i speciální kombinaci znaků, tzv. makra. Tato makra budou při spuštění aplikace nahrazena odpovídajícími texty.
\$ - toto makro bude nahrazeno jménem datového elementu
\# - toto makro bude nahrazeno číslem kanálu
\@ - toto makro bude nahrazeno komentářem, uvedeným u datového elementu
Příklad:
alarm Sample; ... mask_item text = 'Alarm (\@) - vstup \#' value = chbTV* rise_output = chTX* end_mask_item; end_alarm;
odpovídá zápisu
alarm Sample; ... item text = 'Alarm (Tank č.01 - hladina) - vstup 201' value = chbTV01 rise_output = chTX01 end_item; item text = 'Alarm (Tank č.02 - hladina) - vstup 202' value = chbTV02 rise_output = chTX02 end_item; ... item text = 'Alarm (Tank č.10 - hladina) - vstup 210' value = chbTV10 rise_output = chTX10 end_item; end_alarm;
Definici alarmů pomocí těchto položek je výhodné používat všude tam, kde je potřeba nadefinovat řadu alarmů pro datové elementy typu pole. Obdobně jako u mask_item je potom tato položka rozvinuta do jednotlivých položek odpovídajících jednotlivým prvkům pole.
Parametr index_range obsahuje rozsah indexů pole.
Parametry text a alarm_id mohou obsahovat i makra (viz popis parametru mask_item).
Parametry condition, finish_condition, value, rise_output, finish_output, confirm_output musí obsahovat pole, která výhovují zadanému rozsahu indexů.
Některé parametry mají implicitní nastavení
position = 0, 0, 350, 125; access = <none> tab_select = <none> content = tool_bar, list_box; file_type = relative; file_length = hour; file_start = 0, 0, 1, 1; file_history = 10; file_access = 4294967295; file_name_type = new_code; date_item name = 'DATE'; end_date_item; time_item name = 'TIME'; end_time_item; record_structure = classify, text, value, operator, priority, none; message_content = date, time, priority, text, operator, none, none; sort_mode = by_priority; colors text = black; background = lgray; top_shadow = dgray; bottom_shadow = white; select = black; button_up_background = lgray; button_up_top_shadow = white; button_up_bottom_shadow = dgray; button_down_background = lgray; button_down_top_shadow = dgray; button_down_bottom_shadow = white; active_alarm = black; active_confirmed_alarm = black; inactive_alarm = black; inactive_confirmed_alarm = black; end_colors;
Příklad nastavení parametrů přístroje:
alarm Alarm; owner = AlarmPanel; position = 16, 44, 360, 28; file_type = permanent; file_length = minute; file_name = 'ALARMS'; record_structure = date, time, classify, text; output = ActiveAlarms; receivers = MeterLastAlarm; item text = 'Alarm 1'; priority = 0; condition = Alarm1On; expression = Noise; rise_action = write, set_channel, display; rise_output = Alarm1Active; finish_action = write, beep, set_channel; finish_output = Alarm1Finished; confirm_action = write, beep, set_channel; confirm_output = Alarm1Confirmed; receivers = Alarm1LedOn; end_item; colors text = lyellow; background = red; top_shadow = lred; bottom_shadow = black; end_colors; end_alarm;
CheckAlarms()
Vyhodnotí všechny nadefinované alarmy.
ConfirmAlarm()
Potvrzení vybraného alarmu v list boxu.
ConfirmAlarmId( AlarmId : string )
Potvrzení alarmu specifikovaného parametrem AlarmId.
ConfirmAllAlarms()
Potvrzení všech alarmů zobrazených v list boxu.
ConfirmGroupAlarms( Group : string )
Potvrzení všech alarmů zobrazených v list boxu patřících do skupiny Group.
DeleteAlarms( Active, ActiveConfirmed, Inactive, InactiveConfirmed : boolean )
Odstraní specifikované alarmy.
Active - aktivní nepotvrzené alarmy
ActiveConfirmed - aktivní potvrzené alarmy
Inactive - neaktivní (již skončené) nepotvrzené alarmy
InactiveConfirmed - neaktivní (již skončené) potvrzené alarmy
GetLastAlarm( &Message : string )
V parametru Message vrací zprávu naposled vzniklého alarmu
GetNoOfActiveAlarms( &Total, &Confirmed : number )
V parametru Total vrací počet aktivních alarmů a v parametru Confirmed počet aktivních potvrzených alarmů.
GetNoOfInactiveAlarms( &Total, &Confirmed : number )
V parametru Total vrací počet neaktivních alarmů a v parametru Confirmed počet neaktivních potvrzených alarmů.
GoToLastAlarm()
Vybere a zobrazí v seznamu v ListBoxu naposled vzniklý alarm.
ShowAlarms( Active, ActiveConfirmed, Inactive, InactiveConfirmed : boolean )
Definuje, které alarmy mají být zobrazovány v seznamu v ListBoxu.
Active - aktivní nepotvrzené alarmy
ActiveConfirmed - aktivní potvrzené alarmy
Inactive - neaktivní (již skončené) nepotvrzené alarmy
InactiveConfirmed - neaktivní (již skončené) potvrzené alarmy
HideAlarmManager()
Uzavře okno Správce alarmů.
ShowAlarmManager()
Zobrazí okno Správce alarmů.
Hide()
Skrytí viditelného přístroje.
Show()
Zobrazení skrytého přístroje.
Synchronize( AlarmId, SyncTime, SyncDate : string )
Potvrzení alarmu specifikovaného parametrem AlarmId. Slouží pro synchronizaci alarmů. Parametry SyncTime a SyncDate mohou obsahovat čas a datum potvrzení alarmu - pokud nejsou zadány, použije se čas a datum z příslušného počítače.
Přístroj může volat standardní událostní procedury:
OnActivate() OnMouseDown( MouseX, MouseY : integer; LeftButton, MiddleButton, RightButton : boolean ) OnMouseDoubleClick( MouseX, MouseY : integer; LeftButton, MiddleButton, RightButton : boolean ) OnMouseUp( MouseX, MouseY : integer; LeftButton, MiddleButton, RightButton : boolean ) OnMouseMove( MouseX, MouseY : integer; LeftButton, MiddleButton, RightButton : boolean ) OnSelect() OnDeselect() OnShow() OnHide() OnNewPosition( RectX, RectY, RectW, RectD : integer ) OnWindowMinimize() OnWindowMaximize() OnWindowRestore( WasMinimized, WasMaximized : boolean ) OnWindowClose()
Podrobnější informace k těmto procedurám lze nalézt v kapitole Programování a procedury.
procedure OnAlarmRise( Date, Time, Text, Group, Id, Value string; Priority : real )
Procedura je volána po vzniku alarmu.
Date - datum vzniku alarmu
Time - čas vzniku alarmu
Text - textové hlášení spojené s tímto alarmem
Group - název skupiny alarmů
Id - identifikace alarmu
Value - sledovaná hodnota při vzniku alarmu
Priority - priorita
procedure OnAlarmFinish( Date, Time, Text, Group, Id, Value : string; Priority : real )
Procedura je volána po skončení alarmu.
Date - datum skončení alarmu
Time - čas skončení alarmu
Text - textové hlášení spojené s tímto alarmem
Group - název skupiny alarmů
Id - identifikace alarmu
Value - sledovaná hodnota při skončení alarmu
Priority - priorita
procedure OnAlarmConfirmation( Date, Time, Text, Group, Id, Value : string; Priority : real )
Procedura je volána po potvrzení alarmu.
Date - datum potvrzení alarmu
Time - čas potvrzení alarmu
Text - textové hlášení spojené s tímto alarmem
Group - název skupiny alarmů
Id - identifikace alarmu
Value - sledovaná hodnota při potvrzení alarmu
Priority - priorita