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
5d819748
Commit
5d819748
authored
Jun 10, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Component for demo of Do IO added Misc_DoDemo
parent
173993cd
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29257 additions
and
7 deletions
+29257
-7
misc/lib/misc/src/misc_plc.c
misc/lib/misc/src/misc_plc.c
+323
-4
misc/mmi/misc/src/pwr_c_misc_demopattern.pwg
misc/mmi/misc/src/pwr_c_misc_demopattern.pwg
+4317
-0
misc/mmi/misc/src/pwr_c_misc_dodemo.pwg
misc/mmi/misc/src/pwr_c_misc_dodemo.pwg
+5091
-0
misc/wbl/misc/src/miscellaneous.wb_load
misc/wbl/misc/src/miscellaneous.wb_load
+2394
-3
misc/wbl/misc/src/pwr_misc_dodemofo.flw
misc/wbl/misc/src/pwr_misc_dodemofo.flw
+17132
-0
No files found.
misc/lib/misc/src/misc_plc.c
View file @
5d819748
/*
/*
* Proview $Id$
* Proview Open Source Process Control.
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005-2011 SSAB Oxelosund AB.
*
* This file is part of Proview.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* modify it under the terms of the GNU General Public License as
...
@@ -13,8 +15,23 @@
...
@@ -13,8 +15,23 @@
* GNU General Public License for more details.
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* along with Proview. If not, see <http://www.gnu.org/licenses/>
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* 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.
*/
*/
/* misc_plc.c Plc function object code. */
/* misc_plc.c Plc function object code. */
...
@@ -344,3 +361,305 @@ void Misc_PingPongFo_exec( plc_sThread *tp, pwr_sClass_Misc_PingPongFo *o)
...
@@ -344,3 +361,305 @@ void Misc_PingPongFo_exec( plc_sThread *tp, pwr_sClass_Misc_PingPongFo *o)
co
->
OldMode
=
co
->
Mode
;
co
->
OldMode
=
co
->
Mode
;
}
}
#define DEMOPATTERN_MAXSTATE 33
void
Misc_DemoPattern_exec
(
plc_sThread
*
tp
,
pwr_sClass_Misc_DemoPattern
*
o
)
{
int
new_state
;
if
(
!*
o
->
OnP
)
{
o
->
Mask1
=
0
;
o
->
Mask2
=
0
;
o
->
State
=
0
;
o
->
CycleCnt
=
0
;
o
->
StateCnt
=
0
;
}
else
{
o
->
Cycle
=
o
->
CycleTime
/
tp
->
PlcThread
->
ScanTime
/
o
->
NumberOfOutputs
;
if
(
o
->
CycleCnt
>=
o
->
Cycle
)
o
->
CycleCnt
=
0
;
else
o
->
CycleCnt
++
;
if
(
o
->
CycleCnt
!=
1
)
return
;
if
(
o
->
StateCnt
>=
o
->
NumberOfOutputs
-
1
)
o
->
StateCnt
=
0
;
o
->
StateCnt
++
;
if
(
o
->
StateCnt
==
1
)
{
if
(
o
->
State
>=
DEMOPATTERN_MAXSTATE
)
o
->
State
=
0
;
else
o
->
State
++
;
new_state
=
1
;
}
else
new_state
=
0
;
switch
(
o
->
State
)
{
case
0
:
if
(
new_state
)
{
o
->
Mask1
=
1
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
o
->
Mask1
<<
1
;
break
;
case
1
:
if
(
new_state
)
{
o
->
Mask1
=
1
<<
31
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
o
->
Mask1
>>
1
;
break
;
case
2
:
case
3
:
if
(
new_state
)
{
o
->
Mask1
=
1
;
o
->
Mask2
=
1
<<
31
;
}
else
{
o
->
Mask1
=
o
->
Mask1
<<
1
;
o
->
Mask2
=
o
->
Mask2
>>
1
;
}
break
;
case
4
:
case
5
:
if
(
new_state
)
{
o
->
Mask1
=
1
||
1
<<
16
;
o
->
Mask2
=
1
<<
31
||
1
<<
16
;
}
else
{
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
o
->
Mask2
=
(
o
->
Mask2
<<
31
)
|
(
o
->
Mask2
>>
1
);
}
break
;
case
6
:
case
7
:
if
(
new_state
)
{
o
->
Mask1
=
1
|
1
<<
16
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
8
:
if
(
new_state
)
{
o
->
Mask1
=
1
|
1
<<
8
|
1
<<
16
|
1
<<
24
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
9
:
if
(
new_state
)
{
o
->
Mask1
=
1
|
1
<<
4
|
1
<<
8
|
1
<<
12
|
1
<<
16
|
1
<<
20
|
1
<<
24
|
1
<<
28
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
10
:
if
(
new_state
)
{
o
->
Mask1
=
1
|
1
<<
2
|
1
<<
4
|
1
<<
6
|
1
<<
8
|
1
<<
10
|
1
<<
12
|
1
<<
14
|
1
<<
16
|
1
<<
18
|
1
<<
20
|
1
<<
22
|
1
<<
24
|
1
<<
26
|
1
<<
28
|
1
<<
30
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
11
:
if
(
new_state
)
{
o
->
Mask1
=
~
(
1
|
1
<<
4
|
1
<<
8
|
1
<<
12
|
1
<<
16
|
1
<<
20
|
1
<<
24
|
1
<<
28
);
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
12
:
if
(
new_state
)
{
o
->
Mask1
=
~
(
1
|
1
<<
8
|
1
<<
16
|
1
<<
24
);
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
13
:
if
(
new_state
)
{
o
->
Mask1
=
~
(
1
|
1
<<
16
);
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
14
:
if
(
new_state
)
{
o
->
Mask1
=
~
1
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
15
:
if
(
new_state
)
{
o
->
Mask1
=
~
(
1
<<
31
);
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
<<
31
)
|
(
o
->
Mask1
>>
1
);
break
;
case
16
:
if
(
new_state
)
{
o
->
Mask1
=
1
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
17
:
if
(
new_state
)
{
o
->
Mask1
=
3
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
18
:
if
(
new_state
)
{
o
->
Mask1
=
7
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
19
:
if
(
new_state
)
{
o
->
Mask1
=
0xF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
20
:
if
(
new_state
)
{
o
->
Mask1
=
0x3F
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
21
:
if
(
new_state
)
{
o
->
Mask1
=
0x7F
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
22
:
if
(
new_state
)
{
o
->
Mask1
=
0xFF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
23
:
if
(
new_state
)
{
o
->
Mask1
=
0x3FF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
24
:
if
(
new_state
)
{
o
->
Mask1
=
0x7FF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
25
:
if
(
new_state
)
{
o
->
Mask1
=
0xFFF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
26
:
if
(
new_state
)
{
o
->
Mask1
=
0x3FFF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
27
:
if
(
new_state
)
{
o
->
Mask1
=
0x7FFF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
28
:
if
(
new_state
)
{
o
->
Mask1
=
0xFFFF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
29
:
if
(
new_state
)
{
o
->
Mask1
=
0xFFFFF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
30
:
if
(
new_state
)
{
o
->
Mask1
=
0xFFFFFF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
31
:
if
(
new_state
)
{
o
->
Mask1
=
0xFFFFFFF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
32
:
if
(
new_state
)
{
o
->
Mask1
=
0x3FFFFFFF
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
case
33
:
if
(
new_state
)
{
o
->
Mask1
=
~
1
;
o
->
Mask2
=
0
;
}
else
o
->
Mask1
=
(
o
->
Mask1
>>
31
)
|
(
o
->
Mask1
<<
1
);
break
;
}
}
o
->
Out
=
(
pwr_tInt32
)(
o
->
Mask1
|
o
->
Mask2
);
}
misc/mmi/misc/src/pwr_c_misc_demopattern.pwg
0 → 100644
View file @
5d819748
This diff is collapsed.
Click to expand it.
misc/mmi/misc/src/pwr_c_misc_dodemo.pwg
0 → 100644
View file @
5d819748
This diff is collapsed.
Click to expand it.
misc/wbl/misc/src/miscellaneous.wb_load
View file @
5d819748
This diff is collapsed.
Click to expand it.
misc/wbl/misc/src/pwr_misc_dodemofo.flw
0 → 100644
View file @
5d819748
This diff is collapsed.
Click to expand it.
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