Commit 8812a08f authored by Claes Sjofors's avatar Claes Sjofors

Plc, new dataref and string function objects, DataSel, DataEqual,...

Plc, new dataref and string function objects, DataSel, DataEqual, DataNotEqual, StrAdd, StrEqual, StrNotEqual, StrSel, StrTrim and StrParse
parent af1e6379
......@@ -111,6 +111,10 @@ void NMpsTrp_exec( plc_sThread *tp, pwr_sClass_NMpsTrp *object);
void NMpsTrpRR_exec( plc_sThread *tp, pwr_sClass_NMpsTrpRR *object);
void NMpsTrpFF_exec( plc_sThread *tp, pwr_sClass_NMpsTrpFF *object);
void DataSelect_exec( plc_sThread *tp, pwr_sClass_DataSelect *object);
void DataSel_exec( plc_sThread *tp, pwr_sClass_DataSel *object);
void DataEqual_exec( plc_sThread *tp, pwr_sClass_DataEqual *object);
void DataNotEqual_exec( plc_sThread *tp, pwr_sClass_DataNotEqual *object);
void DataMux_exec( plc_sThread *tp, pwr_sClass_DataMux *object);
void NMpsMirrorCell_init( pwr_sClass_NMpsMirrorCell *object);
void NMpsMirrorCell_exec( plc_sThread *tp, pwr_sClass_NMpsMirrorCell *object);
void DataFWrite_exec( plc_sThread *tp, pwr_sClass_DataFWrite *object);
......
......@@ -2825,7 +2825,64 @@ void DataSelect_exec(
memcpy( &object->OutDataP, *DataP, sizeof(pwr_tDataRef));
}
/*_*
DataSel
@aref datasel DataSel
*/
void DataSel_exec(
plc_sThread *tp,
pwr_sClass_DataSel *o)
{
o->Control = *o->ControlP;
if ( o->Control)
memcpy( &o->ActVal, o->In1P, sizeof(pwr_tDataRef));
else
memcpy( &o->ActVal, o->In2P, sizeof(pwr_tDataRef));
}
/*_*
DataEqual
@aref dataequal DataEqual
*/
void DataEqual_exec(
plc_sThread *tp,
pwr_sClass_DataEqual *o)
{
o->Status = (memcmp( o->In1P, o->In2P, sizeof(pwr_tDataRef)) == 0);
}
/*_*
DataNotEqual
@aref datanotequal DataNotEqual
*/
void DataNotEqual_exec(
plc_sThread *tp,
pwr_sClass_DataNotEqual *o)
{
o->Status = (memcmp( o->In1P, o->In2P, sizeof(pwr_tDataRef)) != 0);
}
/*_*
DataMux Data reference multiplexer.
@aref datamux DataMux
*/
void DataMux_exec(
plc_sThread *tp,
pwr_sClass_DataMux *o)
{
#define DATAMUX_SIZE 24
int idx;
pwr_tDataRef **inp = &o->In0P;
idx = o->Index = *o->IndexP;
idx = idx < 0 ? 0 : ( idx > DATAMUX_SIZE - 1 ? DATAMUX_SIZE - 1 : (idx > o->MaxIndex ? o->MaxIndex : idx));
inp = (pwr_tDataRef **)((char *)inp + idx * pwr_cInputOffsetDataRef);
o->ActVal = **inp;
}
/* NMpsMirrorCell
*/
......
!
! 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_dataequal.wb_load -- Defines the class DataEqual.
!
SObject NMps:Class
!/**
! @Version 1.0
! @Code nmps_plc.c
! @Group Plc,PlcData
! @Summary Check if two data references are equal.
! DataEqual compares two data reference values and returns true if they are equal.
! @image orm_dataequal_fo.png
!*/
Object DataEqual $ClassDef 58
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DataEqual"
EndBody
!/**
! Data reference input 1.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! Data reference input 2.
!*/
Object In2 $Input 2
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! True if the input values are equal.
!*/
Object Status $Output 3
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "sts"
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] = 2
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 = 3
Attr traceindex = 1
Attr executeordermethod = 2
Attr objname = "DataEq"
Attr graphname = "DataEq"
Attr debugpar = "Status"
EndBody
EndObject
Object Template DataEqual
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_datanotequal.wb_load -- Defines the class DataNotEqual.
!
SObject NMps:Class
!/**
! @Version 1.0
! @Code nmps_plc.c
! @Group Plc,PlcData
! @Summary Check if two data references are not equal.
! DataNotEqual compares two data reference values and returns false if they are equal.
! @image orm_datanotequal_fo.png
!*/
Object DataNotEqual $ClassDef 59
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DataNotEqual"
EndBody
!/**
! Data reference input 1.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! Data reference input 2.
!*/
Object In2 $Input 2
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! True if the input values are not equal.
!*/
Object Status $Output 3
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "sts"
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] = 2
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 = 3
Attr traceindex = 1
Attr executeordermethod = 2
Attr objname = "DataNe"
Attr graphname = "DataNe"
Attr debugpar = "Status"
EndBody
EndObject
Object Template DataNotEqual
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.
!
! nmps_c_datasel.wb_load -- Defines the class DataSel.
!
SObject NMps:Class
!/**
! @Version 1.0
! @Code nmps_plc.c
! @Group Plc,PlcData
! @Summary Data reference selection.
! Data reference selection.
! @image orm_datasel_fo.png
!
! Select one of two inputs.
!
!*/
Object DataSel $ClassDef 57
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DataSel"
EndBody
!/**
! Data reference input.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! DataReference input.
!*/
Object In2 $Input 2
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$DataRef"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Control.
!*/
Object Control $Input 3
Body SysBody
Attr Flags |= PWR_MASK_NOINVERT
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-$DataRef"
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 = "DataSel"
Attr graphname = "DataSel"
Attr debugpar = ""
EndBody
EndObject
Object Template DataSel
EndObject
EndObject
EndSObject
......@@ -4454,11 +4454,19 @@ pwr_tStatus gdh_AttrValueToString(
}
case pwr_eType_Float32: {
if ( *(float *)value_ptr == FLT_MIN) {
strcpy( str, "FLT_MIN");
strcpy( str, "FltMin");
*len = strlen(str);
}
else if ( *(float *)value_ptr == -FLT_MIN) {
strcpy( str, "FltNMin");
*len = strlen(str);
}
else if ( *(float *)value_ptr == FLT_MAX) {
strcpy( str, "FLT_MAX");
strcpy( str, "FltMax");
*len = strlen(str);
}
else if ( *(float *)value_ptr == -FLT_MAX) {
strcpy( str, "FltNMax");
*len = strlen(str);
}
else {
......@@ -4499,11 +4507,11 @@ pwr_tStatus gdh_AttrValueToString(
}
case pwr_eType_Int32: {
if ( *(int *)value_ptr == INT_MIN) {
strcpy( str, "INT_MIN");
strcpy( str, "IntMin");
*len = strlen(str);
}
else if ( *(int *)value_ptr == INT_MAX) {
strcpy( str, "INT_MAX");
strcpy( str, "IntMax");
*len = strlen(str);
}
else {
......@@ -4656,11 +4664,11 @@ pwr_tStatus gdh_AttrValueToString(
char timstr[64];
if ( memcmp( value_ptr, &pwr_cAtMin, sizeof(pwr_tTime)) == 0) {
strcpy( timstr, "ATTIME_ZERO");
strcpy( timstr, "AtZero");
sts = GDH__SUCCESS;
}
else if ( memcmp( value_ptr, &pwr_cAtMax, sizeof(pwr_tTime)) == 0) {
strcpy( timstr, "ATTIME_MAX");
strcpy( timstr, "AtMax");
sts = GDH__SUCCESS;
}
else if( format && format[0] == '%' && format[2] == 't') {
......@@ -4717,9 +4725,9 @@ pwr_tStatus gdh_AttrValueToString(
char timstr[64];
if ( memcmp( value_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime)) == 0)
strcpy( timstr, "DTTIME_MIN");
strcpy( timstr, "DtMin");
else if ( memcmp( value_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime)) == 0)
strcpy( timstr, "DTTIME_MAX");
strcpy( timstr, "DtMax");
else {
sts = time_DtoAscii( (pwr_tDeltaTime *) value_ptr, 1,
timstr, sizeof(timstr));
......@@ -4809,10 +4817,14 @@ pwr_tStatus gdh_AttrStringToValue(
break;
}
case pwr_eType_Float32: {
if ( strcmp( value_str, "FLT_MIN") == 0)
if ( strcmp( value_str, "FltMin") == 0)
*(float *)buffer_ptr = FLT_MIN;
else if ( strcmp( value_str, "FLT_MAX") == 0)
else if ( strcmp( value_str, "FltNMin") == 0)
*(float *)buffer_ptr = -FLT_MIN;
else if ( strcmp( value_str, "FltMax") == 0)
*(float *)buffer_ptr = FLT_MAX;
else if ( strcmp( value_str, "FltNMax") == 0)
*(float *)buffer_ptr = -FLT_MAX;
else if ( sscanf( value_str, "%f", (float *)buffer_ptr) != 1)
return GDH__CONVERT;
break;
......@@ -4849,9 +4861,9 @@ pwr_tStatus gdh_AttrStringToValue(
case pwr_eType_Int32:
case pwr_eType_Status:
case pwr_eType_NetStatus: {
if ( strcmp( value_str, "INT_MIN") == 0)
if ( strcmp( value_str, "IntMin") == 0)
*(int *)buffer_ptr = INT_MIN;
else if ( strcmp( value_str, "INT_MAX") == 0)
else if ( strcmp( value_str, "IntMax") == 0)
*(int *)buffer_ptr = INT_MAX;
else if ( sscanf( value_str, "%d", (int *)buffer_ptr) != 1)
return GDH__CONVERT;
......@@ -4976,9 +4988,9 @@ pwr_tStatus gdh_AttrStringToValue(
case pwr_eType_Time: {
pwr_tTime time;
if ( strcmp( value_str, "ATTIME_ZERO") == 0)
if ( strcmp( value_str, "AtZero") == 0)
memcpy( buffer_ptr, &pwr_cAtMin, sizeof(pwr_tTime));
else if ( strcmp( value_str, "ATTIME_MAX") == 0)
else if ( strcmp( value_str, "AtMax") == 0)
memcpy( buffer_ptr, &pwr_cAtMax, sizeof(pwr_tTime));
else {
sts = time_AsciiToA( value_str, &time);
......@@ -4990,9 +5002,9 @@ pwr_tStatus gdh_AttrStringToValue(
case pwr_eType_DeltaTime: {
pwr_tDeltaTime deltatime;
if ( strcmp( value_str, "DTTIME_MIN") == 0)
if ( strcmp( value_str, "DtMin") == 0)
memcpy( buffer_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime));
else if ( strcmp( value_str, "DTTIME_MAX") == 0)
else if ( strcmp( value_str, "DtMax") == 0)
memcpy( buffer_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime));
else {
sts = time_AsciiToD( value_str, &deltatime);
......
......@@ -78,6 +78,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));
static const unsigned int pwr_cInputOffsetDataRef = pwr_AlignLW(sizeof(void*)) + pwr_AlignLW(sizeof(pwr_tDataRef));
static const unsigned int pwr_cInputOffsetStr = pwr_AlignLW(sizeof(void*)) + pwr_AlignLW(sizeof(pwr_tString80));
typedef struct plc_sProcess plc_sProcess;
typedef struct plc_sThread plc_sThread;
......
......@@ -47,6 +47,8 @@
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "co_time.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "rt_plc.h"
#include "rt_plc_arithm.h"
......@@ -785,7 +787,7 @@ void IEqual_exec(
}
/*_*
@aref iequal INotEqual
@aref inotequal INotEqual
*/
void INotEqual_exec(
plc_sThread *tp,
......@@ -1498,5 +1500,111 @@ void DtDemux_exec(
}
}
/*_*
StrSel Select function.
@aref strsel StrSel
*/
void StrSel_exec(
plc_sThread *tp,
pwr_sClass_StrSel *o)
{
o->Control = *o->ControlP;
if ( o->Control)
strncpy( o->ActVal, *o->In1P, sizeof(o->ActVal));
else
strncpy( o->ActVal, *o->In2P, sizeof(o->ActVal));
}
/*_*
StrMux String multiplexer.
@aref strmux StrMux
*/
void StrMux_exec(
plc_sThread *tp,
pwr_sClass_StrMux *o)
{
#define STRMUX_SIZE 24
int idx;
pwr_tString80 **inp = &o->In0P;
idx = o->Index = *o->IndexP;
idx = idx < 0 ? 0 : ( idx > STRMUX_SIZE - 1 ? STRMUX_SIZE - 1 : idx);
inp = (pwr_tString80 **)((char *)inp + idx * pwr_cInputOffsetStr);
strncpy( o->ActVal, **inp, sizeof(o->ActVal));
}
/*_*
@aref strequal StrEqual
*/
void StrEqual_exec(
plc_sThread *tp,
pwr_sClass_StrEqual *o)
{
if ( o->CaseSensitive)
o->Status = (strcmp( *o->In1P, *o->In2P) == 0);
else
o->Status = (cdh_NoCaseStrcmp( *o->In1P, *o->In2P) == 0);
}
/*_*
@aref strnotequal StrNotEqual
*/
void StrNotEqual_exec(
plc_sThread *tp,
pwr_sClass_StrNotEqual *o)
{
if ( o->CaseSensitive)
o->Status = (strcmp( *o->In1P, *o->In2P) != 0);
else
o->Status = (cdh_NoCaseStrcmp( *o->In1P, *o->In2P) != 0);
}
/*_*
StrAdd String addition.
@aref stradd StrAdd
*/
void StrAdd_exec(
plc_sThread *tp,
pwr_sClass_StrAdd *o)
{
#define STRADD_SIZE 8
int i;
pwr_tString80 **inp = &o->In1P;
pwr_tString80 sum = "";
for ( i = 0; i < STRADD_SIZE; i++) {
strncat( sum, **inp, sizeof(sum));
inp = (pwr_tString80 **)((char *)inp + pwr_cInputOffsetStr);
}
strncpy( o->ActVal, sum, sizeof(o->ActVal));
o->ActVal[sizeof(o->ActVal)-1] = 0;
}
/*_*
StrTrim Remove leading and trailing spaces.
@aref strtrim StrTrim
*/
void StrTrim_exec(
plc_sThread *tp,
pwr_sClass_StrTrim *o)
{
dcli_trim( o->ActVal, *o->InP);
}
/*_*
StrParse Parse a string.
@aref strparse StrParse
*/
void StrParse_exec(
plc_sThread *tp,
pwr_sClass_StrParse *o)
{
#define STRPARSE_SIZE 10
int i, tokens;
tokens = dcli_parse( *o->InP, o->Delimiter, "", o->Token1, STRPARSE_SIZE, sizeof(o->Token1), 1);
for ( i = tokens; i < STRPARSE_SIZE; i++)
*(char *)((char *)o->Token1 + i * sizeof(o->Token1)) = 0;
}
......@@ -106,5 +106,12 @@ 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);
void StrSel_exec( plc_sThread *tp, pwr_sClass_StrSel *object);
void StrMux_exec( plc_sThread *tp, pwr_sClass_StrMux *object);
void StrEqual_exec( plc_sThread *tp, pwr_sClass_StrEqual *object);
void StrNotEqual_exec( plc_sThread *tp, pwr_sClass_StrNotEqual *object);
void StrAdd_exec( plc_sThread *tp, pwr_sClass_StrAdd *object);
void StrTrim_exec( plc_sThread *tp, pwr_sClass_StrTrim *object);
void StrParse_exec( plc_sThread *tp, pwr_sClass_StrParse *object);
#endif
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Absolute time demultiplexer
! Absolute time demultiplexer.
! @image orm_atdemux_fo.gif
! @image orm_atdemux_fo.png
!
! Transfer the time input to one of the 24 outputs, depending on Idx.
! The index attribute states which output the input value is
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Absolute time limiter.
! Absolute time limiter.
! @image orm_atlimit_fo.gif
! @image orm_atlimit_fo.png
!
! Minimum and maximum limiter for absolute time value.
!
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Absolute time maximum function.
! Absolute time maximum function.
! @image orm_atmax_fo.gif
! @image orm_atmax_fo.png
!
! Get maximum of up to 8 absolute time inputs.
!
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Absolute time minimum function.
! Absolute minimum function.
! @image orm_atmin_fo.gif
! @image orm_atmin_fo.png
!
! Get minimum of up to 8 absolute time inputs.
!
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Absolute time multiplexer
! Absolute time multiplexer.
! @image orm_atmux_fo.gif
! @image orm_atmux_fo.png
!
! Select one of 24 absolute time inputs, depending on Idx.
!
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Absolute time selection.
! Absolute time selection.
! @image orm_atsel_fo.gif
! @image orm_atsel_fo.png
!
! Select one of two inputs.
!
......@@ -80,6 +80,7 @@ SObject pwrb:Class
!*/
Object Control $Input 3
Body SysBody
Attr Flags |= PWR_MASK_NOINVERT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "con"
EndBody
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Delta time demultiplexer
! Delta time demultiplexer.
! @image orm_dtdemux_fo.gif
! @image orm_dtdemux_fo.png
!
! Transfer the delta time input to one of the 24 outputs, depending on Idx.
! The index attribute states which output the input value is
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Delta time limiter.
! Delta time limiter.
! @image orm_dtlimit_fo.gif
! @image orm_dtlimit_fo.png
!
! Minimum and maximum limiter for delta time value.
!
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Delta time maximum function.
! Delta time maximum function.
! @image orm_dtmax_fo.gif
! @image orm_dtmax_fo.png
!
! Get maximum of up to 8 delta time inputs.
!
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Delta time minimum function.
! Delta minimum function.
! @image orm_dtmin_fo.gif
! @image orm_dtmin_fo.png
!
! Get minimum of up to 8 delta time inputs.
!
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Absolute time multiplexer
! Absolute time multiplexer.
! @image orm_dtmux_fo.gif
! @image orm_dtmux_fo.png
!
! Select one of 24 absolute time inputs, depending on Idx.
!
......
......@@ -42,7 +42,7 @@ SObject pwrb:Class
! @Group Plc,PlcTime
! @Summary Delta time selection.
! Delta time selection.
! @image orm_dtsel_fo.gif
! @image orm_dtsel_fo.png
!
! Select one of two inputs.
!
......@@ -80,6 +80,7 @@ SObject pwrb:Class
!*/
Object Control $Input 3
Body SysBody
Attr Flags |= PWR_MASK_NOINVERT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "con"
EndBody
......
......@@ -41,7 +41,7 @@ SObject pwrb:Class
! @Code rt_plc_arithm.c
! @Group Plc,PlcAnalog
! @Summary Check if two analog values are equal.
! Equal compare two analog values and returnes true if they are equal.
! Equal compares two analog values and returns true if they are equal.
! @image orm_equal_fo.gif
!*/
Object Equal $ClassDef 419
......
......@@ -41,7 +41,7 @@ SObject pwrb:Class
! @Code rt_plc_arithm.c
! @Group Plc,PlcInteger
! @Summary Check if two integer are equal.
! IEqual compare two integer values and returnes true if they are equal.
! IEqual compares two integer values and returns true if they are equal.
! @image orm_iequal_fo.gif
!*/
Object IEqual $ClassDef 391
......
......@@ -41,7 +41,7 @@ SObject pwrb:Class
! @Code rt_plc_arithm.c
! @Group Plc,PlcInteger
! @Summary Check if two integer are not equal.
! INotEqual compare two integer values and returnes true if they are not equal.
! INotEqual compares two integer values and returns true if they are not equal.
! @image orm_inotequal_fo.gif
!*/
Object INotEqual $ClassDef 425
......
......@@ -41,7 +41,7 @@ SObject pwrb:Class
! @Code rt_plc_arithm.c
! @Group Plc,PlcAnalog
! @Summary Check if two analog values are not equal.
! Equal compare two analog values and returnes true if they are not equal.
! Equal compares two analog values and returns true if they are not equal.
! @image orm_notequal_fo.gif
!*/
Object NotEqual $ClassDef 424
......
!
! 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_stradd.wb_load -- Defines the class StrAdd.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcString
! @Summary String addition
! String addition.
! @image orm_stradd_fo.png
!
! Addition of up to 8 string inputs.
!
!*/
Object StrAdd $ClassDef 650
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "StrAdd"
EndBody
!/**
! Value of input signal 1, input signal 2, ..., input
! signal 8.
!*/
Object In1 $Input 1
Body SysBody
Attr PgmName = "In1"
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In1"
EndBody
EndObject
Object In2 $Input 2
Body SysBody
Attr PgmName = "In2"
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In2"
EndBody
EndObject
Object In3 $Input 3
Body SysBody
Attr PgmName = "In3"
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In3"
EndBody
EndObject
Object In4 $Input 4
Body SysBody
Attr PgmName = "In4"
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In4"
EndBody
EndObject
Object In5 $Input 5
Body SysBody
Attr PgmName = "In5"
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In5"
EndBody
EndObject
Object In6 $Input 6
Body SysBody
Attr PgmName = "In6"
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In6"
EndBody
EndObject
Object In7 $Input 7
Body SysBody
Attr PgmName = "In7"
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In7"
EndBody
EndObject
Object In8 $Input 8
Body SysBody
Attr PgmName = "In8"
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In8"
EndBody
EndObject
!/**
! The result of the addition.
!*/
Object ActVal $Output 9
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
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 = "StrAdd"
Attr graphname = "StrAdd"
Attr debugpar = ""
EndBody
EndObject
Object Template StrAdd
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_strequal.wb_load -- Defines the class StrEqual.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcString
! @Summary Check if two strings are equal.
! StrEqual compares two string values and returns true if they are equal.
! @image orm_strequal_fo.png
!*/
Object StrEqual $ClassDef 648
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "StrEqual"
EndBody
!/**
! String input 1.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! String input 2.
!*/
Object In2 $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Comparision is case sensitive.
!*/
Object CaseSensitive $Intern 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! True if the input values are equal.
!*/
Object Status $Output 4
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "sts"
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] = 2
Attr parameters[1] = 1
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 = 3
Attr traceindex = 1
Attr executeordermethod = 2
Attr objname = "StrEq"
Attr graphname = "StrEq"
Attr debugpar = "Status"
EndBody
EndObject
Object Template StrEqual
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_strmux.wb_load -- Defines the class StrMux.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcString
! @Summary String multiplexer
! String multiplexer.
! @image orm_strmux_fo.png
!
! Select one of 24 string inputs, depending on Idx.
!
!*/
Object StrMux $ClassDef 647
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "StrMux"
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-$String80"
Attr GraphName = "In0"
EndBody
EndObject
Object In1 $Input 3
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In1"
EndBody
EndObject
Object In2 $Input 4
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In2"
EndBody
EndObject
Object In3 $Input 5
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In3"
EndBody
EndObject
Object In4 $Input 6
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In4"
EndBody
EndObject
Object In5 $Input 7
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In5"
EndBody
EndObject
Object In6 $Input 8
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In6"
EndBody
EndObject
Object In7 $Input 9
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In7"
EndBody
EndObject
Object In8 $Input 10
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In8"
EndBody
EndObject
Object In9 $Input 11
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In9"
EndBody
EndObject
Object In10 $Input 12
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In10"
EndBody
EndObject
Object In11 $Input 13
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In11"
EndBody
EndObject
Object In12 $Input 14
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In12"
EndBody
EndObject
Object In13 $Input 15
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In13"
EndBody
EndObject
Object In14 $Input 16
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In14"
EndBody
EndObject
Object In15 $Input 17
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In15"
EndBody
EndObject
Object In16 $Input 18
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In16"
EndBody
EndObject
Object In17 $Input 19
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In17"
EndBody
EndObject
Object In18 $Input 20
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In18"
EndBody
EndObject
Object In19 $Input 21
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In19"
EndBody
EndObject
Object In20 $Input 22
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In20"
EndBody
EndObject
Object In21 $Input 23
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In21"
EndBody
EndObject
Object In22 $Input 24
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In22"
EndBody
EndObject
Object In23 $Input 25
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
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-$String80"
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 = "StrMux"
Attr graphname = "StrMux"
Attr debugpar = ""
EndBody
EndObject
Object Template StrMux
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_strnotequal.wb_load -- Defines the class StrNotEqual.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcString
! @Summary Check if two strings are not equal.
! StrEqual compares two string values and returns true if they are not equal.
! @image orm_strnotequal_fo.png
!*/
Object StrNotEqual $ClassDef 649
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "StrNotEqual"
EndBody
!/**
! String input 1.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! String input 2.
!*/
Object In2 $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Comparision is case sensitive.
!*/
Object CaseSensitive $Intern 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! True if the input values are not equal.
!*/
Object Status $Output 4
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Boolean"
Attr GraphName = "sts"
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] = 2
Attr parameters[1] = 1
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 = 3
Attr traceindex = 1
Attr executeordermethod = 2
Attr objname = "StrNe"
Attr graphname = "StrNe"
Attr debugpar = "Status"
EndBody
EndObject
Object Template StrNotEqual
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_strparse.wb_load -- Defines the class StrParse.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcString
! @Summary Parse a string.
! Parse a string with specified delimiter characters.
! The default delimiter characters are Space and TAB.
! @image orm_strparse_fo.png
!
!*/
Object StrParse $ClassDef 652
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "StrParse"
EndBody
!/**
! String input.
!*/
Object In $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In"
EndBody
EndObject
!/**
! Delimiter characters.
!*/
Object Delimiter $Intern 2
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Token 1.
!*/
Object Token1 $Output 3
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token1"
EndBody
EndObject
!/**
! Token 2.
!*/
Object Token2 $Output 4
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token2"
EndBody
EndObject
!/**
! Token 3.
!*/
Object Token3 $Output 5
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token3"
EndBody
EndObject
!/**
! Token 4.
!*/
Object Token4 $Output 6
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token4"
EndBody
EndObject
!/**
! Token 5.
!*/
Object Token5 $Output 7
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token5"
EndBody
EndObject
!/**
! Token 6.
!*/
Object Token6 $Output 8
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token6"
EndBody
EndObject
!/**
! Token 7.
!*/
Object Token7 $Output 9
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token7"
EndBody
EndObject
!/**
! Token 8.
!*/
Object Token8 $Output 10
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token8"
EndBody
EndObject
!/**
! Token 9.
!*/
Object Token9 $Output 11
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token9"
EndBody
EndObject
!/**
! Token 10.
!*/
Object Token10 $Output 12
Body SysBody
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "Token10"
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] = 1
Attr parameters[1] = 1
Attr parameters[2] = 10
Attr parameters[3] = 0
Attr subwindows = 0
Attr graphmethod = 0
Attr graphindex = 0
Attr default_mask[0] = 1
Attr default_mask[1] = 3
Attr segname_annotation = 1
Attr compmethod = 4
Attr compindex = 0
Attr tracemethod = 0
Attr traceindex = 0
Attr executeordermethod = 2
Attr objname = "StrParse"
Attr graphname = "StrParse"
Attr debugpar = ""
EndBody
EndObject
Object Template StrParse
Body RtBody
Attr Delimiter = " "
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_strsel.wb_load -- Defines the class StrSel.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcString
! @Summary String selection.
! String selection.
! @image orm_strsel_fo.png
!
! Select one of two inputs.
!
!*/
Object StrSel $ClassDef 646
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "StrSel"
EndBody
!/**
! String input.
!*/
Object In1 $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In1"
EndBody
EndObject
!/**
! String input.
!*/
Object In2 $Input 2
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In2"
EndBody
EndObject
!/**
! Control.
!*/
Object Control $Input 3
Body SysBody
Attr Flags |= PWR_MASK_NOINVERT
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-$String80"
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 = "StrSel"
Attr graphname = "StrSel"
Attr debugpar = ""
EndBody
EndObject
Object Template StrSel
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_strtrim.wb_load -- Defines the class StrTrim.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,PlcString
! @Summary Remove leading and trailing spaces in a string.
! Remove leading and trailing white space characters in a string.
! @image orm_strtrim_fo.png
!
!*/
Object StrTrim $ClassDef 651
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Connections
Attr PopEditor = 2
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "StrTrim"
EndBody
!/**
! String input.
!*/
Object In $Input 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
Attr GraphName = "In"
EndBody
EndObject
!/**
! Trimmed string.
!*/
Object ActVal $Output 9
Body SysBody
Attr PgmName = "ActVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$String80"
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] = 1
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] = 1
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 = "StrTrim"
Attr graphname = "StrTrim"
Attr debugpar = ""
EndBody
EndObject
Object Template StrTrim
EndObject
EndObject
EndSObject
......@@ -876,11 +876,15 @@ palette PlcEditorPalette
class CurrentIndex
class DataCopy
class DataCnv
class DataEqual
class DataFRead
class DataFWrite
class DataMux
class DataNotEqual
class DataRcv
class DataRequest
class DataReset
class DataSel
class DataSelect
class DataSend
class DispLink
......@@ -1070,7 +1074,14 @@ palette PlcEditorPalette
class StoNumSp
class StoSp
class StoSv
class StrAdd
class Strcat
class StrEqual
class StrMux
class StrNotEqual
class StrParse
class StrSel
class StrTrim
class SubStr
}
menu Time
......
......@@ -85,13 +85,13 @@ int wnav_attr_string_to_value( ldh_tSesContext ldhses, int type_id, char *value
break;
}
case pwr_eType_Float32: {
if ( strcmp( value_str, "FLT_MIN") == 0)
if ( strcmp( value_str, "FltMin") == 0)
*(float *)buffer_ptr = FLT_MIN;
else if ( strcmp( value_str, "FLT_NMIN") == 0)
else if ( strcmp( value_str, "FltNMin") == 0)
*(float *)buffer_ptr = -FLT_MIN;
else if ( strcmp( value_str, "FLT_MAX") == 0)
else if ( strcmp( value_str, "FltMax") == 0)
*(float *)buffer_ptr = FLT_MAX;
else if ( strcmp( value_str, "FLT_NMAX") == 0)
else if ( strcmp( value_str, "FltNMax") == 0)
*(float *)buffer_ptr = -FLT_MAX;
else if ( sscanf( value_str, "%f%s", (float *)buffer_ptr, s) != 1)
return WNAV__INPUT_SYNTAX;
......@@ -132,9 +132,9 @@ int wnav_attr_string_to_value( ldh_tSesContext ldhses, int type_id, char *value
break;
}
case pwr_eType_Int32: {
if ( strcmp( value_str, "INT_MIN") == 0)
if ( strcmp( value_str, "IntMin") == 0)
*(int *)buffer_ptr = INT_MIN;
else if ( strcmp( value_str, "INT_MAX") == 0)
else if ( strcmp( value_str, "IntMax") == 0)
*(int *)buffer_ptr = INT_MAX;
else if ( sscanf( value_str, "%d%s", (int *)buffer_ptr, s) != 1)
return WNAV__INPUT_SYNTAX;
......@@ -276,9 +276,9 @@ int wnav_attr_string_to_value( ldh_tSesContext ldhses, int type_id, char *value
case pwr_eType_Time: {
pwr_tTime time;
if ( strcmp( value_str, "ATTIME_ZERO") == 0)
if ( strcmp( value_str, "AtZero") == 0)
memcpy( buffer_ptr, &pwr_cAtMin, sizeof(pwr_tTime));
else if ( strcmp( value_str, "ATTIME_MAX") == 0)
else if ( strcmp( value_str, "AtMax") == 0)
memcpy( buffer_ptr, &pwr_cAtMax, sizeof(pwr_tTime));
else {
sts = time_AsciiToA( value_str, &time);
......@@ -290,9 +290,9 @@ int wnav_attr_string_to_value( ldh_tSesContext ldhses, int type_id, char *value
case pwr_eType_DeltaTime: {
pwr_tDeltaTime deltatime;
if ( strcmp( value_str, "DTTIME_MIN") == 0)
if ( strcmp( value_str, "DtMin") == 0)
memcpy( buffer_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime));
else if ( strcmp( value_str, "DTTIME_MAX") == 0)
else if ( strcmp( value_str, "DtMax") == 0)
memcpy( buffer_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime));
else {
sts = time_AsciiToD( value_str, &deltatime);
......@@ -324,19 +324,19 @@ void wnav_attrvalue_to_string( ldh_tSesContext ldhses, int type_id, void *value
}
case pwr_eType_Float32: {
if ( *(float *)value_ptr == FLT_MIN) {
strcpy( str, "FLT_MIN");
strcpy( str, "FltMin");
*len = strlen( str);
}
else if ( *(float *)value_ptr == -FLT_MIN) {
strcpy( str, "FLT_NMIN");
strcpy( str, "FltNMin");
*len = strlen( str);
}
else if ( *(float *)value_ptr == FLT_MAX) {
strcpy( str, "FLT_MAX");
strcpy( str, "FltMax");
*len = strlen( str);
}
else if ( *(float *)value_ptr == -FLT_MAX) {
strcpy( str, "FLT_NMAX");
strcpy( str, "FltNMax");
*len = strlen( str);
}
else
......@@ -366,11 +366,11 @@ void wnav_attrvalue_to_string( ldh_tSesContext ldhses, int type_id, void *value
}
case pwr_eType_Int32: {
if ( *(int *)value_ptr == INT_MIN) {
strcpy( str, "INT_MIN");
strcpy( str, "IntMin");
*len = strlen( str);
}
else if ( *(int *)value_ptr == INT_MAX) {
strcpy( str, "INT_MAX");
strcpy( str, "IntMax");
*len = strlen( str);
}
else
......@@ -499,9 +499,9 @@ void wnav_attrvalue_to_string( ldh_tSesContext ldhses, int type_id, void *value
}
case pwr_eType_Time: {
if ( memcmp( value_ptr, &pwr_cAtMin, sizeof(pwr_tTime)) == 0)
strcpy( str, "ATTIME_ZERO");
strcpy( str, "AtZero");
else if ( memcmp( value_ptr, &pwr_cAtMax, sizeof(pwr_tTime)) == 0)
strcpy( str, "ATTIME_MAX");
strcpy( str, "AtMax");
else {
sts = time_AtoAscii( (pwr_tTime *) value_ptr, time_eFormat_DateAndTime,
str, sizeof(str));
......@@ -514,9 +514,9 @@ void wnav_attrvalue_to_string( ldh_tSesContext ldhses, int type_id, void *value
}
case pwr_eType_DeltaTime: {
if ( memcmp( value_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime)) == 0)
strcpy( str, "DTTIME_MIN");
strcpy( str, "DtMin");
else if ( memcmp( value_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime)) == 0)
strcpy( str, "DTTIME_MAX");
strcpy( str, "DtMax");
else {
sts = time_DtoAscii( (pwr_tDeltaTime *) value_ptr, 1,
str, sizeof(str));
......
......@@ -262,13 +262,13 @@ int XNav::attr_string_to_value( int type_id, char *value_str,
break;
}
case pwr_eType_Float32: {
if ( strcmp( value_str, "FLT_MIN") == 0)
if ( strcmp( value_str, "FltMin") == 0)
*(float *)buffer_ptr = FLT_MIN;
else if ( strcmp( value_str, "FLT_NMIN") == 0)
else if ( strcmp( value_str, "FltNMin") == 0)
*(float *)buffer_ptr = -FLT_MIN;
else if ( strcmp( value_str, "FLT_MAX") == 0)
else if ( strcmp( value_str, "FltMax") == 0)
*(float *)buffer_ptr = FLT_MAX;
else if ( strcmp( value_str, "FLT_NMAX") == 0)
else if ( strcmp( value_str, "FltNMax") == 0)
*(float *)buffer_ptr = -FLT_MAX;
else if ( sscanf( value_str, "%f%s", (float *)buffer_ptr, s) != 1)
return XNAV__INPUT_SYNTAX;
......@@ -306,9 +306,9 @@ int XNav::attr_string_to_value( int type_id, char *value_str,
case pwr_eType_Int32:
case pwr_eType_Status:
case pwr_eType_NetStatus: {
if ( strcmp( value_str, "INT_MIN") == 0)
if ( strcmp( value_str, "IntMin") == 0)
*(int *)buffer_ptr = INT_MIN;
else if ( strcmp( value_str, "INT_MAX") == 0)
else if ( strcmp( value_str, "IntMax") == 0)
*(int *)buffer_ptr = INT_MAX;
else if ( sscanf( value_str, "%d%s", (int *)buffer_ptr, s) != 1)
return XNAV__INPUT_SYNTAX;
......@@ -434,9 +434,9 @@ int XNav::attr_string_to_value( int type_id, char *value_str,
case pwr_eType_Time: {
pwr_tTime time;
if ( strcmp( value_str, "ATTIME_ZERO") == 0)
if ( strcmp( value_str, "AtZero") == 0)
memcpy( buffer_ptr, &pwr_cAtMin, sizeof(pwr_tTime));
else if ( strcmp( value_str, "ATTIME_MAX") == 0)
else if ( strcmp( value_str, "AtMax") == 0)
memcpy( buffer_ptr, &pwr_cAtMax, sizeof(pwr_tTime));
else {
sts = time_AsciiToA( value_str, &time);
......@@ -448,9 +448,9 @@ int XNav::attr_string_to_value( int type_id, char *value_str,
case pwr_eType_DeltaTime: {
pwr_tDeltaTime deltatime;
if ( strcmp( value_str, "DTTIME_MIN") == 0)
if ( strcmp( value_str, "DtMin") == 0)
memcpy( buffer_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime));
else if ( strcmp( value_str, "DTTIME_MAX") == 0)
else if ( strcmp( value_str, "DtMax") == 0)
memcpy( buffer_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime));
else {
sts = time_AsciiToD( value_str, &deltatime);
......@@ -489,19 +489,19 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
}
case pwr_eType_Float32: {
if ( *(float *)value_ptr == FLT_MIN) {
strcpy( str, "FLT_MIN");
strcpy( str, "FltMin");
*len = strlen(str);
}
else if ( *(float *)value_ptr == -FLT_MIN) {
strcpy( str, "FLT_NMIN");
strcpy( str, "FltNMin");
*len = strlen(str);
}
else if ( *(float *)value_ptr == FLT_MAX) {
strcpy( str, "FLT_MAX");
strcpy( str, "FltMax");
*len = strlen(str);
}
else if ( *(float *)value_ptr == -FLT_MAX) {
strcpy( str, "FLT_NMAX");
strcpy( str, "FltNMax");
*len = strlen(str);
}
else {
......@@ -606,11 +606,11 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
}
case pwr_eType_Int32: {
if ( *(int *)value_ptr == INT_MIN) {
strcpy( str, "INT_MIN");
strcpy( str, "IntMin");
*len = strlen(str);
}
else if ( *(int *)value_ptr == INT_MAX) {
strcpy( str, "INT_MAX");
strcpy( str, "IntMax");
*len = strlen(str);
}
else {
......@@ -883,9 +883,9 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
break;
default:
if ( memcmp( value_ptr, &pwr_cAtMin, sizeof(pwr_tTime)) == 0)
strcpy( timstr, "ATTIME_ZERO");
strcpy( timstr, "AtZero");
else if ( memcmp( value_ptr, &pwr_cAtMax, sizeof(pwr_tTime)) == 0)
strcpy( timstr, "ATTIME_MAX");
strcpy( timstr, "AtMax");
else {
sts = time_AtoAscii( (pwr_tTime *) value_ptr, time_eFormat_DateAndTime,
timstr, sizeof(timstr));
......@@ -904,9 +904,9 @@ void XNav::attrvalue_to_string( int type_id, pwr_tTid tid, void *value_ptr,
break;
default:
if ( memcmp( value_ptr, &pwr_cDtMin, sizeof(pwr_tDeltaTime)) == 0)
strcpy( timstr, "DTTIME_MIN");
strcpy( timstr, "DtMin");
else if ( memcmp( value_ptr, &pwr_cDtMax, sizeof(pwr_tDeltaTime)) == 0)
strcpy( timstr, "DTTIME_MAX");
strcpy( timstr, "DtMax");
else {
sts = time_DtoAscii( (pwr_tDeltaTime *) value_ptr, 1,
timstr, sizeof(timstr));
......
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