Commit 4e0c38b9 authored by Claes Sjofors's avatar Claes Sjofors

Plc, new time function objects AtDemux, AtLimit, AtMax, AtMin, AtMux, AtSel,...

Plc, new time function objects AtDemux, AtLimit, AtMax, AtMin, AtMux, AtSel, DtDemux, DtLimit, DtMax, DtMin, DtMux and DtSel
parent 2df1e3ad
......@@ -54,6 +54,7 @@
# include <stdio.h>
# include <stdlib.h> /* EXIT_FAILURE */
# include <time.h>
# include <limits.h>
#endif
/*! \file pwr.h
......@@ -194,12 +195,18 @@ typedef struct {
} __pwr_tInt64;
#if defined OS_POSIX
# if defined HW_X86_64
typedef long int pwr_tInt64;
typedef long int pwr_tInt64;
# define PWR_INT64MAX LONG_MAX
# define PWR_INT64MIN LONG_MIN
# else
typedef long long int pwr_tInt64;
typedef long long int pwr_tInt64;
# define PWR_INT64MAX LLONG_MAX
# define PWR_INT64MIN LLONG_MIN
# endif
#else
typedef __pwr_tInt64 pwr_tInt64;
typedef __pwr_tInt64 pwr_tInt64;
# define PWR_INT64MAX LONG_MAX
# define PWR_INT64MIN LONG_MIN
#endif
//! 64-bit unsigned integer type.
......@@ -213,13 +220,31 @@ typedef struct {
#if defined OS_POSIX
# if defined HW_X86_64
typedef unsigned long int pwr_tUInt64;
typedef unsigned long int pwr_tUInt64;
# define PWR_UINT64MAX ULONG_MAX
# else
typedef unsigned long long int pwr_tUInt64;
typedef unsigned long long int pwr_tUInt64;
# define PWR_UINT64MAX ULLONG_MAX
# endif
#else
typedef __pwr_tUInt64 pwr_tUInt64;
typedef __pwr_tUInt64 pwr_tUInt64;
# define PWR_UINT64MAX ULONG_MAX
#endif
#define PWR_INT8_MAX SCHAR_MAX
#define PWR_INT8_MIN SCHAR_MIN
#define PWR_UINT8_MAX UCHAR_MAX
#define PWR_INT16_MAX SHRT_MAX
#define PWR_INT16_MIN SHRT_MIN
#define PWR_UINT16_MAX USHRT_MAX
#define PWR_INT32_MAX INT_MAX
#define PWR_INT32_MIN INT_MIN
#define PWR_UINT32_MAX UINT_MAX
#define PWR_ATTIME_MAX {PWR_INT64MAX,1000000000-1}
#define PWR_ATTIME_MIN {0,0}
#define PWR_DTTIME_MAX {PWR_INT64MAX,1000000000-1}
#define PWR_DTTIME_MIN {PWR_INT64MIN,-(1000000000-1)}
/*_*
@aref uint8 UInt8
*/
......@@ -583,6 +608,10 @@ static const pwr_tTime pwr_cNTime = {0, 0}; //!< Zero time constant.
static const pwr_tDeltaTime pwr_cNDeltaTime = {0, 0}; //!< Zero deltatime constant.
static const pwr_tTime pwr_cNotATime = {0, 1000000000}; //!< Illegal time.
static const pwr_tDeltaTime pwr_cNotADeltaTime = {0, 1000000000}; //!< Illegal delta time.
static const pwr_tTime pwr_cAtMax = PWR_ATTIME_MAX;
static const pwr_tTime pwr_cAtMin = PWR_ATTIME_MIN;
static const pwr_tDeltaTime pwr_cDtMax = PWR_DTTIME_MAX;
static const pwr_tDeltaTime pwr_cDtMin = PWR_DTTIME_MIN;
/* Gereral macro definitions */
......
......@@ -4655,7 +4655,15 @@ pwr_tStatus gdh_AttrValueToString(
case pwr_eType_Time: {
char timstr[64];
if( format && format[0] == '%' && format[2] == 't') {
if ( memcmp( value_ptr, &pwr_cAtMin, sizeof(pwr_tTime)) == 0) {
strcpy( timstr, "ATTIME_ZERO");
sts = GDH__SUCCESS;
}
else if ( memcmp( value_ptr, &pwr_cAtMax, sizeof(pwr_tTime)) == 0) {
strcpy( timstr, "ATTIME_MAX");
sts = GDH__SUCCESS;
}
else if( format && format[0] == '%' && format[2] == 't') {
switch ( format[1]) {
case '1':
// Format %1t, only time, no hundredth
......@@ -4708,10 +4716,16 @@ pwr_tStatus gdh_AttrValueToString(
case pwr_eType_DeltaTime: {
char timstr[64];
sts = time_DtoAscii( (pwr_tDeltaTime *) value_ptr, 1,
timstr, sizeof(timstr));
if ( EVEN(sts))
strcpy( timstr, "Undefined time");
if ( memcmp( value_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime)) == 0)
strcpy( timstr, "DTTIME_MIN");
else if ( memcmp( value_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime)) == 0)
strcpy( timstr, "DTTIME_MAX");
else {
sts = time_DtoAscii( (pwr_tDeltaTime *) value_ptr, 1,
timstr, sizeof(timstr));
if ( EVEN(sts))
strcpy( timstr, "Undefined time");
}
*len = sprintf( str, "%s", timstr);
break;
}
......@@ -4962,17 +4976,29 @@ pwr_tStatus gdh_AttrStringToValue(
case pwr_eType_Time: {
pwr_tTime time;
sts = time_AsciiToA( value_str, &time);
if (EVEN(sts)) return GDH__CONVERT;
memcpy( buffer_ptr, (char *) &time, sizeof(time));
if ( strcmp( value_str, "ATTIME_ZERO") == 0)
memcpy( buffer_ptr, &pwr_cAtMin, sizeof(pwr_tTime));
else if ( strcmp( value_str, "ATTIME_MAX") == 0)
memcpy( buffer_ptr, &pwr_cAtMax, sizeof(pwr_tTime));
else {
sts = time_AsciiToA( value_str, &time);
if (EVEN(sts)) return GDH__CONVERT;
memcpy( buffer_ptr, (char *) &time, sizeof(time));
}
break;
}
case pwr_eType_DeltaTime: {
pwr_tDeltaTime deltatime;
sts = time_AsciiToD( value_str, &deltatime);
if (EVEN(sts)) return GDH__CONVERT;
memcpy( buffer_ptr, (char *) &deltatime, sizeof(deltatime));
if ( strcmp( value_str, "DTTIME_MIN") == 0)
memcpy( buffer_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime));
else if ( strcmp( value_str, "DTTIME_MAX") == 0)
memcpy( buffer_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime));
else {
sts = time_AsciiToD( value_str, &deltatime);
if (EVEN(sts)) return GDH__CONVERT;
memcpy( buffer_ptr, (char *) &deltatime, sizeof(deltatime));
}
break;
}
case pwr_eType_Enum: {
......
......@@ -76,6 +76,8 @@
static const unsigned int pwr_cInputOffset = pwr_AlignLW(sizeof(void*)) + pwr_AlignLW(sizeof(pwr_tBoolean));
static const unsigned int pwr_cInputOffsetAt = pwr_AlignLW(sizeof(void*)) + pwr_AlignLW(sizeof(pwr_tTime));
static const unsigned int pwr_cInputOffsetDt = pwr_AlignLW(sizeof(void*)) + pwr_AlignLW(sizeof(pwr_tDeltaTime));
typedef struct plc_sProcess plc_sProcess;
typedef struct plc_sThread plc_sThread;
......
......@@ -46,6 +46,7 @@
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "co_time.h"
#include "rt_plc.h"
#include "rt_plc_arithm.h"
......@@ -1233,8 +1234,269 @@ void BwRotateLeft_exec(
((unsigned int)(*o->InP) << (*o->NumP));
}
/*_*
AtSel Select function.
@aref atsel AtSel
*/
void AtSel_exec(
plc_sThread *tp,
pwr_sClass_AtSel *o)
{
o->Control = *o->ControlP;
if ( o->Control)
o->ActVal = *o->In1P;
else
o->ActVal = *o->In2P;
}
/*_*
DtSel Select function.
@aref dtsel DtSel
*/
void DtSel_exec(
plc_sThread *tp,
pwr_sClass_DtSel *o)
{
o->Control = *o->ControlP;
if ( o->Control)
o->ActVal = *o->In1P;
else
o->ActVal = *o->In2P;
}
/*_*
AtMux Absolute time multiplexer.
@aref atmux AtMux
*/
void AtMux_exec(
plc_sThread *tp,
pwr_sClass_AtMux *o)
{
#define ATMUX_SIZE 24
int idx;
pwr_tTime **inp = &o->In0P;
idx = o->Index = *o->IndexP;
idx = idx < 0 ? 0 : ( idx > ATMUX_SIZE - 1 ? ATMUX_SIZE - 1 : idx);
inp = (pwr_tTime **)((char *)inp + idx * pwr_cInputOffsetAt);
o->ActVal = **inp;
}
/*_*
DtMux Absolute time multiplexer.
@aref dtmux DtMux
*/
void DtMux_exec(
plc_sThread *tp,
pwr_sClass_DtMux *o)
{
#define DTMUX_SIZE 24
int idx;
pwr_tDeltaTime **inp = &o->In0P;
idx = o->Index = *o->IndexP;
idx = idx < 0 ? 0 : ( idx > DTMUX_SIZE - 1 ? DTMUX_SIZE - 1 : idx);
inp = (pwr_tDeltaTime **)((char *)inp + idx * pwr_cInputOffsetDt);
o->ActVal = **inp;
}
/*_*
AtMax Maximum function.
@aref atmax AtMax
*/
void AtMax_exec(
plc_sThread *tp,
pwr_sClass_AtMax *o)
{
#define ATMAX_SIZE 8
int i;
pwr_tTime **inp = &o->In1P;
pwr_tTime result = PWR_ATTIME_MIN;
for ( i = 0; i < ATMAX_SIZE; i++) {
if ( time_Acomp_NE( *inp, &result) == 1)
result = **inp;
inp = (pwr_tTime **)((char *)inp + pwr_cInputOffsetAt);
}
o->ActVal = result;
}
/*_*
AtMin Minimum function.
@aref atmin AtMin
*/
void AtMin_exec(
plc_sThread *tp,
pwr_sClass_AtMin *o)
{
#define ATMIN_SIZE 8
int i;
pwr_tTime **inp = &o->In1P;
pwr_tTime result = PWR_ATTIME_MAX;
for ( i = 0; i < ATMIN_SIZE; i++) {
if ( time_Acomp_NE( *inp, &result) == -1)
result = **inp;
inp = (pwr_tTime **)((char *)inp + pwr_cInputOffsetAt);
}
o->ActVal = result;
}
/*_*
DtMax Maximum function.
@aref dtmax DtMax
*/
void DtMax_exec(
plc_sThread *tp,
pwr_sClass_DtMax *o)
{
#define DTMAX_SIZE 8
int i;
pwr_tDeltaTime **inp = &o->In1P;
pwr_tDeltaTime result = PWR_DTTIME_MIN;
for ( i = 0; i < DTMAX_SIZE; i++) {
if ( time_Dcomp_NE( *inp, &result) == 1)
result = **inp;
inp = (pwr_tDeltaTime **)((char *)inp + pwr_cInputOffsetDt);
}
o->ActVal = result;
}
/*_*
DtMin Minimum function.
@aref dtmin DtMin
*/
void DtMin_exec(
plc_sThread *tp,
pwr_sClass_DtMin *o)
{
#define DTMIN_SIZE 8
int i;
pwr_tDeltaTime **inp = &o->In1P;
pwr_tDeltaTime result = PWR_DTTIME_MAX;
for ( i = 0; i < DTMIN_SIZE; i++) {
if ( time_Dcomp_NE( *inp, &result) == -1)
result = **inp;
inp = (pwr_tDeltaTime **)((char *)inp + pwr_cInputOffsetDt);
}
o->ActVal = result;
}
/*_*
AtLimit Absolute time limiter.
@aref atlimit AtLimit
*/
void AtLimit_exec(
plc_sThread *tp,
pwr_sClass_AtLimit *o)
{
o->Max = *o->MaxP;
o->Min = *o->MinP;
o->In = *o->InP;
if ( time_Acomp_NE( &o->In, &o->Max) == 1) {
o->ActVal = o->Max;
o->High = TRUE;
o->Low = FALSE;
}
else if ( time_Acomp_NE( &o->In, &o->Min) == -1) {
o->Low = TRUE;
if ( time_Acomp_NE( &o->Min, &o->Max) <= 0) {
o->ActVal = o->Min;
o->High = FALSE;
}
else {
o->ActVal = o->Max;
o->High = TRUE;
}
}
else {
o->ActVal = o->In;
o->High = FALSE;
o->Low = FALSE;
}
}
/*_*
DtLimit Delta time limiter.
@aref dtlimit DtLimit
*/
void DtLimit_exec(
plc_sThread *tp,
pwr_sClass_DtLimit *o)
{
o->Max = *o->MaxP;
o->Min = *o->MinP;
o->In = *o->InP;
if ( time_Dcomp_NE( &o->In, &o->Max) == 1) {
o->ActVal = o->Max;
o->High = TRUE;
o->Low = FALSE;
}
else if ( time_Dcomp_NE( &o->In, &o->Min) == -1) {
o->Low = TRUE;
if ( time_Dcomp_NE( &o->Min, &o->Max) <= 0) {
o->ActVal = o->Min;
o->High = FALSE;
}
else {
o->ActVal = o->Max;
o->High = TRUE;
}
}
else {
o->ActVal = o->In;
o->High = FALSE;
o->Low = FALSE;
}
}
/*_*
AtDemux Absolute time demultiplexer.
@aref atdemux AtDemux
*/
void AtDemux_exec(
plc_sThread *tp,
pwr_sClass_AtDemux *o)
{
#define ATDEMUX_SIZE 24
int idx, i;
pwr_tTime *outp = &o->Out0;
idx = o->Index = *o->IndexP;
for ( i = 0; i < ATDEMUX_SIZE; i++) {
if ( i == idx)
*outp = *o->InP;
else
*outp = pwr_cNTime;
outp++;
}
}
/*_*
DtDemux Delta time demultiplexer.
@aref dtdemux DtDemux
*/
void DtDemux_exec(
plc_sThread *tp,
pwr_sClass_DtDemux *o)
{
#define DTDEMUX_SIZE 24
int idx, i;
pwr_tDeltaTime *outp = &o->Out0;
idx = o->Index = *o->IndexP;
for ( i = 0; i < ATDEMUX_SIZE; i++) {
if ( i == idx)
*outp = *o->InP;
else
*outp = pwr_cNDeltaTime;
outp++;
}
}
......@@ -94,5 +94,17 @@ void BwShiftLeft_exec( plc_sThread *tp, pwr_sClass_BwShiftLeft *object);
void BwShiftRight_exec( plc_sThread *tp, pwr_sClass_BwShiftRight *object);
void BwRotateRight_exec( plc_sThread *tp, pwr_sClass_BwRotateRight *object);
void BwRotateLeft_exec( plc_sThread *tp, pwr_sClass_BwRotateLeft *object);
void AtSel_exec( plc_sThread *tp, pwr_sClass_AtSel *object);
void DtSel_exec( plc_sThread *tp, pwr_sClass_DtSel *object);
void AtMux_exec( plc_sThread *tp, pwr_sClass_AtMux *object);
void DtMux_exec( plc_sThread *tp, pwr_sClass_DtMux *object);
void AtMin_exec( plc_sThread *tp, pwr_sClass_AtMin *object);
void AtMax_exec( plc_sThread *tp, pwr_sClass_AtMax *object);
void DtMin_exec( plc_sThread *tp, pwr_sClass_DtMin *object);
void DtMax_exec( plc_sThread *tp, pwr_sClass_DtMax *object);
void AtLimit_exec( plc_sThread *tp, pwr_sClass_AtLimit *object);
void DtLimit_exec( plc_sThread *tp, pwr_sClass_DtLimit *object);
void AtDemux_exec( plc_sThread *tp, pwr_sClass_AtDemux *object);
void DtDemux_exec( plc_sThread *tp, pwr_sClass_DtDemux *object);
#endif
......@@ -49,5 +49,6 @@ nobuilt <Nothing is built> /info
plcpgmchild <Object can not be a child to a PlcPgm> /error
makeerror <Error from make> /error
makeupdated <Make dependency updated> /info
nosuchnode <No such node> /error
This diff is collapsed.
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_atlimit.wb_load -- Defines the class AtLimit.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Absolute time limiter.
! Absolute time limiter.
! @image orm_atlimit_fo.gif
!
! Minimum and maximum limiter for absolute time value.
!
!*/
Object AtLimit $ClassDef 642
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "AtLimit"
EndBody
!/**
! Specifies the current value of the high limit.
!*/
Object Max $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "Max"
EndBody
EndObject
!/**
! Specifies the current value of the input signal.
!*/
Object In $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In"
EndBody
EndObject
!/**
! Specifies the current value of the low limit.
!*/
Object Min $Input 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "Min"
EndBody
EndObject
!/**
! if In < Min and Min < Max ActVal = Min
! if In > Max ActVal = Max
! else ActVal = In
!*/
Object ActVal $Output 4
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "Val"
EndBody
EndObject
!/**
! Specifies if a limitation upwards has taken place or
! not. FALSE means no limitation upwards at the moment;
! TRUE means that the output signal has been limited
! upwards to the value of Max.
!*/
Object High $Output 5
Body SysBody
Attr PgmName = "High"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "hl"
EndBody
EndObject
!/**
! Specifies if a limitation downwards has taken place or
! not. FALSE means no limitation downwards at the moment;
! TRUE means that the output signal has been limited
! downwards to the value of Min.
!*/
Object Low $Output 6
Body SysBody
Attr PgmName = "Low"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "ll"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 3
Attr parameters[1] = 0
Attr parameters[2] = 3
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 0
Attr graphindex = 0
Attr default_mask[0] = 7
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "AtLimit"
Attr graphname = "AtLimit"
Attr debugpar = ""
EndBody
EndObject
Object Template AtLimit
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_atmax.wb_load -- Defines the class AtMax.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Absolute time maximum function.
! Absolute time maximum function.
! @image orm_atmax_fo.gif
!
! Get maximum of up to 8 absolute time inputs.
!
!*/
Object AtMax $ClassDef 638
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "AtMax"
EndBody
!/**
! Absolute time input.
!*/
Object In1 $Input 1
Body SysBody
Attr PgmName = "In1"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In2 $Input 2
Body SysBody
Attr PgmName = "In2"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In3 $Input 3
Body SysBody
Attr PgmName = "In3"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In3"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In4 $Input 4
Body SysBody
Attr PgmName = "In4"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In4"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In5 $Input 5
Body SysBody
Attr PgmName = "In5"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In5"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In6 $Input 6
Body SysBody
Attr PgmName = "In6"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In6"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In7 $Input 7
Body SysBody
Attr PgmName = "In7"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In7"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In8 $Input 8
Body SysBody
Attr PgmName = "In8"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In8"
EndBody
EndObject
!/**
! Maximum value.
!*/
Object ActVal $Output 9
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "Val"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 8
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 1
Attr graphindex = 0
Attr default_mask[0] = 3
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "AtMax"
Attr graphname = "AtMax"
Attr debugpar = ""
EndBody
EndObject
Object Template AtMax
Body RtBody
Attr In1 = ATTIME_MIN
Attr In2 = ATTIME_MIN
Attr In3 = ATTIME_MIN
Attr In4 = ATTIME_MIN
Attr In5 = ATTIME_MIN
Attr In6 = ATTIME_MIN
Attr In7 = ATTIME_MIN
Attr In8 = ATTIME_MIN
EndBody
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_atmin.wb_load -- Defines the class AtMin.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Absolute time minimum function.
! Absolute minimum function.
! @image orm_atmin_fo.gif
!
! Get minimum of up to 8 absolute time inputs.
!
!*/
Object AtMin $ClassDef 639
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "AtMin"
EndBody
!/**
! Absolute time input.
!*/
Object In1 $Input 1
Body SysBody
Attr PgmName = "In1"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In2 $Input 2
Body SysBody
Attr PgmName = "In2"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In3 $Input 3
Body SysBody
Attr PgmName = "In3"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In3"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In4 $Input 4
Body SysBody
Attr PgmName = "In4"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In4"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In5 $Input 5
Body SysBody
Attr PgmName = "In5"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In5"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In6 $Input 6
Body SysBody
Attr PgmName = "In6"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In6"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In7 $Input 7
Body SysBody
Attr PgmName = "In7"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In7"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In8 $Input 8
Body SysBody
Attr PgmName = "In8"
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In8"
EndBody
EndObject
!/**
! Minimum value.
!*/
Object ActVal $Output 9
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "Val"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 8
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 1
Attr graphindex = 0
Attr default_mask[0] = 3
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "AtMin"
Attr graphname = "AtMin"
Attr debugpar = ""
EndBody
EndObject
Object Template AtMin
Body RtBody
Attr In1 = ATTIME_MAX
Attr In2 = ATTIME_MAX
Attr In3 = ATTIME_MAX
Attr In4 = ATTIME_MAX
Attr In5 = ATTIME_MAX
Attr In6 = ATTIME_MAX
Attr In7 = ATTIME_MAX
Attr In8 = ATTIME_MAX
EndBody
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_atmux.wb_load -- Defines the class AtMux.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Absolute time multiplexer
! Absolute time multiplexer.
! @image orm_atmux_fo.gif
!
! Select one of 24 absolute time inputs, depending on Idx.
!
!*/
Object AtMux $ClassDef 636
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "AtMux"
EndBody
!/**
! Index for selected value.
! First input has index 0.
!*/
Object Index $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Int32"
Attr GraphName = "Idx"
EndBody
EndObject
!/**
! Value of input signal 0, input signal 1, ...
!*/
Object In0 $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In0"
EndBody
EndObject
Object In1 $Input 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In1"
EndBody
EndObject
Object In2 $Input 4
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In2"
EndBody
EndObject
Object In3 $Input 5
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In3"
EndBody
EndObject
Object In4 $Input 6
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In4"
EndBody
EndObject
Object In5 $Input 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In5"
EndBody
EndObject
Object In6 $Input 8
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In6"
EndBody
EndObject
Object In7 $Input 9
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In7"
EndBody
EndObject
Object In8 $Input 10
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In8"
EndBody
EndObject
Object In9 $Input 11
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In9"
EndBody
EndObject
Object In10 $Input 12
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In10"
EndBody
EndObject
Object In11 $Input 13
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In11"
EndBody
EndObject
Object In12 $Input 14
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In12"
EndBody
EndObject
Object In13 $Input 15
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In13"
EndBody
EndObject
Object In14 $Input 16
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In14"
EndBody
EndObject
Object In15 $Input 17
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In15"
EndBody
EndObject
Object In16 $Input 18
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In16"
EndBody
EndObject
Object In17 $Input 19
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In17"
EndBody
EndObject
Object In18 $Input 20
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In18"
EndBody
EndObject
Object In19 $Input 21
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In19"
EndBody
EndObject
Object In20 $Input 22
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In20"
EndBody
EndObject
Object In21 $Input 23
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In21"
EndBody
EndObject
Object In22 $Input 24
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In22"
EndBody
EndObject
Object In23 $Input 25
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In23"
EndBody
EndObject
!/**
! Selected value.
!*/
Object ActVal $Output 26
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "Val"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 25
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 0
Attr graphindex = 0
Attr default_mask[0] = 7
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "AtMux"
Attr graphname = "AtMux"
Attr debugpar = ""
EndBody
EndObject
Object Template AtMux
Body RtBody
EndBody
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_atsel.wb_load -- Defines the class AtSel.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Absolute time selection.
! Absolute time selection.
! @image orm_atsel_fo.gif
!
! Select one of two inputs.
!
!*/
Object AtSel $ClassDef 634
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "AtSel"
EndBody
!/**
! Absolute time input.
!*/
Object In1 $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! Absolute time input.
!*/
Object In2 $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Control.
!*/
Object Control $Input 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "con"
EndBody
EndObject
!/**
! Selected value.
!*/
Object ActVal $Output 9
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Time"
Attr GraphName = "Val"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 3
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 0
Attr graphindex = 0
Attr default_mask[0] = 7
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "AtSel"
Attr graphname = "AtSel"
Attr debugpar = ""
EndBody
EndObject
Object Template AtSel
EndObject
EndObject
EndSObject
This diff is collapsed.
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_dtlimit.wb_load -- Defines the class DtLimit.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Delta time limiter.
! Delta time limiter.
! @image orm_dtlimit_fo.gif
!
! Minimum and maximum limiter for delta time value.
!
!*/
Object DtLimit $ClassDef 643
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DtLimit"
EndBody
!/**
! Specifies the current value of the high limit.
!*/
Object Max $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "Max"
EndBody
EndObject
!/**
! Specifies the current value of the input signal.
!*/
Object In $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In"
EndBody
EndObject
!/**
! Specifies the current value of the low limit.
!*/
Object Min $Input 3
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "Min"
EndBody
EndObject
!/**
! if In < Min and Min < Max ActVal = Min
! if In > Max ActVal = Max
! else ActVal = In
!*/
Object ActVal $Output 4
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "Val"
EndBody
EndObject
!/**
! Specifies if a limitation upwards has taken place or
! not. FALSE means no limitation upwards at the moment;
! TRUE means that the output signal has been limited
! upwards to the value of Max.
!*/
Object High $Output 5
Body SysBody
Attr PgmName = "High"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "hl"
EndBody
EndObject
!/**
! Specifies if a limitation downwards has taken place or
! not. FALSE means no limitation downwards at the moment;
! TRUE means that the output signal has been limited
! downwards to the value of Min.
!*/
Object Low $Output 6
Body SysBody
Attr PgmName = "Low"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "ll"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 3
Attr parameters[1] = 0
Attr parameters[2] = 3
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 0
Attr graphindex = 0
Attr default_mask[0] = 7
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "DtLimit"
Attr graphname = "DtLimit"
Attr debugpar = ""
EndBody
EndObject
Object Template DtLimit
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_dtmax.wb_load -- Defines the class DtMax.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Delta time maximum function.
! Delta time maximum function.
! @image orm_dtmax_fo.gif
!
! Get maximum of up to 8 delta time inputs.
!
!*/
Object DtMax $ClassDef 640
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DtMax"
EndBody
!/**
! Delta time input.
!*/
Object In1 $Input 1
Body SysBody
Attr PgmName = "In1"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In2 $Input 2
Body SysBody
Attr PgmName = "In2"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In3 $Input 3
Body SysBody
Attr PgmName = "In3"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In3"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In4 $Input 4
Body SysBody
Attr PgmName = "In4"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In4"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In5 $Input 5
Body SysBody
Attr PgmName = "In5"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In5"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In6 $Input 6
Body SysBody
Attr PgmName = "In6"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In6"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In7 $Input 7
Body SysBody
Attr PgmName = "In7"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In7"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In8 $Input 8
Body SysBody
Attr PgmName = "In8"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In8"
EndBody
EndObject
!/**
! Maximum value.
!*/
Object ActVal $Output 9
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "Val"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 8
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 1
Attr graphindex = 0
Attr default_mask[0] = 3
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "DtMax"
Attr graphname = "DtMax"
Attr debugpar = ""
EndBody
EndObject
Object Template DtMax
Body RtBody
Attr In1 = DTTIME_MIN
Attr In2 = DTTIME_MIN
Attr In3 = DTTIME_MIN
Attr In4 = DTTIME_MIN
Attr In5 = DTTIME_MIN
Attr In6 = DTTIME_MIN
Attr In7 = DTTIME_MIN
Attr In8 = DTTIME_MIN
EndBody
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_dtmin.wb_load -- Defines the class DtMin.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Delta time minimum function.
! Delta minimum function.
! @image orm_dtmin_fo.gif
!
! Get minimum of up to 8 delta time inputs.
!
!*/
Object DtMin $ClassDef 641
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DtMin"
EndBody
!/**
! Delta time input.
!*/
Object In1 $Input 1
Body SysBody
Attr PgmName = "In1"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In2 $Input 2
Body SysBody
Attr PgmName = "In2"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In3 $Input 3
Body SysBody
Attr PgmName = "In3"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In3"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In4 $Input 4
Body SysBody
Attr PgmName = "In4"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In4"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In5 $Input 5
Body SysBody
Attr PgmName = "In5"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In5"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In6 $Input 6
Body SysBody
Attr PgmName = "In6"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In6"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In7 $Input 7
Body SysBody
Attr PgmName = "In7"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In7"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In8 $Input 8
Body SysBody
Attr PgmName = "In8"
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In8"
EndBody
EndObject
!/**
! Minimum value.
!*/
Object ActVal $Output 9
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "Val"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 8
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 1
Attr graphindex = 0
Attr default_mask[0] = 3
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "DtMin"
Attr graphname = "DtMin"
Attr debugpar = ""
EndBody
EndObject
Object Template DtMin
Body RtBody
Attr In1 = DTTIME_MAX
Attr In2 = DTTIME_MAX
Attr In3 = DTTIME_MAX
Attr In4 = DTTIME_MAX
Attr In5 = DTTIME_MAX
Attr In6 = DTTIME_MAX
Attr In7 = DTTIME_MAX
Attr In8 = DTTIME_MAX
EndBody
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_dtmux.wb_load -- Defines the class dtMux.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Absolute time multiplexer
! Absolute time multiplexer.
! @image orm_dtmux_fo.gif
!
! Select one of 24 absolute time inputs, depending on Idx.
!
!*/
Object DtMux $ClassDef 637
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DtMux"
EndBody
!/**
! Index for selected value.
! First input has index 0.
!*/
Object Index $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Int32"
Attr GraphName = "Idx"
EndBody
EndObject
!/**
! Value of input signal 0, input signal 1, ...
!*/
Object In0 $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In0"
EndBody
EndObject
Object In1 $Input 3
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In1"
EndBody
EndObject
Object In2 $Input 4
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In2"
EndBody
EndObject
Object In3 $Input 5
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In3"
EndBody
EndObject
Object In4 $Input 6
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In4"
EndBody
EndObject
Object In5 $Input 7
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In5"
EndBody
EndObject
Object In6 $Input 8
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In6"
EndBody
EndObject
Object In7 $Input 9
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In7"
EndBody
EndObject
Object In8 $Input 10
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In8"
EndBody
EndObject
Object In9 $Input 11
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In9"
EndBody
EndObject
Object In10 $Input 12
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In10"
EndBody
EndObject
Object In11 $Input 13
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In11"
EndBody
EndObject
Object In12 $Input 14
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In12"
EndBody
EndObject
Object In13 $Input 15
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In13"
EndBody
EndObject
Object In14 $Input 16
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In14"
EndBody
EndObject
Object In15 $Input 17
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In15"
EndBody
EndObject
Object In16 $Input 18
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In16"
EndBody
EndObject
Object In17 $Input 19
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In17"
EndBody
EndObject
Object In18 $Input 20
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In18"
EndBody
EndObject
Object In19 $Input 21
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In19"
EndBody
EndObject
Object In20 $Input 22
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In20"
EndBody
EndObject
Object In21 $Input 23
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In21"
EndBody
EndObject
Object In22 $Input 24
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In22"
EndBody
EndObject
Object In23 $Input 25
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In23"
EndBody
EndObject
!/**
! Selected value.
!*/
Object ActVal $Output 26
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "Val"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 25
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 0
Attr graphindex = 0
Attr default_mask[0] = 7
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "DtMux"
Attr graphname = "DtMux"
Attr debugpar = ""
EndBody
EndObject
Object Template DtMux
Body RtBody
EndBody
EndObject
EndObject
EndSObject
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 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_dtsel.wb_load -- Defines the class DtSel.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcTime
! @Summary Delta time selection.
! Delta time selection.
! @image orm_dtsel_fo.gif
!
! Select one of two inputs.
!
!*/
Object DtSel $ClassDef 635
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DtSel"
EndBody
!/**
! Delta time input.
!*/
Object In1 $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! Delta time input.
!*/
Object In2 $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Control.
!*/
Object Control $Input 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "con"
EndBody
EndObject
!/**
! Selected value.
!*/
Object ActVal $Output 9
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DeltaTime"
Attr GraphName = "Val"
EndBody
EndObject
EndObject
Object DevBody $ObjBodyDef 2
Object PlcNode $Buffer 1
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] = 3
Attr parameters[1] = 0
Attr parameters[2] = 1
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 0
Attr graphindex = 0
Attr default_mask[0] = 7
Attr default_mask[1] = 1
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "DtSel"
Attr graphname = "DtSel"
Attr debugpar = ""
EndBody
EndObject
Object Template DtSel
EndObject
EndObject
EndSObject
......@@ -45,8 +45,8 @@ SObject pwrb:Class
! @image orm_idemux_fo.gif
!
! Transfer the integer input to one of the 24 outputs, depending on Idx.
! The index attributes states which output the input value is
! tranfered to.
! The index attribute states which output the input value is
! transfered to.
! The other outputs are set to zero.
! If index is less than zero or greater than 23, all outputs are
! set to zero.
......
......@@ -1076,10 +1076,16 @@ palette PlcEditorPalette
menu Time
{
class AtAdd
class AtDemux
class AtEqual
class AtGreaterThan
class AtLessThan
class AtLimit
class AtMax
class AtMin
class AtMux
class AToDt
class AtSel
class AtSub
class AtDtSub
class CStoATp
......@@ -1088,9 +1094,15 @@ palette PlcEditorPalette
class CStoDTv
class CurrentTime
class DtAdd
class DtDemux
class DtEqual
class DtGreaterThan
class DtLessThan
class DtLimit
class DtMax
class DtMin
class DtMux
class DtSel
class DtSub
class DtToA
class GetATp
......
This diff is collapsed.
......@@ -78,6 +78,7 @@ class wb_build : public wb_status
void appgraph( pwr_tOid oid);
void application( pwr_tOid oid);
void classdef( pwr_tOid oid);
void cnf( char *node, void *volumelist, int volumecnt);
void directories( char *dir, bld_ePass pass);
void export_import_files( int type, bld_ePass pass);
void export_files( bld_ePass pass) { export_import_files(bld_eType_Export, pass);}
......
......@@ -875,27 +875,41 @@ bool wb_print_wbl::printValue (wb_volume& v,
// sprintf(sval, "\"%.*s\"", varSize, (char *)val);
break;
}
case pwr_eType_Time:
sts = time_AtoAscii((pwr_tTime *)val, time_eFormat_DateAndTime,
timbuf, sizeof(timbuf));
if (ODD(sts)) {
sprintf(sval, "\"%s\"", timbuf);
} else {
sprintf(sval, "Bad time value");
m_errCnt++;
retval = FALSE;
case pwr_eType_Time: {
if ( memcmp( val, &pwr_cAtMin, sizeof(pwr_tTime)) == 0)
strcpy( sval, "ATTIME_MIN");
else if ( memcmp( val, &pwr_cAtMax, sizeof(pwr_tTime)) == 0)
strcpy( sval, "ATTIME_MAX");
else {
sts = time_AtoAscii((pwr_tTime *)val, time_eFormat_DateAndTime,
timbuf, sizeof(timbuf));
if (ODD(sts)) {
sprintf(sval, "\"%s\"", timbuf);
} else {
sprintf(sval, "Bad time value");
m_errCnt++;
retval = FALSE;
}
}
break;
case pwr_eType_DeltaTime:
sts = time_DtoAscii((pwr_tDeltaTime *)val, 1, timbuf, sizeof(timbuf));
if (ODD(sts)) {
sprintf(sval, "\"%s\"", timbuf);
} else {
sprintf(sval, "Bad time value");
m_errCnt++;
retval = FALSE;
}
case pwr_eType_DeltaTime: {
if ( memcmp( val, &pwr_cDtMin, sizeof(pwr_tDeltaTime)) == 0)
strcpy( sval, "DTTIME_MIN");
else if ( memcmp( val, &pwr_cDtMax, sizeof(pwr_tDeltaTime)) == 0)
strcpy( sval, "DTTIME_MAX");
else {
sts = time_DtoAscii((pwr_tDeltaTime *)val, 1, timbuf, sizeof(timbuf));
if (ODD(sts)) {
sprintf(sval, "\"%s\"", timbuf);
} else {
sprintf(sval, "Bad time value");
m_errCnt++;
retval = FALSE;
}
}
break;
}
case pwr_eType_Status:
sprintf(sval, "%d", *(pwr_tStatus *) val);
break;
......
......@@ -2317,18 +2317,30 @@ int wb_wblnode::attrStringToValue( int type_id, char *value_str,
{
pwr_tTime time;
sts = time_AsciiToA( value_str, &time);
if (EVEN(sts)) return 0;
memcpy( buffer_ptr, (char *) &time, sizeof(time));
if ( strcmp( value_str, "ATTIME_MIN") == 0)
memcpy( buffer_ptr, &pwr_cAtMin, sizeof(pwr_tTime));
else if ( strcmp( value_str, "ATTIME_MAX") == 0)
memcpy( buffer_ptr, &pwr_cAtMax, sizeof(pwr_tTime));
else {
sts = time_AsciiToA( value_str, &time);
if (EVEN(sts)) return 0;
memcpy( buffer_ptr, (char *) &time, sizeof(time));
}
break;
}
case pwr_eType_DeltaTime:
{
pwr_tDeltaTime deltatime;
sts = time_AsciiToD( value_str, &deltatime);
if (EVEN(sts)) return 0;
memcpy( buffer_ptr, (char *) &deltatime, sizeof(deltatime));
if ( strcmp( value_str, "DTTIME_MIN") == 0)
memcpy( buffer_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime));
else if ( strcmp( value_str, "DTTIME_MAX") == 0)
memcpy( buffer_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime));
else {
sts = time_AsciiToD( value_str, &deltatime);
if (EVEN(sts)) return 0;
memcpy( buffer_ptr, (char *) &deltatime, sizeof(deltatime));
}
break;
}
default:
......
......@@ -275,18 +275,30 @@ int wnav_attr_string_to_value( ldh_tSesContext ldhses, int type_id, char *value
}
case pwr_eType_Time: {
pwr_tTime time;
sts = time_AsciiToA( value_str, &time);
if (EVEN(sts)) return WNAV__INPUT_SYNTAX;
memcpy( buffer_ptr, (char *) &time, sizeof(time));
if ( strcmp( value_str, "ATTIME_ZERO") == 0)
memcpy( buffer_ptr, &pwr_cAtMin, sizeof(pwr_tTime));
else if ( strcmp( value_str, "ATTIME_MAX") == 0)
memcpy( buffer_ptr, &pwr_cAtMax, sizeof(pwr_tTime));
else {
sts = time_AsciiToA( value_str, &time);
if (EVEN(sts)) return WNAV__INPUT_SYNTAX;
memcpy( buffer_ptr, (char *) &time, sizeof(time));
}
break;
}
case pwr_eType_DeltaTime: {
pwr_tDeltaTime deltatime;
sts = time_AsciiToD( value_str, &deltatime);
if (EVEN(sts)) return WNAV__INPUT_SYNTAX;
memcpy( buffer_ptr, (char *) &deltatime, sizeof(deltatime));
if ( strcmp( value_str, "DTTIME_MIN") == 0)
memcpy( buffer_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime));
else if ( strcmp( value_str, "DTTIME_MAX") == 0)
memcpy( buffer_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime));
else {
sts = time_AsciiToD( value_str, &deltatime);
if (EVEN(sts)) return WNAV__INPUT_SYNTAX;
memcpy( buffer_ptr, (char *) &deltatime, sizeof(deltatime));
}
break;
}
}
......@@ -486,19 +498,31 @@ void wnav_attrvalue_to_string( ldh_tSesContext ldhses, int type_id, void *value
break;
}
case pwr_eType_Time: {
sts = time_AtoAscii( (pwr_tTime *) value_ptr, time_eFormat_DateAndTime,
if ( memcmp( value_ptr, &pwr_cAtMin, sizeof(pwr_tTime)) == 0)
strcpy( str, "ATTIME_ZERO");
else if ( memcmp( value_ptr, &pwr_cAtMax, sizeof(pwr_tTime)) == 0)
strcpy( str, "ATTIME_MAX");
else {
sts = time_AtoAscii( (pwr_tTime *) value_ptr, time_eFormat_DateAndTime,
str, sizeof(str));
if ( EVEN(sts))
strcpy( str, "-");
if ( EVEN(sts))
strcpy( str, "-");
}
*len = strlen(str);
*buff = str;
break;
}
case pwr_eType_DeltaTime: {
sts = time_DtoAscii( (pwr_tDeltaTime *) value_ptr, 1,
str, sizeof(str));
if ( EVEN(sts))
strcpy( str, "Undefined time");
if ( memcmp( value_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime)) == 0)
strcpy( str, "DTTIME_MIN");
else if ( memcmp( value_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime)) == 0)
strcpy( str, "DTTIME_MAX");
else {
sts = time_DtoAscii( (pwr_tDeltaTime *) value_ptr, 1,
str, sizeof(str));
if ( EVEN(sts))
strcpy( str, "Undefined time");
}
*len = strlen( str);
*buff = str;
break;
......
......@@ -453,7 +453,7 @@ dcli_tCmdTable wnav_command_table[] = {
"BUILD",
&wnav_build_func,
{ "dcli_arg1", "dcli_arg2", "/FORCE", "/DEBUG", "/CROSSREFERENCE",
"/MANUAL", "/NAME", "/WINDOW", ""}
"/MANUAL", "/NAME", "/WINDOW", "/NODE", ""}
},
{
"CHECK",
......@@ -5050,6 +5050,37 @@ static int wnav_build_func( void *client_data,
free( (char *) volumelist);
}
else if ( cdh_NoCaseStrncmp( arg1_str, "CONFIG", strlen( arg1_str)) == 0) {
char nodestr[80];
void *volumelist;
int volumecount;
if ( EVEN( dcli_get_qualifier( "/NODE", nodestr, sizeof(nodestr)))) {
if ( EVEN( dcli_get_qualifier( "dcli_arg2", nodestr, sizeof(nodestr)))) {
wnav->message('E', "Syntax error");
return WNAV__SYNTAX;
}
}
// Load the bootlist
sts = lfu_volumelist_load( pwr_cNameBootList, (lfu_t_volumelist **) &volumelist,
&volumecount);
if ( sts == FOE__NOFILE) {
wnav->message( 'E', "Project is not configured");
return sts;
}
wb_build build( *(wb_session *)wnav->ldhses, wnav);
build.opt.force = ODD( dcli_get_qualifier( "/FORCE", 0, 0));
build.opt.debug = ODD( dcli_get_qualifier( "/DEBUG", 0, 0));
build.opt.crossref = ODD( dcli_get_qualifier( "/CROSSREFERENCE", 0, 0));
build.opt.manual = ODD( dcli_get_qualifier( "/MANUAL", 0, 0));
build.cnf( nodestr, volumelist, volumecount);
wnav->message(' ', wnav_get_message(build.sts()));
free( (char *) volumelist);
}
else if ( cdh_NoCaseStrncmp( arg1_str, "VOLUME", strlen( arg1_str)) == 0) {
// Build current volume
char namestr[80];
......
......@@ -107,6 +107,8 @@ int XNav::get_trace_attr( pwr_sAttrRef *arp, char *attr)
case pwr_cClass_Io:
case pwr_cClass_Iv:
case pwr_cClass_Sv:
case pwr_cClass_ATv:
case pwr_cClass_DTv:
strcpy( attr, "ActualValue");
break;
case pwr_cClass_ChanDi:
......@@ -432,17 +434,29 @@ int XNav::attr_string_to_value( int type_id, char *value_str,
case pwr_eType_Time: {
pwr_tTime time;
sts = time_AsciiToA( value_str, &time);
if (EVEN(sts)) return XNAV__INPUT_SYNTAX;
memcpy( buffer_ptr, (char *) &time, sizeof(time));
if ( strcmp( value_str, "ATTIME_ZERO") == 0)
memcpy( buffer_ptr, &pwr_cAtMin, sizeof(pwr_tTime));
else if ( strcmp( value_str, "ATTIME_MAX") == 0)
memcpy( buffer_ptr, &pwr_cAtMax, sizeof(pwr_tTime));
else {
sts = time_AsciiToA( value_str, &time);
if (EVEN(sts)) return XNAV__INPUT_SYNTAX;
memcpy( buffer_ptr, (char *) &time, sizeof(time));
}
break;
}
case pwr_eType_DeltaTime: {
pwr_tDeltaTime deltatime;
sts = time_AsciiToD( value_str, &deltatime);
if (EVEN(sts)) return XNAV__INPUT_SYNTAX;
memcpy( buffer_ptr, (char *) &deltatime, sizeof(deltatime));
if ( strcmp( value_str, "DTTIME_MIN") == 0)
memcpy( buffer_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime));
else if ( strcmp( value_str, "DTTIME_MAX") == 0)
memcpy( buffer_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime));
else {
sts = time_AsciiToD( value_str, &deltatime);
if (EVEN(sts)) return XNAV__INPUT_SYNTAX;
memcpy( buffer_ptr, (char *) &deltatime, sizeof(deltatime));
}
break;
}
}
......@@ -868,10 +882,16 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
((pwr_tTime *)value_ptr)->tv_sec, ((pwr_tTime *)value_ptr)->tv_nsec);
break;
default:
sts = time_AtoAscii( (pwr_tTime *) value_ptr, time_eFormat_DateAndTime,
timstr, sizeof(timstr));
if ( EVEN(sts) && sts != TIME__NAT)
strcpy( timstr, "-");
if ( memcmp( value_ptr, &pwr_cAtMin, sizeof(pwr_tTime)) == 0)
strcpy( timstr, "ATTIME_ZERO");
else if ( memcmp( value_ptr, &pwr_cAtMax, sizeof(pwr_tTime)) == 0)
strcpy( timstr, "ATTIME_MAX");
else {
sts = time_AtoAscii( (pwr_tTime *) value_ptr, time_eFormat_DateAndTime,
timstr, sizeof(timstr));
if ( EVEN(sts) && sts != TIME__NAT)
strcpy( timstr, "-");
}
*len = snprintf( str, size, "%s", timstr);
}
break;
......@@ -883,10 +903,16 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
((pwr_tTime *)value_ptr)->tv_sec, ((pwr_tDeltaTime *)value_ptr)->tv_nsec);
break;
default:
sts = time_DtoAscii( (pwr_tDeltaTime *) value_ptr, 1,
timstr, sizeof(timstr));
if ( EVEN(sts) && sts != TIME__NADT)
strcpy( timstr, "Undefined time");
if ( memcmp( value_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime)) == 0)
strcpy( timstr, "DTTIME_MIN");
else if ( memcmp( value_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime)) == 0)
strcpy( timstr, "DTTIME_MAX");
else {
sts = time_DtoAscii( (pwr_tDeltaTime *) value_ptr, 1,
timstr, sizeof(timstr));
if ( EVEN(sts) && sts != TIME__NADT)
strcpy( timstr, "Undefined time");
}
*len = snprintf( str, size, "%s", timstr);
}
break;
......
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