Class Valve
Version 1.0
Modified 08-MAR-2026 11:05:32.00
Code rt_plc_drive.c
 Valve positioner with two states, i.e. on-off action
 and operation time supervision.

 The two operating states, here named OPEN and CLOSE,
 can be interpreted as full on or full off, open or
 closed etc. The operation order OrderOpen is either
 TRUE or FALSE.

 By means of the operation time supervision it is
 possible to detect if the final control element is
 stopped between the two operating states.
 One of three operating modes, LOCAL / MANUAL / AUTO, is
 selected by means of the input signal Local and the
 output signal ManMode in the following way:

LOCAL
 Used at operation from for example an outer
 operator's console, switching equipment, etc.

 - Only the safety interlockings, SafeOpen and
   SafeClose, are taken into account.

 - LocalOpen has a spring back push button
   function. It sets OrderOpen to TRUE when
   activated.

 - LocalClose has a spring back push button
   function. It resets OrderOpen when
   activated.

 - At the changes,
   -- LOCAL --> AUTO AutoOpen is concerned.
   -- LOCAL --> MANUAL OrderOpen remains unaffected.

MANUAL/AUTO
 - Both production and safety interlockings are
   concerned.

 - The alarms are indicators that do not
   influence the operation order unless they
   are connected to some interlocking signal.

 - In MANUAL mode OPEN/CLOSE request is handled
   by the operator by means of the attributes
   ManOpen respectively ManClose.

   In AUTO mode OPEN request is done when
   AutoOpen is TRUE; CLOSE when AutoOpen is
   FALSE, i.e. not at any edge but on the
   levels.

 - The changes,
   -- AUTO -> MANUAL, do not influence the
      operation order OrderOpen.

   -- MANUAL -> AUTO. If the operation order was
      set in MANUAL operating mode and AutoOpen is TRUE,
      the operation order remains set after the transition,
      otherwise not.

 If there are conflicting requests the request with the
 highest priority wins; see below.

Example



Pump with a valve
 At request to start the pump shall the valve first open
 and then the pump start.

 At flushing the valve has to be opened, and this is done
 by means of the Dv- signal 'Spola'.

RtBody attributes pwr_sClass_valve
Boolean AutoOpen aop Specifies an OPEN/CLOSE request in operational mode
AUTO. FALSE means CLOSE request and TRUE means OPEN
request.
Boolean EndOpen eop Specifies whether the end limit position of OPEN is
activated or not. FALSE means no and TRUE means that
the answer is yes.

Used by Alarm1 and Alarm3.
Boolean EndClose ecl Specifies whether the end limit position of CLOSE is
activated or not. FALSE means no and TRUE means that
the answer is yes.
Used by Alarm2 and Alarm4.
Boolean Local loc Selection of operational mode. The signal may proceed
from a rotary switch, for example. FALSE means that the
operational mode 'NOT LOCAL' is selected and ManMode if
this is MANUAL or AUTO. TRUE means that the operational
mode LOCAL has been selected.
Boolean LocalOpen lop Specifies OPEN request in operational mode LOCAL. FALSE
means no action; TRUE implies the operation order
OrderOpen has been set and will be set until a new
CLOSE request is made.
Boolean LocalClose lcl Specifies CLOSE request in operational mode LOCAL.
FALSE means no action; TRUE implies that the operation
order OrderOpen has been reset and will be is reset
until a new OPEN request is made.
Boolean SafeOpen sop Specifies the state of the safety interlocking at OPEN
operation. This interlocking is valid independent of
operational mode.

FALSE means that this safety interlocking is not
activated. TRUE means unconditional OPEN, i.e. the
operation order OrderOpen is set unless SafeClose is
also TRUE. If SafeClose = SafeOpen = TRUE SafeClose
wins.
Boolean SafeClose scl Specifies the state of the safety interlocking at CLOSE
operation. This interlocking is valid independent of
operational mode.
FALSE means that this safety interlocking is not
activated. TRUE means unconditional CLOSE, i.e. the
operation order OrderOpen is reset.
Boolean ProdOpen pop Specifies the state of the production interlocking at
OPEN operation and is valid only for the operational
modes AUTO and MANUAL. FALSE means that the production
interlocking is not activated. TRUE means that the
operation order OrderOpen is set, unless SafeClose,
ProdClose, or Local is set.
Boolean ProdClose pcl Specifies the state of the production interlocking at
CLOSE operation and is valid only for the operational
modes AUTO and MANUAL. FALSE means that the production
interlocking is not activated. TRUE means that the
operation order OrderOpen is reset, unless SafeOpen or
Local is set.
Boolean ManMode man Specifies required operational mode ( MANUAL or AUTO)
when LOCAL is FALSE. Used as an ordinary parameter,
e.g. it may be written into from display programs. The
advantage of placing this attribute as an output is
that it will be easier to use it in the graphic
configuration. If Local is FALSE means:

FALSE -- required operational mode is AUTO
TRUE -- - " - MANUAL
Boolean OrderOpen oop The operational order specifies one out of two
operating states; full on or full off, open or closed
etc. FALSE means here a state named CLOSE, and TRUE
means a state named OPEN.
Boolean IndOpen iop The attribute is a confirmation of the current
OPENING-operating state depending on other attributes.
TRUE indicates OrderOpen = EndOpen = TRUE and EndClosed
= Local = FALSE, otherwise IndOpen is FALSE.
Boolean IndClose icl The attribute is a confirmation of the current
CLOSING-operating state depending on other attributes.
TRUE indicates EndClosed = TRUE and OrderOpen = EndOpen
= Local = FALSE, otherwise IndClose is FALSE.
Boolean Alarm1 al1 Specifies if the OrderOpen has been set during a time
longer than TimerTime without any activating of the end
position, i.e. EndOpen has not been set.

FALSE means no alarm; TRUE means that EndOpen was not
set within the time limit value TimerTim. The
operational order, OrderOpen, is not influenced by the
alarm. The alarm remains until EndOpen is TRUE or a
CLOSE request is made.
Connects a DSup object to the output if a message will
be sent and specifies DetectText in the DSup object;
e.g. 'Too long operation time at OPEN-order on xxx'
Boolean Alarm2 al2 Specifies if the OrderOpen has been reset during a time
longer than TimerTime without any activating of the end
position, i.e. EndClosed has not been set.
FALSE means no alarm; TRUE means that EndClosed was not
set within the time limit value TimerTim. The
operational order, OrderOpen, is not influenced by the
alarm. The alarm remains until EndClosed is TRUE or an
OPEN request is made.
Connects a DSup object to the output, if a message will
be sent and specifies DetectText in the DSup object;
e.g. 'Too long operation time at CLOSE-order on xxx'
Boolean Alarm3 al3 Specifies if the EndOpen signal is lost through a
continued OPENING-order or if both the limit position
indicators ( EndClose and EndClosed) are activated at
the same time. The operational order, OrderOpen, is not
influenced by the alarm. The alarm remains as long as
the alarm position exists.

Connects a DSup object to the output, if a message will
be sent, and specifies DetectText in the DSup object;
e.g. 'Lost limit position OPENED on xxx'.
Boolean Alarm4 al4 Specifies if the EndClosed signal is lost through a
continued CLOSING-order or, if both the limit position
indicators ( EndClose and EndClosed) are activated at
the same time. The operational order, OrderOpen, is not
influenced by the alarm. The alarm remains as long as
the alarm position exists.

Connects a DSup object to the output, if a message will
be sent, and specifies DetectText in the DSup object;
e.g. 'Lost limit position CLOSED on xxx'.
If EndClose = EndOpen = TRUE both Alarm3 and Alarm4 are
set.
Boolean SumAlarm als Sum of alarms. Specifies if any of the alarms exist or
not. FALSE means no active alarms at all in this
object; TRUE means that at least one of Alarm1, ... ,
Alarm4 is on. The operational order, OrderOpen, is not
influenced by the alarm.
Connects a DSup object to the output, if a message will
be sent, and specifies DetectText in the DSup object.
Boolean ManOpen   Specifies OPEN request in the operational mode MANUAL.
FALSE means no request; TRUE means OPEN request. The
request is reset by the ProviewR system when it has
been noticed.
Boolean ManClose   Specifies CLOSE request in the operational mode MANUAL.
FALSE means no request; TRUE means CLOSE request. The
request is reset by the ProviewR system when it has
been noticed.
Boolean TimerFlag   Indicates an active timer.
Pointer to Boolean TimerNext   Points to the next element in the timer queue.
UInt32 TimerCount   Number of remaining ticks.
Pointer to Boolean TimerDO   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.
Float32 TimerTime   The value, in seconds, of the operation timer. If the
OrderOpen has been set or reset during a time longer
than TimerTime without any activating of the end
corresponding position Alarm1 or Alarm2 is set.
Boolean TimerDODum   Dummy. If TimerDoDum does not point to a Do or Dv
object it points to this attribute.
Objid TimerObjDId   Identity of this object is set at load file creation.
Used by the run time system.
Int32 ManAcc ManAcc The operator's authorities to change between the
operational modes MANUAL / AUTO can be restricted.
0 -- Changes not allowed.
!= 0 -- Changes allowed.
Int32 Status Status The possible status values are as follows:

1 or -1 -- Waiting for OPEN or CLOSE indication
2 or -2 -- OPENING or CLOSING
3 or -3 -- OPEN or CLOSED

DevBody attributes 
PlcNode PlcNode  


GraphPlcNode
object_type 181
parameters[0] 10
parameters[1] 0
parameters[2] 9
parameters[3] 0
subwindows 0
graphmethod 0 (standard, individual attributes)
graphindex 0
default_mask[0] 7
default_mask[1] 270
segname_annotation 1
compmethod 4
compindex 0
executeordermethod 2
objname Valve
graphname Valve
debugpar


Template Object
TimerTime 10.0


Attributes detail


AutoOpen Input
Class Input
Type Boolean
Flags STATE | NOEDIT | NOINVERT | REDUTRANSFER
GraphName aop
Body RtBody
 Specifies an OPEN/CLOSE request in operational mode
 AUTO. FALSE means CLOSE request and TRUE means OPEN
 request.

EndOpen Input
Class Input
Type Boolean
Flags STATE | NOEDIT | NOINVERT | REDUTRANSFER
GraphName eop
Body RtBody
 Specifies whether the end limit position of OPEN is
 activated or not. FALSE means no and TRUE means that
 the answer is yes.

 Used by Alarm1 and Alarm3.

EndClose Input
Class Input
Type Boolean
Flags STATE | NOEDIT | NOINVERT | REDUTRANSFER
GraphName ecl
Body RtBody
 Specifies whether the end limit position of CLOSE is
 activated or not. FALSE means no and TRUE means that
 the answer is yes.
 Used by Alarm2 and Alarm4.

Local Input
Class Input
Type Boolean
Flags NOINVERT | REDUTRANSFER
GraphName loc
Body RtBody
 Selection of operational mode. The signal may proceed
 from a rotary switch, for example. FALSE means that the
 operational mode 'NOT LOCAL' is selected and ManMode if
 this is MANUAL or AUTO. TRUE means that the operational
 mode LOCAL has been selected.

LocalOpen Input
Class Input
Type Boolean
Flags NOINVERT | REDUTRANSFER
GraphName lop
Body RtBody
 Specifies OPEN request in operational mode LOCAL. FALSE
 means no action; TRUE implies the operation order
 OrderOpen has been set and will be set until a new
 CLOSE request is made.

LocalClose Input
Class Input
Type Boolean
Flags REDUTRANSFER | NOINVERT
GraphName lcl
Body RtBody
 Specifies CLOSE request in operational mode LOCAL.
 FALSE means no action; TRUE implies that the operation
 order OrderOpen has been reset and will be is reset
 until a new OPEN request is made.

SafeOpen Input
Class Input
Type Boolean
Flags NOINVERT | REDUTRANSFER
GraphName sop
Body RtBody
 Specifies the state of the safety interlocking at OPEN
 operation. This interlocking is valid independent of
 operational mode.

 FALSE means that this safety interlocking is not
 activated. TRUE means unconditional OPEN, i.e. the
 operation order OrderOpen is set unless SafeClose is
 also TRUE. If SafeClose = SafeOpen = TRUE SafeClose
 wins.

SafeClose Input
Class Input
Type Boolean
Flags NOINVERT | REDUTRANSFER
GraphName scl
Body RtBody
 Specifies the state of the safety interlocking at CLOSE
 operation. This interlocking is valid independent of
 operational mode.
 FALSE means that this safety interlocking is not
 activated. TRUE means unconditional CLOSE, i.e. the
 operation order OrderOpen is reset.

ProdOpen Input
Class Input
Type Boolean
Flags NOINVERT | REDUTRANSFER
GraphName pop
Body RtBody
 Specifies the state of the production interlocking at
 OPEN operation and is valid only for the operational
 modes AUTO and MANUAL. FALSE means that the production
 interlocking is not activated. TRUE means that the
 operation order OrderOpen is set, unless SafeClose,
 ProdClose, or Local is set.

ProdClose Input
Class Input
Type Boolean
Flags NOINVERT | REDUTRANSFER
GraphName pcl
Body RtBody
 Specifies the state of the production interlocking at
 CLOSE operation and is valid only for the operational
 modes AUTO and MANUAL. FALSE means that the production
 interlocking is not activated. TRUE means that the
 operation order OrderOpen is reset, unless SafeOpen or
 Local is set.

ManMode Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName man
Body RtBody
 Specifies required operational mode ( MANUAL or AUTO)
 when LOCAL is FALSE. Used as an ordinary parameter,
 e.g. it may be written into from display programs. The
 advantage of placing this attribute as an output is
 that it will be easier to use it in the graphic
 configuration. If Local is FALSE means:

   FALSE -- required operational mode is AUTO
   TRUE  --    -  "  -              MANUAL

OrderOpen Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName oop
Body RtBody
 The operational order specifies one out of two
 operating states; full on or full off, open or closed
 etc. FALSE means here a state named CLOSE, and TRUE
 means a state named OPEN.

IndOpen Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName iop
Body RtBody
 The attribute is a confirmation of the current
 OPENING-operating state depending on other attributes.
 TRUE indicates OrderOpen = EndOpen = TRUE and EndClosed
 = Local = FALSE, otherwise IndOpen is FALSE.

IndClose Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName icl
Body RtBody
 The attribute is a confirmation of the current
 CLOSING-operating state depending on other attributes.
 TRUE indicates EndClosed = TRUE and OrderOpen = EndOpen
 = Local = FALSE, otherwise IndClose is FALSE.

Alarm1 Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName al1
Body RtBody
 Specifies if the OrderOpen has been set during a time
 longer than TimerTime without any activating of the end
 position, i.e. EndOpen has not been set.

 FALSE means no alarm; TRUE means that EndOpen was not
 set within the time limit value TimerTim. The
 operational order, OrderOpen, is not influenced by the
 alarm. The alarm remains until EndOpen is TRUE or a
 CLOSE request is made.
 Connects a DSup object to the output if a message will
 be sent and specifies DetectText in the DSup object;
 e.g. 'Too long operation time at OPEN-order on xxx'

Alarm2 Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName al2
Body RtBody
 Specifies if the OrderOpen has been reset during a time
 longer than TimerTime without any activating of the end
 position, i.e. EndClosed has not been set.
 FALSE means no alarm; TRUE means that EndClosed was not
 set within the time limit value TimerTim. The
 operational order, OrderOpen, is not influenced by the
 alarm. The alarm remains until EndClosed is TRUE or an
 OPEN request is made.
 Connects a DSup object to the output, if a message will
 be sent and specifies DetectText in the DSup object;
 e.g. 'Too long operation time at CLOSE-order on xxx'

Alarm3 Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName al3
Body RtBody
 Specifies if the EndOpen signal is lost through a
 continued OPENING-order or if both the limit position
 indicators ( EndClose and EndClosed) are activated at
 the same time. The operational order, OrderOpen, is not
 influenced by the alarm. The alarm remains as long as
 the alarm position exists.

 Connects a DSup object to the output, if a message will
 be sent, and specifies DetectText in the DSup object;
 e.g. 'Lost limit position OPENED on xxx'.

Alarm4 Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName al4
Body RtBody
 Specifies if the EndClosed signal is lost through a
 continued CLOSING-order or, if both the limit position
 indicators ( EndClose and EndClosed) are activated at
 the same time. The operational order, OrderOpen, is not
 influenced by the alarm. The alarm remains as long as
 the alarm position exists.

 Connects a DSup object to the output, if a message will
 be sent, and specifies DetectText in the DSup object;
 e.g. 'Lost limit position CLOSED on xxx'.
 If EndClose = EndOpen = TRUE both Alarm3 and Alarm4 are
 set.

SumAlarm Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName als
Body RtBody
 Sum of alarms. Specifies if any of the alarms exist or
 not. FALSE means no active alarms at all in this
 object; TRUE means that at least one of Alarm1, ... ,
 Alarm4 is on. The operational order, OrderOpen, is not
 influenced by the alarm.
 Connects a DSup object to the output, if a message will
 be sent, and specifies DetectText in the DSup object.

ManOpen Intern
Class Intern
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
Body RtBody
 Specifies OPEN request in the operational mode MANUAL.
 FALSE means no request; TRUE means OPEN request. The
 request is reset by the ProviewR system when it has
 been noticed.

ManClose Intern
Class Intern
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
Body RtBody
 Specifies CLOSE request in the operational mode MANUAL.
 FALSE means no request; TRUE means CLOSE request. The
 request is reset by the ProviewR system when it has
 been noticed.

TimerFlag Intern
Class Intern
Type Boolean
Flags STATE | INVISIBLE | REDUTRANSFER
Body RtBody
 Indicates an active timer.

TimerNext Intern
Class Intern
Type Pointer to Boolean
Flags POINTER | STATE | INVISIBLE | PRIVATE
Body RtBody
 Points to the next element in the timer queue.

TimerCount Intern
Class Intern
Type UInt32
Flags STATE | INVISIBLE | REDUTRANSFER
Body RtBody
 Number of remaining ticks.

TimerDO Intern
Class Intern
Type Pointer to Boolean
Flags POINTER | STATE | INVISIBLE | PRIVATE
Body RtBody
 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.

TimerTime Intern
Class Intern
Type Float32
Flags REDUTRANSFER
Body RtBody
 The value, in seconds, of the operation timer. If the
 OrderOpen has been set or reset during a time longer
 than TimerTime without any activating of the end
 corresponding position Alarm1 or Alarm2 is set.

TimerDODum Intern
Class Intern
Type Boolean
Flags STATE | INVISIBLE
Body RtBody
 Dummy. If TimerDoDum does not point to a Do or Dv
 object it points to this attribute.

TimerObjDId Intern
Class Intern
Type Objid
Flags INVISIBLE
Body RtBody
 Identity of this object is set at load file creation.
 Used by the run time system.

ManAcc Intern
Class Intern
Type Int32
Flags
GraphName ManAcc
Body RtBody
 The operator's authorities to change between the
 operational modes MANUAL / AUTO can be restricted.
    0   -- Changes not allowed.
    != 0 -- Changes allowed.

Status Intern
Class Intern
Type Int32
Flags STATE | NOEDIT
GraphName Status
Body RtBody
 The possible status values are as follows:

  1 or -1 -- Waiting for OPEN or CLOSE indication
  2 or -2 -- OPENING or CLOSING
  3 or -3 -- OPEN or CLOSED

PlcNode Buffer
Class Buffer
Type PlcNode
Flags INVISIBLE
Body DevBody