Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
c269f138
Commit
c269f138
authored
Mar 03, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IEqual, IGreaterEqual etc added
parent
65ef725f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
128 additions
and
43 deletions
+128
-43
src/lib/rt/src/rt_plc_arithm.c
src/lib/rt/src/rt_plc_arithm.c
+88
-3
src/wbl/pwrb/src/pwrb_c_equal.wb_load
src/wbl/pwrb/src/pwrb_c_equal.wb_load
+8
-8
src/wbl/pwrb/src/pwrb_c_greaterequal.wb_load
src/wbl/pwrb/src/pwrb_c_greaterequal.wb_load
+8
-8
src/wbl/pwrb/src/pwrb_c_greaterthan.wb_load
src/wbl/pwrb/src/pwrb_c_greaterthan.wb_load
+8
-8
src/wbl/pwrb/src/pwrb_c_lessequal.wb_load
src/wbl/pwrb/src/pwrb_c_lessequal.wb_load
+8
-8
src/wbl/pwrb/src/pwrb_c_lessthan.wb_load
src/wbl/pwrb/src/pwrb_c_lessthan.wb_load
+8
-8
No files found.
src/lib/rt/src/rt_plc_arithm.c
View file @
c269f138
...
...
@@ -12,6 +12,7 @@
#endif
#include <limits.h>
#include <math.h>
#include <float.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
...
...
@@ -686,7 +687,19 @@ void Equal_exec(
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
(
o
->
In1
==
o
->
In2
);
o
->
Status
=
(
fabsf
(
o
->
In1
-
o
->
In2
)
<
FLT_EPSILON
);
}
/*_*
@aref notequal NotEqual
*/
void
NotEqual_exec
(
plc_sThread
*
tp
,
pwr_sClass_NotEqual
*
o
)
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
!
(
fabsf
(
o
->
In1
-
o
->
In2
)
<
FLT_EPSILON
);
}
/*_*
...
...
@@ -698,7 +711,7 @@ void GreaterEqual_exec(
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
(
o
->
In1
>=
o
->
In2
);
o
->
Status
=
(
o
->
In1
>=
o
->
In2
)
||
(
fabsf
(
o
->
In1
-
o
->
In2
)
<
FLT_EPSILON
)
;
}
/*_*
...
...
@@ -722,7 +735,7 @@ void LessEqual_exec(
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
(
o
->
In1
<=
o
->
In2
);
o
->
Status
=
(
o
->
In1
<=
o
->
In2
)
||
(
fabsf
(
o
->
In1
-
o
->
In2
)
<
FLT_EPSILON
)
;
}
/*_*
...
...
@@ -737,6 +750,78 @@ void LessThan_exec(
o
->
Status
=
(
o
->
In1
<
o
->
In2
);
}
/*_*
@aref iequal IEqual
*/
void
IEqual_exec
(
plc_sThread
*
tp
,
pwr_sClass_IEqual
*
o
)
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
(
o
->
In1
==
o
->
In2
);
}
/*_*
@aref iequal INotEqual
*/
void
INotEqual_exec
(
plc_sThread
*
tp
,
pwr_sClass_INotEqual
*
o
)
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
(
o
->
In1
!=
o
->
In2
);
}
/*_*
@aref igreaterequal IGreaterEqual
*/
void
IGreaterEqual_exec
(
plc_sThread
*
tp
,
pwr_sClass_IGreaterEqual
*
o
)
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
(
o
->
In1
>=
o
->
In2
);
}
/*_*
@aref igreaterthan IGreaterThan
*/
void
IGreaterThan_exec
(
plc_sThread
*
tp
,
pwr_sClass_IGreaterThan
*
o
)
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
(
o
->
In1
>
o
->
In2
);
}
/*_*
@aref ilessequal ILessEqual
*/
void
ILessEqual_exec
(
plc_sThread
*
tp
,
pwr_sClass_ILessEqual
*
o
)
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
(
o
->
In1
<=
o
->
In2
);
}
/*_*
@aref ilessthan ILessThan
*/
void
ILessThan_exec
(
plc_sThread
*
tp
,
pwr_sClass_ILessThan
*
o
)
{
o
->
In1
=
*
o
->
In1P
;
o
->
In2
=
*
o
->
In2P
;
o
->
Status
=
(
o
->
In1
<
o
->
In2
);
}
/*_*
IAdd Integer addition.
...
...
src/wbl/pwrb/src/pwrb_c_equal.wb_load
View file @
c269f138
...
...
@@ -11,12 +11,12 @@ SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,Plc
Integer
! @Summary Check if two
integer
are equal.
! Equal compare two
integer
values and returnes true if they are equal.
! @Group Plc,Plc
Analog
! @Summary Check if two
analog values
are equal.
! Equal compare two
analog
values and returnes true if they are equal.
! @image orm_equal_fo.gif
!*/
Object Equal $ClassDef
391
Object Equal $ClassDef
419
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
...
...
@@ -27,24 +27,24 @@ SObject pwrb:Class
Attr StructName = "Equal"
EndBody
!/**
!
Integer
input 1.
!
Analog
input 1.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOINVERT
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In1"
EndBody
EndObject
!/**
!
Integer
input 2.
!
Analog
input 2.
!*/
Object In2 $Input 2
Body SysBody
Attr Flags |= PWR_MASK_NOINVERT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In2"
EndBody
EndObject
...
...
src/wbl/pwrb/src/pwrb_c_greaterequal.wb_load
View file @
c269f138
...
...
@@ -11,13 +11,13 @@ SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,Plc
Integer
! @Summary Check if an
integer
value is greater than or equal another.
! GreaterEqual compares two
integer
values and returns true if the first
! @Group Plc,Plc
Analog
! @Summary Check if an
analog
value is greater than or equal another.
! GreaterEqual compares two
analog
values and returns true if the first
! is greater than or equal the second.
! @image orm_greaterequal_fo.gif
!*/
Object GreaterEqual $ClassDef
392
Object GreaterEqual $ClassDef
420
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
...
...
@@ -28,24 +28,24 @@ SObject pwrb:Class
Attr StructName = "GreaterEqual"
EndBody
!/**
!
Integer
input 1.
!
Analog
input 1.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOINVERT
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In1"
EndBody
EndObject
!/**
!
Integer
input 2.
!
Analog
input 2.
!*/
Object In2 $Input 2
Body SysBody
Attr Flags |= PWR_MASK_NOINVERT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In2"
EndBody
EndObject
...
...
src/wbl/pwrb/src/pwrb_c_greaterthan.wb_load
View file @
c269f138
...
...
@@ -11,13 +11,13 @@ SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,Plc
Integer
! @Summary Check if an
integer
value is greater than another.
! GreaterThan compares two
integer
values and returns true if the first
! @Group Plc,Plc
Analog
! @Summary Check if an
analog
value is greater than another.
! GreaterThan compares two
analog
values and returns true if the first
! is greater than the second.
! @image orm_greaterthan_fo.gif
!*/
Object GreaterThan $ClassDef
393
Object GreaterThan $ClassDef
421
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
...
...
@@ -28,24 +28,24 @@ SObject pwrb:Class
Attr StructName = "GreaterThan"
EndBody
!/**
!
Integer
input 1.
!
Analog
input 1.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOINVERT
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In1"
EndBody
EndObject
!/**
!
Integer
input 2.
!
Analog
input 2.
!*/
Object In2 $Input 2
Body SysBody
Attr Flags |= PWR_MASK_NOINVERT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In2"
EndBody
EndObject
...
...
src/wbl/pwrb/src/pwrb_c_lessequal.wb_load
View file @
c269f138
...
...
@@ -11,13 +11,13 @@ SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,Plc
Integer
! @Summary Check if an
integer
value is less than or equal another.
! LessEqual compares two
integer
values and returns true if the first
! @Group Plc,Plc
Analog
! @Summary Check if an
analog
value is less than or equal another.
! LessEqual compares two
analog
values and returns true if the first
! is less than or equal the second.
! @image orm_lessequal_fo.gif
!*/
Object LessEqual $ClassDef
394
Object LessEqual $ClassDef
422
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
...
...
@@ -28,24 +28,24 @@ SObject pwrb:Class
Attr StructName = "LessEqual"
EndBody
!/**
!
Integer
input 1.
!
Analog
input 1.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOINVERT
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In1"
EndBody
EndObject
!/**
!
Integer
input 2.
!
Analog
input 2.
!*/
Object In2 $Input 2
Body SysBody
Attr Flags |= PWR_MASK_NOINVERT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In2"
EndBody
EndObject
...
...
src/wbl/pwrb/src/pwrb_c_lessthan.wb_load
View file @
c269f138
...
...
@@ -11,13 +11,13 @@ SObject pwrb:Class
!/**
! @Version 1.0
! @Code rt_plc_arithm.c
! @Group Plc,Plc
Integer
! @Summary Check if an
integer
value is less than another.
! LessThan compares two
integer
values and returns true if the first
! @Group Plc,Plc
Analog
! @Summary Check if an
analog
value is less than another.
! LessThan compares two
analog
values and returns true if the first
! is less than the second.
! @image orm_lessthan_fo.gif
!*/
Object LessThan $ClassDef
395
Object LessThan $ClassDef
423
Body SysBody
Attr Editor = pwr_eEditor_PlcEd
Attr Method = pwr_eMethod_Connections
...
...
@@ -28,24 +28,24 @@ SObject pwrb:Class
Attr StructName = "LessThan"
EndBody
!/**
!
Integer
input 1.
!
Analog
input 1.
!*/
Object In1 $Input 1
Body SysBody
Attr Flags |= PWR_MASK_NOREMOVE
Attr Flags |= PWR_MASK_NOINVERT
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In1"
EndBody
EndObject
!/**
!
Integer
input 2.
!
Analog
input 2.
!*/
Object In2 $Input 2
Body SysBody
Attr Flags |= PWR_MASK_NOINVERT
Attr TypeRef = "pwrs:Type-$
In
t32"
Attr TypeRef = "pwrs:Type-$
Floa
t32"
Attr GraphName = "In2"
EndBody
EndObject
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment