Commit 8599aa47 authored by Claes Sjofors's avatar Claes Sjofors

DSupComp and ASupComp added

parent 3a72aa92
Proview Android application PwrXtt build.
The android-sdk has to be installed under /usr/local.
The build script java/aapp/bld/src/os_templ/hw_templ/pwrxtt_build.sh and the
make files under java/appl creates an android application tree under
$pwre_broot/os_linux/hw_x86/bld/aapp.
......@@ -23,6 +25,6 @@ The application PwrXtt can be imported to eclipse by stating
$pwre_sroot/os_linux/hw_x86/bld/aapp as work directory. Import the project with
File/Import/General/Existing Projects... Activate Android Tools/Fix Project Properties
in the popup menu for the project. After this the application can be run and debugged.
Any changed in the java code should be copied back to source code in java/jwpr and
Any changes in the java code should be copied back to source code in java/jpwr and
java/aapp.
......@@ -111,7 +111,9 @@ typedef struct s_SaveBlock sSaveBlock;
typedef struct s_Sup sSup;
typedef struct s_Timer sTimer;
typedef struct s_ASup sASup;
typedef struct s_ASupComp sASupComp;
typedef struct s_DSup sDSup;
typedef struct s_DSupComp sDSupComp;
typedef union u_Event uEvent;
LstType(sActive);
......@@ -291,6 +293,7 @@ struct s_SupActive {
void *supInfoP;
void *op;
sTimer *timer;
pwr_tCid cid;
void (*detect_exec)(sSupActive *sp);
};
......@@ -302,6 +305,12 @@ struct s_ASup {
sTimer Timer pwr_dAlignLW;
};
struct s_ASupComp {
sSup Sup pwr_dAlignLW;
mh_sASupInfo Info pwr_dAlignW;
sTimer Timer pwr_dAlignLW;
};
struct s_DSup {
pwr_tBoolean *InP pwr_dAlignLW;
pwr_tBoolean In pwr_dAlignLW;
......@@ -310,6 +319,12 @@ struct s_DSup {
sTimer Timer pwr_dAlignLW;
};
struct s_DSupComp {
sSup Sup pwr_dAlignLW;
mh_sDSupInfo Info pwr_dAlignW;
sTimer Timer pwr_dAlignLW;
};
struct s_ApplActive {
sActive link;
LstLink(sApplActive) active_l;
......@@ -2611,6 +2626,8 @@ initSupActiveCB (
pwr_tStatus sts;
sASup *asp;
sDSup *dsp;
sASupComp *ascompp;
sDSupComp *dscompp;
pwr_sClass_NodeLinkSup *nlsp;
pwr_sClass_CycleSup *csp;
pwr_tAttrRef Object;
......@@ -2630,6 +2647,12 @@ initSupActiveCB (
case pwr_cClass_DSup:
sts = gdh_DLRefObjectInfoAttrref(SupObject, (pwr_tAddress *)&dsp, &Dlid);
break;
case pwr_cClass_ASupComp:
sts = gdh_DLRefObjectInfoAttrref(SupObject, (pwr_tAddress *)&ascompp, &Dlid);
break;
case pwr_cClass_DSupComp:
sts = gdh_DLRefObjectInfoAttrref(SupObject, (pwr_tAddress *)&dscompp, &Dlid);
break;
case pwr_cClass_NodeLinkSup:
sts = gdh_DLRefObjectInfoAttrref(SupObject, (pwr_tAddress *)&nlsp, &Dlid);
break;
......@@ -2653,6 +2676,12 @@ initSupActiveCB (
case pwr_cClass_DSup:
Object = dsp->Sup.Attribute;
break;
case pwr_cClass_ASupComp:
Object = ascompp->Sup.Attribute;
break;
case pwr_cClass_DSupComp:
Object = dscompp->Sup.Attribute;
break;
case pwr_cClass_NodeLinkSup:
Object = *SupObject;
break;
......@@ -2696,6 +2725,7 @@ initSupActiveCB (
sp->timer = &asp->Timer;
sp->op = (void *) asp;
sp->agent = getAgent(sp);
sp->cid = cid;
if (sp->agent == mh_eAgent_MH)
sp->detect_exec = aSup_exec;
break;
......@@ -2710,9 +2740,36 @@ initSupActiveCB (
sp->timer = &dsp->Timer;
sp->op = (void *) dsp;
sp->agent = getAgent(sp);
sp->cid = cid;
if (sp->agent == mh_eAgent_MH)
sp->detect_exec = dSup_exec;
break;
case pwr_cClass_ASupComp:
sp->supType = mh_eSupType_Analog;
sp->supDlid = Dlid;
sp->sup = &ascompp->Sup;
sp->supInfoSize = sizeof(mh_sASupInfo);
sp->supInfoP = &ascompp->Info;
sp->attribute = ascompp->Sup.Attribute;
sp->link.eventSound = ascompp->Sup.Sound;
sp->timer = &ascompp->Timer;
sp->op = (void *) ascompp;
sp->agent = getAgent(sp);
sp->cid = cid;
break;
case pwr_cClass_DSupComp:
sp->supType = mh_eSupType_Digital;
sp->supDlid = Dlid;
sp->sup = &dscompp->Sup;
sp->supInfoSize = sizeof(mh_sDSupInfo);
sp->supInfoP = &dscompp->Info;
sp->attribute = dscompp->Sup.Attribute;
sp->link.eventSound = dscompp->Sup.Sound;
sp->timer = &dscompp->Timer;
sp->op = (void *) dscompp;
sp->agent = getAgent(sp);
sp->cid = cid;
break;
case pwr_cClass_NodeLinkSup:
sp->supType = mh_eSupType_Link;
sp->supDlid = Dlid;
......@@ -2728,6 +2785,7 @@ initSupActiveCB (
sp->timer = (sTimer *)&nlsp->TimerFlag;
sp->op = (void *) nlsp;
sp->agent = mh_eAgent_None;
sp->cid = cid;
break;
case pwr_cClass_CycleSup:
sp->supType = mh_eSupType_Cycle;
......@@ -2745,6 +2803,7 @@ initSupActiveCB (
sp->op = (void *) csp;
sp->agent = mh_eAgent_MH;
sp->detect_exec = cSup_exec;
sp->cid = cid;
break;
default:
errh_Error("initSupActiveCB, program error, cid: %s", cdh_ClassIdToString(NULL, cid, 0));
......@@ -2800,6 +2859,14 @@ initSupList ()
if (EVEN(sts))
errh_Error("Initialize list of DSup's\n%m", sts);
sts = initSupListClass(pwr_cClass_ASupComp);
if (EVEN(sts))
errh_Error("Initiate list of ASupComp's\n%m", sts);
sts = initSupListClass(pwr_cClass_DSupComp);
if (EVEN(sts))
errh_Error("Initialize list of DSupComp's\n%m", sts);
sts = initSupListClass(pwr_cClass_NodeLinkSup);
if (EVEN(sts))
errh_Error("Initialize list of LinkSup's\n%m", sts);
......@@ -4184,6 +4251,8 @@ updateSupActive (
sActive *ap;
sASup *asp;
sDSup *dsp;
sASupComp *ascompp;
sDSupComp *dscompp;
sSup *sup;
mh_eAgent agent;
pwr_tClassId cid;
......@@ -4193,13 +4262,31 @@ updateSupActive (
/* Get pointer to supervisory object */
if (sp->supType == mh_eSupType_Analog) {
sts = gdh_AttrRefToPointer(&sp->link.supObject, (pwr_tAddress *)&asp);
sup = &asp->Sup;
cid = pwr_cClass_ASup;
switch ( sp->cid) {
case pwr_cClass_ASup:
sts = gdh_AttrRefToPointer(&sp->link.supObject, (pwr_tAddress *)&asp);
sup = &asp->Sup;
cid = sp->cid;
break;
case pwr_cClass_ASupComp:
sts = gdh_AttrRefToPointer(&sp->link.supObject, (pwr_tAddress *)&ascompp);
sup = &ascompp->Sup;
cid = sp->cid;
break;
}
} else if (sp->supType == mh_eSupType_Digital) {
sts = gdh_AttrRefToPointer(&sp->link.supObject, (pwr_tAddress *)&dsp);
sup = &dsp->Sup;
cid = pwr_cClass_DSup;
switch ( sp->cid) {
case pwr_cClass_DSup:
sts = gdh_AttrRefToPointer(&sp->link.supObject, (pwr_tAddress *)&dsp);
sup = &dsp->Sup;
cid = sp->cid;
break;
case pwr_cClass_DSupComp:
sts = gdh_AttrRefToPointer(&sp->link.supObject, (pwr_tAddress *)&dscompp);
sup = &dscompp->Sup;
cid = sp->cid;
break;
}
} else if (sp->supType == mh_eSupType_Link) {
return; /* Supervised attribute can't change. */
} else if (sp->supType == mh_eSupType_Cycle) {
......
......@@ -181,3 +181,131 @@
o->TimerCount = 0; \
o->DetectCheck = TRUE; \
}
/*_*
Name:
DSupCompFo_exec(object, In, con)
Description:
Supervise digital parameter
@aref dsupcompfo DSupCompFo
*/
#define DSupCompFo_init(o)\
{\
pwr_tDlid dlid;\
pwr_tStatus sts;\
sts = gdh_DLRefObjectInfoAttrref( &o->PlcConnect, (void **)&o->PlcConnectP, &dlid);\
if ( EVEN(sts))\
o->PlcConnectP = 0;\
else\
((pwr_sClass_DSupComp *)o->PlcConnectP)->TimerDO = &(((pwr_sClass_DSupComp *)o->PlcConnectP)->TimerDODum);\
}
#define DSupCompFo_exec(o, In, con)\
{\
pwr_sClass_DSupComp *co = (pwr_sClass_DSupComp *)o->PlcConnectP;\
if ( !co)\
return;\
if (In != co->CtrlPosition) {\
if (co->Action) co->Action = FALSE;\
if (co->ReturnCheck) {\
time_GetTime( &co->ReturnTime);\
co->ReturnCheck = FALSE;\
co->ReturnSend = TRUE;\
}\
if (co->AlarmCheck && !co->DetectCheck) {\
co->TimerCount = 0;\
co->DetectCheck = TRUE;\
}\
} else if (con) {\
if (!co->Action) co->Action = TRUE;\
if (co->AlarmCheck && co->DetectOn && !co->Blocked) {\
if (co->DetectCheck) {\
co->ActualValue = In;\
timer_in(tp, co);\
time_GetTime(&co->DetectTime);\
co->DetectCheck = FALSE;\
}\
if (!co->TimerFlag) {\
co->DetectSend = TRUE;\
co->ReturnCheck = TRUE;\
co->Acked = FALSE;\
co->AlarmCheck = FALSE;\
}\
}\
}\
if (co->Blocked) {\
co->TimerCount = 0;\
co->DetectCheck = TRUE;\
}\
o->Action = co->Action;\
o->Acked = co->Acked;\
o->Blocked = co->Blocked;\
}
/*_*
Name:
ASupCompFo_exec(object, In, con)
Description:
Supervise analog parameter
@aref asupcompfo ASupCompFo
*/
#define ASupCompFo_init(o)\
{\
pwr_tDlid dlid;\
pwr_tStatus sts;\
sts = gdh_DLRefObjectInfoAttrref( &o->PlcConnect, (void **)&o->PlcConnectP, &dlid);\
if ( EVEN(sts))\
o->PlcConnectP = 0;\
else\
((pwr_sClass_ASupComp *)o->PlcConnectP)->TimerDO = &(((pwr_sClass_ASupComp *)o->PlcConnectP)->TimerDODum);\
}
#define ASupCompFo_exec(o, In, con)\
{\
pwr_sClass_ASupComp *co = (pwr_sClass_ASupComp *)o->PlcConnectP;\
if ( !co)\
return;\
if ((co->High && In <= co->CtrlLimit - co->Hysteres) ||\
(!co->High && In >= co->CtrlLimit + co->Hysteres)\
) {\
if (co->Action) co->Action = FALSE;\
if (co->ReturnCheck) {\
time_GetTime(&co->ReturnTime);\
co->ReturnCheck = FALSE;\
co->ReturnSend = TRUE;\
}\
if (co->AlarmCheck && !co->DetectCheck) {\
co->TimerCount = 0;\
co->DetectCheck = TRUE;\
}\
} else if (con &&\
((co->High && In > co->CtrlLimit) ||\
(!co->High && In < co->CtrlLimit))) {\
if (!co->Action) co->Action = TRUE;\
if (co->AlarmCheck && co->DetectOn && !co->Blocked) {\
if (co->DetectCheck) {\
co->ActualValue = In;\
timer_in(tp, co);\
time_GetTime(&co->DetectTime);\
co->DetectCheck = FALSE;\
}\
if (!co->TimerFlag) {\
co->DetectSend = TRUE;\
co->ReturnCheck = TRUE;\
co->Acked = FALSE;\
co->AlarmCheck = FALSE;\
}\
}\
}\
if (co->Blocked) {\
co->TimerCount = 0;\
co->DetectCheck = TRUE;\
}\
o->Action = co->Action;\
o->Acked = co->Acked;\
o->Blocked = co->Blocked;\
}
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2013 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_c_asupcomp.wb_load -- Defines the class ASupComp.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_macro_sup.h
! @Group Plc,PlcAnalog,Supervision,PlantConfiguration
! @Summary Analog supervisory
! Analog Supervisory.
! @image orm_asup_fo.gif
!
! Supervises an analog quantity in an arbitrary object in
! regard to deviation above or below the alarm limit.
! High specifies if it is values above or below the alarm
! limit that constitutes the alarm position.
!
! The alarm limit may be provided with hysteresis,
! Hysteres. The alarm message can be delayed by a time
! specified by TimerTime.
! The ASup object reacts in two ways when the quantity is
! in the alarm position:
!
! 1 the 'act' output is unconditionally set to indicate
! alarm state
! 2 after a time, defined by TimerTime, a message is
! sent to the out units, for instance operator
! stations. This reaction can be suppressed by means
! of DetectOn.
!
! A message contains the text string DetectText as well
! as flags ( see EventFlags) to handle supplementary
! activities.
!
! Different types of activities exist; (see EventType )
! ALARM The message remains as long as the alarm
! position exists and no acknowledgement is
!
! INFO If the message demands an acknowledgement
! this is sent to the info part of the alarm
! window from, where it can be acknowledged
! otherwise only to the event list.
! An acknowledgeable info-message disappears
! from the info part of the alarm window as
! soon as it has been acknowleged without
! waiting for return to normal state. As soon
! as the supervised signal, that gave an info
!
!
!
! The ALARM-messages are given different priorities, (
! see EventPriority ). The texts of A- respectively
! B-alarms are displayed both in the alarm window and the
! alarm list. Acknowledgement can be done from both
! places. In the alarm window the number of
! unacknowledged C- respectively D-alarms is shown, while
! the texts is put into the alarm list, where the
! acknowledgement can be done too.
! Different types of out units exist:
!
! - OPERATOR: The select list is defined by an attribute
! in a User object.
! - PRINTER : The select list is defined by an
! attribute in an
! EventPrinter object.
!
! Note! A message created by an ASup object gets the same
! identity as the supervised object. The attribute
! SelectList in out unit objects, e.g. User objects,
! specifies the hierarchies from which messages are to be
! received.
!
! @b Hints
! The supervised quantity may belongs to an arbitrary
! object. This means not only signal objects but also
! other objects may supervised; e.g. attributes in a
! user-defined object.
! It is possible to configure both ASup and DSup objects
! in different ways. At configuring in a PLC program the
! PLC job will do the supervision. When the objects are
! configured outside PLC program, then it is done by the
! Configuration Editor and
! the messagehandler (=mh) takes care of the supervision.
! @image orm_en1-23.gif
! The Supervisory Objects may also be used Outside PLC Programs
!
! @b See Also
! @classlink DSup pwrb_dsup.html
!*/
Object ASupComp $ClassDef 613
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "ASupComp"
EndBody
!/**
! Not used.
!*/
Object ControlP $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! Shows whether the supervision is enabled or disabled.
!*/
Object Control $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Specifies the status of supervised quantity. FALSE
! means normal state and TRUE means alarm state.
!
! The output signal can, for instance, be used to
! activate an action sequence at alarm state.
!*/
Object Action $Attribute 3
Body SysBody
Attr PgmName = "Action"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Specifies if the alarm state has been acknowledged or
! not. FALSE means that unacknowledged alarm exists. The
! output is set TRUE initially when the ASup object is
! created in rtdb and when the alarm state has been
! acknowledged.
!*/
Object Acked $Attribute 4
Body SysBody
Attr PgmName = "Acked"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Specifies whether to enable or disable the blocking. No
! messages from the supervision object will be sent away
! as long as the object is blocked. The blocking does not
! influence on the 'act' output of the object.
! FALSE disables the the blocking and TRUE enables the
! blocking. When a supervisory object in alarm position
! is blocked current messages will be cancelled.
! Blocking /deblocking is done by means of the 'Alarm
! Blocking Window' in the operator environment.
!*/
Object Blocked $Attribute 5
Body SysBody
Attr PgmName = "Blocked"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
! ++
! Sup struct
!
!/**
! Optional text to describe the object. It is used in the
! picture Alarm Limits which is activated from the
! operator window.
!*/
Object Description $Attribute 6
Body SysBody
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Specifies whether to enable or disable the action,
! which, at alarm state implies DetectText to be sent or
! not. FALSE means that no message will be sent at alarm
! state; TRUE means that DetectText is sent at alarm
! state.
!*/
Object DetectOn $Attribute 7
Body SysBody
Attr PgmName = "DetectOn"
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Alarm message. Optional text, which will be written at
! alarm state if DetectOn is TRUE.
!*/
Object DetectText $Attribute 8
Body SysBody
Attr PgmName = "DetectText"
Attr TypeRef = "pwrs:Type-$String80"
Attr Flags |= PWR_MASK_BACKUP
EndBody
EndObject
!/**
! Return message. Optional text, which will be written in
! the event list at return to normal state.
!*/
Object ReturnText $Attribute 9
Body SysBody
Attr PgmName = "ReturnText"
Attr Flags |= PWR_MASK_BACKUP
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Specifies the type of the message (=DetectText ) which
! will be sent at alarm state.
!
! -- 64 ALARM The message always requires an
! acknowledgement and sent to the alarm
!
! -- 32 INFO If the message requires acknowledgement is
! it sent to the info part of the alarm
! window and the event list, otherwise only
! to the event list.
!*/
Object EventType $Attribute 10
Body SysBody
Attr PgmName = "EventType"
Attr TypeRef = "pwrb:Type-EventTypeEnum"
EndBody
EndObject
!/**
! Priorities concerning alarm messages.
!
! -- 67 A-alarm; highest priority. (=43Hex)
! -- 66 B-alarm (= 42Hex)
! -- 65 C-alarm (= 41Hex)
! -- 64 D-alarm; lowest priority. (=40Hex)
!*/
Object EventPriority $Attribute 11
Body SysBody
Attr PgmName = "EventPriority"
Attr TypeRef = "pwrb:Type-EventPrioEnum"
EndBody
EndObject
!/**
! Bit map. A combination of flags can be attached to the
! message. The possible values are as follows:
!
! -- 1 If this flag exists the return message ReturnText
! will be sent to the event lists at the out units,
! -- 2 If this flag exists the acknowledgement message
! will be sent to the event lists at the out-units,
!
! -- 4 If the single out unit has a peep-function this
! will be activated when the message is received.
! -- 8 The message is sent to every out unit regardless
!
! --16 If the message is of the type INFO it will be
! placed in the event list. If this flag exists the
! message is also placed in the INFO square of the
! alarm window where acknowledgement is to be done.
!*/
Object EventFlags $Attribute 12
Body SysBody
Attr PgmName = "EventFlags"
Attr TypeRef = "pwrb:Type-EventFlagsMask"
EndBody
EndObject
!/**
! Reference to a sound object, that defines the sound at the operator
! place when the alarm is active. If no sound object is supplied, an
! ordinary beep is used. The sound object should be of class Sound
! or SoundSequence
!*/
Object Sound $Attribute 13
Body SysBody
Attr PgmName = "Sound"
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
!/**
! Optional text supplying more information about the event.
! The more text can for example contain actions to be made when an alarm is detected.
!*/
Object MoreText $Attribute 14
Body SysBody
Attr PgmName = "MoreText"
Attr TypeRef = "pwrs:Type-$Text256"
EndBody
EndObject
!/**
! Recipient for epost and mms alarms.
! The recipient is a user defined in the user database in the
! current system group.
! Recipient can also be a list of users separated by comma, eg
! 'dennis, jimmy'. Also symbols defined in the Symbol table in
! the PostConfig object can be used. Symbols should be referenced
! with a $ sign before the symbol name, eg '$on_duty'.
!
! The users should be defined in the current system group or in a
! subgroup to this, If a subgroup is used, the subgroup should
! be specified in the recipient name, eg 'sms.dennis'.
!*/
Object Recipient $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
!/**
! Specifies the complete name of supervised parameter.
! Attribute is filled in by the user if the input named
! IN is left open. If the input is connected the names
! are filled in by the PROVIEW/R system at compilation.
!*/
Object Attribute $Attribute 16
Body SysBody
Attr PgmName = "Attribute"
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
!/**
! Status value. Bit map containing 16 bits, where the 8
! least significant bits denote the state and the 8 most
! significant bits the priority.
!
! The state is a combination of:
! -- 0 Normal state
! -- 1 Alarm state
! -- 2 Unacknowledged alarm
!
! The priority is one of the priorities specified by
! EventPriority.
! The following kinds of status can exist:
! EventPriority + 1 => Priority + alarm state
! EventPriority + 3 => Priority + unacknowledged alarm and alarm state
! EventPriority + 2 => Priority + unacknowledged alarm and normal state
!*/
Object AlarmStatus $Attribute 17
Body SysBody
Attr PgmName = "AlarmStatus"
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Used internal at the event detection.
!*/
Object AlarmCheck $Attribute 18
Body SysBody
Attr PgmName = "AlarmCheck"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Specifies if an alarm state will be detected or not.
! FALSE means that an alarm state will not be detected;
! TRUE means that an alarm state will be detected.
!*/
Object DetectCheck $Attribute 19
Body SysBody
Attr PgmName = "DetectCheck"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Specifies if the message has been sent to the out units
! (or more precisely the message handler) or not. TRUE
! means that the message has been sent.
!*/
Object DetectSend $Attribute 20
Body SysBody
Attr PgmName = "DetectSend"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Date and time when the last alarm state was detected.
!*/
Object DetectTime $Attribute 21
Body SysBody
Attr PgmName = "DetectTime"
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Specifies if the object has returned to normal state or
! not. TRUE means that the object has returned to normal
! state.
!*/
Object ReturnCheck $Attribute 22
Body SysBody
Attr PgmName = "ReturnCheck"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Specifies if the return message, ReturnText, has been
! sent to the out units or not. TRUE means that the
! return message has been sent.
!*/
Object ReturnSend $Attribute 23
Body SysBody
Attr PgmName = "ReturnSend"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Date and time when the last return to normal was
! detected.
!*/
Object ReturnTime $Attribute 24
Body SysBody
Attr PgmName = "ReturnTime"
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Date and time when the last acknowledgement was
! detected.
!*/
Object AckTime $Attribute 25
Body SysBody
Attr PgmName = "AckTime"
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Identity of the out unit (operator), from where the
! acknowledgement was done.
!*/
Object AckOutunit $Attribute 26
Body SysBody
Attr PgmName = "AckOutunit"
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
! End of Sup struct
! --
! ++
! ASup inf struct
!
!/**
! Value of supervised parameter at TimeOfDetect.
!*/
Object ActualValue $Attribute 27
Body SysBody
Attr PgmName = "ActualValue"
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Supervisory limit.
!*/
Object CtrlLimit $Attribute 28
Body SysBody
Attr PgmName = "CtrlLimit"
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_BACKUP
EndBody
EndObject
!/**
! Hysteresis. Specifies an absolute value, by which the
! supervised parameter at least has to deviate from
! CtrlLimit, before return.
!*/
Object Hysteres $Attribute 29
Body SysBody
Attr PgmName = "Hysteres"
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_BACKUP
EndBody
EndObject
!/**
! Specifies if an alarm position exists when the quantity
! is below or above the CtrlLimit.
!
! FALSE: Below, i.e. the supervised quantity < CtrlLimit
! means alarm position.
! TRUE: Above, i.e. the supervised quantity > CtrlLimit
! means alarm position.
!*/
Object High $Attribute 30
Body SysBody
Attr PgmName = "High"
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Unit of the supervised quantity.
!*/
Object Unit $Attribute 31
Body SysBody
Attr PgmName = "Unit"
Attr TypeRef = "pwrs:Type-$String16"
EndBody
EndObject
!
! End of ASup inf struct
! --
! ++
! Timer struct
!
!/**
! Indicates an active timer.
!*/
Object TimerFlag $Attribute 32
Body SysBody
Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Points to the next element in the timer queue.
!*/
Object TimerNext $Attribute 33
Body SysBody
Attr PgmName = "TimerNext"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Number of remaining ticks.
!*/
Object TimerCount $Attribute 34
Body SysBody
Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! Points to a Do or Dv object or, if these are not used,
! to TimerDoDum. After a time of, TimerTime the signal
! specified by TimerDo is cleared.
!*/
Object TimerDO $Attribute 35
Body SysBody
Attr PgmName = "TimerDO"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Delay in seconds. Specifies when, since an alarm state
! has occurred, DetectText will be sent. If the alarm
! state disappears before the time has elapsed no message
! is generated.
!
! TimerTime >= the executing period of the PLC program.
!*/
Object TimerTime $Attribute 36
Body SysBody
Attr PgmName = "TimerTime"
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_BACKUP
EndBody
EndObject
!/**
! Dummy. If TimerDoDum does not point to a Do or Dv
! object it points to this attribute.
!*/
Object TimerDODum $Attribute 37
Body SysBody
Attr PgmName = "TimerDODum"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Identity of this object is set at load file creation.
! Used by the run time system.
!*/
Object TimerObjDId $Attribute 38
Body SysBody
Attr Flags |= PWR_MASK_OBJDIDSELF
Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!/**
! The operator's authorities regarding to TimerTime. Not
! implemented.
!
! 0 -- Changes not allowed.
! !=0 -- Changes allowed.
!*/
Object TimerAcc $Attribute 39
Body SysBody
Attr PgmName = "TimerAcc"
Attr TypeRef = "pwrs:Type-$Int32"
EndBody
EndObject
!/**
! Specifies a valid interval at changes of TimerTime made
! by the operator.
!*/
Object TimerMin $Attribute 40
Body SysBody
Attr PgmName = "TimerMin"
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Specifies a valid interval at changes of TimerTime made
! by the operator.
!*/
Object TimerMax $Attribute 41
Body SysBody
Attr PgmName = "TimerMax"
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!
! End Timer struct
! --
Object PlcConnect $Attribute 42
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
!/**
! 'Attribute' is assigned a value that should not be changed.
! Normally the 'Attribute' value is fetched from the object connected
! to the In input pin. If LockAttribute is set, and Attribute is
! assigned a value, this value will not be changed by the compiler.
!*/
Object LockAttribute $Attribute 43
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
Object Template ASupComp
Body RtBody
Attr EventType = 64
Attr EventPriority = 67
Attr EventFlags = 7
Attr DetectOn = 1
Attr High = 1
EndBody
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2013 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_c_asupcompfo.wb_load -- Defines the class ASupCompFo.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_macro_sup.h
! @Group Plc,PlcAnalog,Supervision,PlantConfiguration
! @Summary Analog supervisory
! Analog Supervisory.
! @image orm_asup_fo.gif
!
!
! @b See Also
! @classlink DSup pwrb_asupcomp.html
!*/
Object ASupCompFo $ClassDef 615
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "ASupCompFo"
EndBody
!/**
! Supervised signal. If the input is left unconnected
! Attribute tells what to supervise.
!*/
Object In $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_NOEDIT
Attr GraphName = "IN"
EndBody
EndObject
!/**
! Specifies whether to enable or disable the supervision.
! Note that blocking is done when Control is FALSE. The
! input signal can be inverted.
! FALSE disables the supervision and TRUE or open input
! enables the supervision.
!*/
Object Control $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_NOEDIT
Attr GraphName = "con"
EndBody
EndObject
!/**
! Specifies the status of supervised quantity. FALSE
! means normal state and TRUE means alarm state.
!
! The output signal can, for instance, be used to
! activate an action sequence at alarm state.
!*/
Object Action $Output 3
Body SysBody
Attr PgmName = "Action"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "act"
EndBody
EndObject
!/**
! Specifies if the alarm state has been acknowledged or
! not. FALSE means that unacknowledged alarm exists. The
! output is set TRUE initially when the ASup object is
! created in rtdb and when the alarm state has been
! acknowledged.
!*/
Object Acked $Output 4
Body SysBody
Attr PgmName = "Acked"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr GraphName = "ack"
EndBody
EndObject
!/**
! Specifies whether to enable or disable the blocking. No
! messages from the supervision object will be sent away
! as long as the object is blocked. The blocking does not
! influence on the 'act' output of the object.
! FALSE disables the the blocking and TRUE enables the
! blocking. When a supervisory object in alarm position
! is blocked current messages will be cancelled.
! Blocking /deblocking is done by means of the 'Alarm
! Blocking Window' in the operator environment.
!*/
Object Blocked $Output 5
Body SysBody
Attr PgmName = "Blocked"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr GraphName = "blk"
EndBody
EndObject
Object PlcConnect $Intern 6
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
Object PlcConnectP $Intern 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
!/**
! Specifies if DetectText is to be displayed in the
! symbol of the ASup object or not. FALSE means no
! displaying and TRUE displaying.
!*/
Object ShowDetectText $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 11
Attr parameters[0] = 2
Attr parameters[1] = 0
Attr parameters[2] = 3
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 9
Attr graphindex = 0
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr rtbody_annotation = 1
Attr compmethod = 67
Attr compindex = 0
Attr executeordermethod = 2
Attr tracemethod = 3
Attr traceindex = 1
Attr connectmethod = 10
Attr objname = "ASupCompFo"
Attr graphname = "ASupCompFo"
Attr debugpar = "Action"
EndBody
EndObject
Object Template ASupCompFo
Body RtBody
EndBody
Body DevBody
Attr ShowDetectText = 1
EndBody
EndObject
Object RtXtt $RtMenu
Object PlcConnect $MenuRef
Body SysBody
Attr ButtonName = "PlcConnect"
Attr RefAttribute = "PlcConnect"
EndBody
EndObject
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2013 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_c_dsupcomp.wb_load -- Defines the class DSupComp.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_macro_sup.h
! @Group Plc,PlcLogic,Supervision,PlantConfiguration
! @Summary Digital supervisory
! Digital Supervisory.
! @image orm_dsup_fo.gif
!
! Supervises a binary quantity in an arbitrary object in
! regard to alarm position. CtrlPosition specifies if
! true or false constitutes the alarm position. The alarm
! message can be delayed by a time specified by TimerTime.
!
! The DSup object reacts in two ways when the quantity is
! in the alarm position:
!
! 1 the act-output is unconditionally set to indicate
! alarm state.
!
! 2 after the time defined by TimerTime a message is
! sent to the out units, for instance operator
! stations. This reaction can be suppressed by means
! of DetectOn.
!
! A message contains the text string DetectText as well
! as flags ( see EventFlags) to handle supplementary
! activities.
! Different types of activities exist; (see EventType )
!
! - ALARM The message remains as long as the alarm
! position exists and no acknowledgement is
!
! - INFO If the message demands an acknowledgement
! this is sent to the info part of the alarm
! window from, where it can be acknowledged,
! otherwise only to the event list.
!
! An acknowledgeable info-message disappears
! from the info part of the alarm window as
! soon as it has been acknowledged without
! waiting for return to normal state. As soon
! as the supervised signal that gave an info
! message, reaches the same position again and
! this has been detected a new message is generated.
!
!
! The ALARM messages are given different priorities, (
! see EventPriority ). The texts of A- respectively
! B-alarms are displayed both in the alarm window and the
! alarm list. Acknowledgement can be done from both
! places. In the alarm window the number of
! unacknowledged C- resp. D-alarms is shown, while the
! text is put into the alarm list, where the
! acknowledgement can be done too.
!
! Different types of out units exist:
!
! - OPERATOR: The select list is defined by an attribute
! in a User object.
! - PRINTER: The select list is defined by an
! attribute in an EventPrinter
! object.
!
! Note! A message created by an DSup object gets the same
! identity as the supervised object. The attribute
! SelectList in out unit objects, e.g. User objects,
! specifies the hierarchies from which messages are to be
! received.
!
! @b Hints
! Supervision of a trailing edge can be done when the In-signal
! has been inverted.
!
! The supervised quantity may belongs to an arbitrary
! object. This means not only signal objects but also
! other objects may supervised; e.g. attributes in a
! user-defined object.
! It is possible to configure both ASup and DSup objects
! in different ways. At configuring in a PLC program the
! PLC job will do the supervision. When the objects are
! configured outside PLC program, then it is done by the Configuration
! Editor and the eventmonitor takes care of the
! supervision.
!
! @b See Also
! @classlink ASup pwrb_asup.html
!*/
Object DSupComp $ClassDef 612
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DSupComp"
EndBody
!/**
! Not used.
!*/
Object ControlP $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_PRIVATE
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_RTHIDE
EndBody
EndObject
!/**
! Shows whether the supervision is enabled or disabled.
!*/
Object Control $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Specifies the status of supervised quantity. FALSE
! means normal state and TRUE means alarm state.
! The output signal can for instance be used to activate
! an action sequence at alarm state.
!*/
Object Action $Attribute 3
Body SysBody
Attr PgmName = "Action"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Specifies if the alarm state has been acknowledged or
! not. FALSE means that unacknowledged alarm exists. The
! output is set TRUE after booting and when the alarm
! state has been acknowledged.
!*/
Object Acked $Attribute 4
Body SysBody
Attr PgmName = "Acked"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Specifies whether to enable or disable the blocking. No
! messages from the supervision object will be sent away
! as long as the object is blocked. The blocking does not
! influence on the 'act' output of the object.
!
! FALSE disables the the blocking and TRUE enables the
! blocking. When a supervisory object in alarm position
! is blocked current messages will be cancelled.
! Blocking /deblocking is done by means of the 'Alarm
! Blocking Window' in the operator environment.
!*/
Object Blocked $Attribute 5
Body SysBody
Attr PgmName = "Blocked"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
! ++
! Sup struct
!
!/**
! Optional text to describe the object. It is used in the
! picture Alarm Limits which is activated from the
! operator window.
!*/
Object Description $Attribute 6
Body SysBody
Attr PgmName = "Description"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Specifies whether to enable or disable the action,
! which at alarm state implies DetectText to be sent or
! not. FALSE means that no message will be sent at alarm
! state; TRUE means that DetectText is sent at alarm
! state.
!*/
Object DetectOn $Attribute 7
Body SysBody
Attr PgmName = "DetectOn"
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Alarm message. Optional text which will be written out
! at alarm state if DetectOn is TRUE.
!*/
Object DetectText $Attribute 8
Body SysBody
Attr PgmName = "DetectText"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Return message. Text which will be written in the event
! list at return to normal state.
!*/
Object ReturnText $Attribute 9
Body SysBody
Attr PgmName = "ReturnText"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Specifies the type of the message (=DetectText ) which
! will be sent at alarm state.
! ALARM -- 64 The message always requires an
! acknowledgement and sent to the alarm
!
! INFO -- 32 If the message requires acknowledgement is
! it sent to the info part of the alarm
! window and the event list, otherwise only
!*/
Object EventType $Attribute 10
Body SysBody
Attr PgmName = "EventType"
Attr TypeRef = "pwrb:Type-EventTypeEnum"
EndBody
EndObject
!/**
! Priorities concerning alarm messages.
!
! -- 67 A-alarm; highest priority. (=43Hex)
! -- 66 B-alarm (= 42Hex)
! -- 65 C-alarm (= 41Hex)
! -- 64 D-alarm ; lowest priority. (=40Hex)
!*/
Object EventPriority $Attribute 11
Body SysBody
Attr PgmName = "EventPriority"
Attr TypeRef = "pwrb:Type-EventPrioEnum"
EndBody
EndObject
!/**
! Bit map. A flag combination may be attached to the
! message:
!
! 1 = If this flag exists the return message
! ReturnText will be sent to the event lists of
!
! 2 = If this flag exists the acknowledgement message
! will be sent to the event lists of the out
!
! 4 = If the out unit has a peep-function this will
! be activated when the message is received.
!
! 8 = The message is sent to every out unit
!
! 16 = If the message is of the type INFO it will be
! placed in the event list. If this flag exists
! the message is also placed in the INFO square
! of the alarm window where acknowledgement is to
!*/
Object EventFlags $Attribute 12
Body SysBody
Attr PgmName = "EventFlags"
Attr TypeRef = "pwrb:Type-EventFlagsMask"
EndBody
EndObject
!/**
! Reference to a sound object, that defines the sound at the operator
! place when the alarm is active. If no sound object is supplied, an
! ordinary beep is used. The sound object should be of class Sound
! or SoundSequence
!*/
Object Sound $Attribute 13
Body SysBody
Attr PgmName = "Sound"
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
!/**
! Optional text supplying more information about the event.
! The more text can for example contain actions to be made when an alarm is detected.
!*/
Object MoreText $Attribute 14
Body SysBody
Attr PgmName = "MoreText"
Attr TypeRef = "pwrs:Type-$Text256"
EndBody
EndObject
!/**
! Recipient for epost and mms alarms.
! The recipient is a user defined in the user database in the
! current system group.
! Recipient can also be a list of users separated by comma, eg
! 'dennis, jimmy'. Also symbols defined in the Symbol table in
! the PostConfig object can be used. Symbols should be referenced
! with a $ sign before the symbol name, eg '$on_duty'.
!
! The users should be defined in the current system group or in a
! subgroup to this, If a subgroup is used, the subgroup should
! be specified in the recipient name, eg 'sms.dennis'.
!*/
Object Recipient $Attribute 15
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
!/**
! Attribute is filled in by the user if the input named
! IN is left open. If the input is connected the names
! are filled in by the PROVIEW/R system at compilation.
!*/
Object Attribute $Attribute 16
Body SysBody
Attr PgmName = "Attribute"
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
!/**
! Status value. Bit map containing 16 bits where the 8
! least significant bits denote the state and the 8 most
! significant bits the priority.
! The state is a combination of:
!
! -- 0 Normal state
! -- 1 Alarm state
! -- 2 Unacknowledged alarm
! The priority is one of the priorities EventPriority.
!
! The following status can exist:
! EventPriority + 1 => Priority + alarm state
! EventPriority + 3 => Priority + unacknowledged alarm
! and alarm state
!*/
Object AlarmStatus $Attribute 17
Body SysBody
Attr PgmName = "AlarmStatus"
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Used internal at the event detection.
!*/
Object AlarmCheck $Attribute 18
Body SysBody
Attr PgmName = "AlarmCheck"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Specifies if an alarm state will be detected or not.
! FALSE means that an alarm state will not be detected;
! TRUE means that an alarm state will be detected.
!*/
Object DetectCheck $Attribute 19
Body SysBody
Attr PgmName = "DetectCheck"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Specifies if the message has already been sent to the
! out units (or more precisely the message handler) or
! not. TRUE means that the message has been sent.
!*/
Object DetectSend $Attribute 20
Body SysBody
Attr PgmName = "DetectSend"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Date and time when alarm state was detected.
!*/
Object DetectTime $Attribute 21
Body SysBody
Attr PgmName = "DetectTime"
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Specifies if the object has returned to normal state or
! not. TRUE means that the object has returned to normal
! state.
!*/
Object ReturnCheck $Attribute 22
Body SysBody
Attr PgmName = "ReturnCheck"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Specifies if the return message, ReturnText, has been
! sent to the out units or not. TRUE means that the
! return message has been sent.
!*/
Object ReturnSend $Attribute 23
Body SysBody
Attr PgmName = "ReturnSend"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Date and time when the last return to normal was
! detected.
!*/
Object ReturnTime $Attribute 24
Body SysBody
Attr PgmName = "ReturnTime"
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Date and time when the last acknowledgement of normal
! state was detected.
!*/
Object AckTime $Attribute 25
Body SysBody
Attr PgmName = "AckTime"
Attr TypeRef = "pwrs:Type-$Time"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Identity of the out unit (operator) which made an
! acknowledgement.
!*/
Object AckOutunit $Attribute 26
Body SysBody
Attr PgmName = "AckOutunit"
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!
! End of Sup struct
! --
! ++
! DSup inf struct
!
!/**
! Value of supervised parameter at TimeOfDetect.
!*/
Object ActualValue $Attribute 27
Body SysBody
Attr PgmName = "ActualValue"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
!/**
! Specifies if alarm position is TRUE or FALSE.
! FALSE = When the In-signal makes the transition
! 1 --> 0 => alarm state
! We prefer to avoid this case by inversion of the input signal
! TRUE = When the In-signal makes the transition
! 0 --> 1 => alarm state. This is the normal case.
!*/
Object CtrlPosition $Attribute 28
Body SysBody
Attr PgmName = "CtrlPosition"
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!
! End of DSup inf struct
! --
! ++
! Timer struct
!
!/**
! Indicates an active timer.
!*/
Object TimerFlag $Attribute 29
Body SysBody
Attr PgmName = "TimerFlag"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Points to the next element in the timer queue.
!*/
Object TimerNext $Attribute 30
Body SysBody
Attr PgmName = "TimerNext"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Number of remaining ticks.
!*/
Object TimerCount $Attribute 31
Body SysBody
Attr PgmName = "TimerCount"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! Points to a Do or Dv object or, if these are not used,
! to TimerDoDum. After a time of TimerTime the signal
! specified by TimerDo is cleared.
!*/
Object TimerDO $Attribute 32
Body SysBody
Attr PgmName = "TimerDO"
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_PRIVATE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Delay in seconds. Specifies when, since an alarm state
! has occurred, the message will be sent. If the alarm
! state disappears before the time has elapsed no message
! is generated.
! TimerTime >= the executing period of the PLC program.
!*/
Object TimerTime $Attribute 33
Body SysBody
Attr PgmName = "TimerTime"
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Dummy. If TimerDoDum does not point to a Do or Dv
! object it points to this attribute.
!*/
Object TimerDODum $Attribute 34
Body SysBody
Attr PgmName = "TimerDODum"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Identity of this object is set at load file creation.
! Used by the run time system.
!*/
Object TimerObjDId $Attribute 35
Body SysBody
Attr Flags |= PWR_MASK_OBJDIDSELF
Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
EndObject
!/**
! The operator's authorities to change TimerTime. Not
! implemented.
!
! 0 -- Changes not allowed.
! !=0 -- Changes allowed.
!*/
Object TimerAcc $Attribute 36
Body SysBody
Attr PgmName = "TimerAcc"
Attr TypeRef = "pwrs:Type-$Int32"
EndBody
EndObject
!/**
! Specifies a valid interval at changes made by the
! operator on TimerTime.
!
! TimerMin <= TimerTime <= TimerMax
!*/
Object TimerMin $Attribute 37
Body SysBody
Attr PgmName = "TimerMin"
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object TimerMax $Attribute 38
Body SysBody
Attr PgmName = "TimerMax"
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!
! End Timer struct
! --
Object PlcConnect $Attribute 39
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
!/**
! 'Attribute' is assigned a value that should not be changed.
! Normally the 'Attribute' value is fetched from the object connected
! to the In input pin. If LockAttribute is set, and Attribute is
! assigned a value, this value will not be changed by the compiler.
!*/
Object LockAttribute $Attribute 40
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
Object Template DSupComp
Body RtBody
Attr EventType = 64
Attr EventPriority = 67
Attr EventFlags = 7
Attr DetectOn = 1
Attr CtrlPosition = 1
EndBody
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2013 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_c_dsupcompfo.wb_load -- Defines the class DSupCompFo.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_macro_sup.h
! @Group Plc,PlcLogic,Supervision,PlantConfiguration
! @Summary Digital supervisory
! Digital Supervisory.
! @image orm_dsup_fo.gif
!
!
! @b See Also
! @classlink ASup pwrb_dsupcomp.html
!*/
Object DSupCompFo $ClassDef 614
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_RtConnectionsAndDevBodies
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DSupCompFo"
EndBody
!/**
! Supervised signal. Can be inverted to supervise a false
! signal.
!*/
Object In $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_NOEDIT
Attr GraphName = "in"
EndBody
EndObject
!/**
! Specifies whether to enable or disable the supervision.
! Note that blocking is done when Control is FALSE. The
! input signal can be inverted.
!
! FALSE disables the supervision and TRUE or open input
! enables the supervision.
!*/
Object Control $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_RTVIRTUAL
Attr Flags |= PWR_MASK_NOEDIT
Attr GraphName = "con"
EndBody
EndObject
!/**
! Specifies the status of supervised quantity. FALSE
! means normal state and TRUE means alarm state.
! The output signal can for instance be used to activate
! an action sequence at alarm state.
!*/
Object Action $Output 3
Body SysBody
Attr PgmName = "Action"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr GraphName = "act"
EndBody
EndObject
!/**
! Specifies if the alarm state has been acknowledged or
! not. FALSE means that unacknowledged alarm exists. The
! output is set TRUE after booting and when the alarm
! state has been acknowledged.
!*/
Object Acked $Output 4
Body SysBody
Attr PgmName = "Acked"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr GraphName = "ack"
EndBody
EndObject
!/**
! Specifies whether to enable or disable the blocking. No
! messages from the supervision object will be sent away
! as long as the object is blocked. The blocking does not
! influence on the 'act' output of the object.
!
! FALSE disables the the blocking and TRUE enables the
! blocking. When a supervisory object in alarm position
! is blocked current messages will be cancelled.
! Blocking /deblocking is done by means of the 'Alarm
! Blocking Window' in the operator environment.
!*/
Object Blocked $Output 5
Body SysBody
Attr PgmName = "Blocked"
Attr TypeRef = "pwrs:Type-$Boolean"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr GraphName = "blk"
EndBody
EndObject
Object PlcConnect $Intern 6
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
Object PlcConnectP $Intern 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Void"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_POINTER
Attr Flags |= PWR_MASK_PRIVATE
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
!/**
! Specifies if DetectText is to be displayed in the
! symbol of the DSup object or not. FALSE means no
! displaying and TRUE displaying.
!*/
Object ShowDetectText $Intern 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
Object PlcNode $Buffer 2
Body SysBody
Attr Class = pwr_eClass_PlcNode
Attr Flags |= PWR_MASK_INVISIBLE
EndBody
EndObject
EndObject
Object GraphPlcNode $GraphPlcNode
Body SysBody
Attr object_type = 11
Attr parameters[0] = 2
Attr parameters[1] = 0
Attr parameters[2] = 3
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 9
Attr graphindex = 0
Attr default_mask[0] = 1
Attr default_mask[1] = 0
Attr segname_annotation = 1
Attr rtbody_annotation = 1
Attr compmethod = 67
Attr compindex = 0
Attr executeordermethod = 2
Attr tracemethod = 3
Attr traceindex = 1
Attr connectmethod = 10
Attr objname = "DSupCompFo"
Attr graphname = "DSupCompFo"
Attr debugpar = "Action"
EndBody
EndObject
Object Template DSupCompFo
Body RtBody
EndBody
Body DevBody
Attr ShowDetectText = 1
EndBody
EndObject
Object RtXtt $RtMenu
Object PlcConnect $MenuRef
Body SysBody
Attr ButtonName = "PlcConnect"
Attr RefAttribute = "PlcConnect"
EndBody
EndObject
EndObject
EndObject
EndSObject
......@@ -1165,6 +1165,8 @@ palette PlcEditorPalette
class BaseMotorAggrFo
class BaseMotorIncrDecrAggrFo
class RunTimeCounterFo
class DSupCompFo
class ASupCompFo
}
menu ABB
{
......
......@@ -256,6 +256,7 @@ int gcg_comp_m63( gcg_ctx gcgctx, vldh_t_node node);
int gcg_comp_m64( gcg_ctx gcgctx, vldh_t_node node);
int gcg_comp_m65( gcg_ctx gcgctx, vldh_t_node node);
int gcg_comp_m66( gcg_ctx gcgctx, vldh_t_node node);
int gcg_comp_m67( gcg_ctx gcgctx, vldh_t_node node);
gcg_tMethod gcg_comp_m[70] = {
(gcg_tMethod)gcg_comp_m0,
......@@ -324,7 +325,8 @@ gcg_tMethod gcg_comp_m[70] = {
gcg_comp_m63,
gcg_comp_m64,
gcg_comp_m65,
gcg_comp_m66
gcg_comp_m66,
gcg_comp_m67
};
......@@ -16160,6 +16162,185 @@ int gcg_comp_m66( gcg_ctx gcgctx, vldh_t_node node)
return GSX__SUCCESS;
}
/*************************************************************************
*
* Name: gcg_comp_m67()
*
* Type void
*
* Type Parameter IOGF Description
* gcg_ctx gcgctx I gcg context.
* vldh_t_node node I vldh node.
*
* Description:
* Compile method for DSupComp and ASupComp.
* Generated code:
* Declares and links a rtdb pointer to the sup object.
* Prints an exec call.
* If the enable input is not connected it is set to true.
* Inits the object by putting the supervised object and parameter
* into the object and setting AckFlg to true.
*
**************************************************************************/
int gcg_comp_m67( gcg_ctx gcgctx, vldh_t_node node)
{
int sts;
pwr_sAttrRef output_aref;
int output_type;
char output_prefix;
char output_par[80];
unsigned long point;
unsigned long par_inverted;
vldh_t_node output_node;
unsigned long output_count;
unsigned long output_point;
ldh_sParDef output_bodydef;
pwr_sAttrRef aref;
pwr_tBoolean locked;
int size;
gcg_t_nocondef nocondef[2];
unsigned long nocontype[2] = { GCG_BOOLEAN, GCG_BOOLEAN };
pwr_tAttrRef *connect_arp, connect_aref;
pwr_tAttrRef attribute_aref;
pwr_tAttrRef aaref;
pwr_tCid connect_cid;
ldh_tSesContext ldhses = (node->hn.wind)->hw.ldhses;
char *name;
nocondef[0].bo = FALSE;
nocondef[1].bo = TRUE;
sts = gcg_ref_insert( gcgctx, node->ln.oid, GCG_PREFIX_REF, node);
sts = gcg_print_exec_macro( gcgctx, node, node->ln.oid, GCG_PREFIX_REF);
if (EVEN(sts)) return sts;
sts = gcg_print_inputs( gcgctx, node, ", ", GCG_PRINT_ALLPAR,
nocondef, nocontype);
if ( EVEN(sts)) return sts;
IF_PR fprintf( gcgctx->files[GCGM1_CODE_FILE],
");\n");
/* Print init call */
sts = gcg_get_structname( gcgctx, node->ln.oid, &name);
if( EVEN(sts)) return sts;
IF_PR fprintf( gcgctx->files[GCGM1_REF_FILE],
"%s_init( %c%s);\n",
name,
GCG_PREFIX_REF,
vldh_IdToStr(0, node->ln.oid));
/* Get PlcConnect object */
sts = ldh_GetObjectPar( gcgctx->ldhses, node->ln.oid, "RtBody", "PlcConnect",
(char **)&connect_arp, &size);
if ( EVEN(sts)) {
gcg_error_msg( gcgctx, GSX__REFCONNECT, node);
return GSX__NEXTNODE;
}
connect_aref = *connect_arp;
free( connect_arp);
sts = gcg_replace_ref( gcgctx, &connect_aref, node);
if ( sts == GSX__REPLACED) {
/* Store the converted aref */
sts = ldh_SetObjectPar( gcgctx->ldhses, node->ln.oid, "RtBody",
"PlcConnect", (char *)&connect_aref, sizeof(connect_aref));
if ( EVEN(sts)) return sts;
}
if ( cdh_ObjidIsNull(connect_aref.Objid)) {
gcg_error_msg( gcgctx, GSX__REFCONNECT, node);
return GSX__NEXTNODE;
}
// Check class of connected object
sts = ldh_GetAttrRefOrigTid( gcgctx->ldhses, &connect_aref, &connect_cid);
if ( EVEN(sts)) {
gcg_error_msg( gcgctx, GSX__REFCONNECT, node);
return GSX__NEXTNODE;
}
switch ( node->ln.cid) {
case pwr_cClass_DSupCompFo:
if ( connect_cid != pwr_cClass_DSupComp) {
gcg_error_msg( gcgctx, GSX__REFCONNECT, node);
return GSX__NEXTNODE;
}
break;
case pwr_cClass_ASupCompFo:
if ( connect_cid != pwr_cClass_ASupComp) {
gcg_error_msg( gcgctx, GSX__REFCONNECT, node);
return GSX__NEXTNODE;
}
break;
default: ;
}
sts = ldh_ArefANameToAref( ldhses, &connect_aref, "LockAttribute", &aaref);
if ( EVEN(sts)) return sts;
sts = ldh_ReadAttribute( ldhses, &aaref, &locked, sizeof(locked));
if ( EVEN(sts)) return sts;
if ( locked) {
sts = ldh_ArefANameToAref( ldhses, &connect_aref, "Attribute", &attribute_aref);
if ( EVEN(sts)) return sts;
sts = ldh_ReadAttribute( ldhses, &attribute_aref, &aref, sizeof(aref));
if ( EVEN(sts)) return sts;
if ( !cdh_ObjidIsNull( aref.Objid)) {
sts = gcg_replace_ref( gcgctx, &aref, node);
if ( sts == GSX__REPLACED) {
sts = ldh_WriteAttribute( ldhses, &attribute_aref, &aref, sizeof(aref));
if ( EVEN(sts)) return sts;
}
}
}
else {
sts = ldh_ArefANameToAref( ldhses, &connect_aref, "Attribute", &aaref);
if ( EVEN(sts)) return sts;
/* Print the supervised object and parameter in the object */
sts = gcg_get_inputpoint( node, 0, &point, &par_inverted);
if ( ODD( sts)) {
/* Look for an output connected to this point */
sts = gcg_get_output( node, point, &output_count, &output_node,
&output_point, &output_bodydef,
GOEN_CON_SIGNAL | GOEN_CON_OUTPUTTOINPUT);
if ( EVEN(sts)) return sts;
if ( output_count > 0 ) {
sts = gcg_get_outputstring( gcgctx, output_node, &output_bodydef,
&output_aref, &output_type, &output_prefix, output_par);
if ( sts == GSX__NEXTPAR ) return sts;
if ( EVEN(sts)) return sts;
/* Put the attribut reference in the sup object */
IF_PR {
sts = ldh_ArefANameToAref( ldhses, &connect_aref, "Attribute", &attribute_aref);
if ( EVEN(sts)) return sts;
sts = ldh_WriteAttribute( ldhses, &attribute_aref, &output_aref, sizeof(output_aref));
if ( EVEN(sts)) return sts;
}
}
else {
/* Point not connected, errormessage */
gcg_error_msg( gcgctx, GSX__NOTCON, node);
}
}
}
// gcg_timer_print( gcgctx, node->ln.oid);
return GSX__SUCCESS;
}
/*************************************************************************
*
* Name: gcg_wind_check_modification()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment