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
db5dc0fa
Commit
db5dc0fa
authored
May 07, 2004
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Supervision of emon timestamp
parent
ed7b46cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
src/lib/rt/src/rt_plc_thread.c
src/lib/rt/src/rt_plc_thread.c
+13
-2
No files found.
src/lib/rt/src/rt_plc_thread.c
View file @
db5dc0fa
...
...
@@ -31,7 +31,10 @@
#endif
#include "rt_plc_loop.h"
#include "rt_c_plcthread.h"
#include "rt_c_node.h"
#define max(Dragon,Eagle) ((Dragon) > (Eagle) ? (Dragon) : (Eagle))
#define min(Dragon,Eagle) ((Dragon) < (Eagle) ? (Dragon) : (Eagle))
#define MIN_SCANTIME 1e-9
/* When you use pthread_cond_timedwait is the shortest timeout always > 1 CLK_TCK
...
...
@@ -80,8 +83,9 @@ plc_thread (
rel_vec
=
((
tp
->
pp
->
PlcProcess
->
ChgCount
-
1
)
%
2
)
+
1
;
sts
=
io_init
(
io_mProcess_Plc
,
tp
->
aref
.
Objid
,
&
tp
->
plc_io_ctx
,
rel_vec
,
tp
->
f_scan_time
);
if
(
EVEN
(
sts
))
{
errh_Error
(
"Failed to inititalize io, %m"
,
sts
);
pp
->
IOHandler
->
IOReadWriteFlag
=
FALSE
;
errh_Error
(
"Failed to inititalize io, %m"
,
sts
);
errh_SetStatus
(
PLC__ERRINITIO
);
}
tp
->
init
(
0
,
tp
);
...
...
@@ -91,6 +95,7 @@ plc_thread (
if
(
EVEN
(
sts
))
{
tp
->
pp
->
IOHandler
->
IOReadWriteFlag
=
FALSE
;
errh_Error
(
"IO read, %m"
,
sts
);
errh_SetStatus
(
PLC__IOREAD
);
}
}
...
...
@@ -164,6 +169,7 @@ scan (
if
(
EVEN
(
sts
))
{
pp
->
IOHandler
->
IOReadWriteFlag
=
FALSE
;
errh_Error
(
"IO read, %m"
,
sts
);
errh_SetStatus
(
PLC__IOREAD
);
}
}
...
...
@@ -188,6 +194,7 @@ scan (
if
(
EVEN
(
sts
))
{
pp
->
IOHandler
->
IOReadWriteFlag
=
FALSE
;
errh_Error
(
"IO write, %m"
,
sts
);
errh_SetStatus
(
PLC__IOWRITE
);
}
}
...
...
@@ -214,8 +221,10 @@ scan (
pwr_tTime
now
;
clock_gettime
(
CLOCK_REALTIME
,
&
now
);
delay_action
=
csup_Exec
(
&
sts
,
tp
->
csup_lh
,
&
tp
->
sync_time
,
&
tp
->
after_scan
,
&
now
);
if
(
delay_action
==
2
)
if
(
delay_action
==
2
)
{
pp
->
IOHandler
->
IOReadWriteFlag
=
FALSE
;
errh_SetStatus
(
PLC__IOSTALLED
);
}
}
#if defined OS_LYNX && USE_RT_TIMER
...
...
@@ -240,6 +249,8 @@ scan (
if
(
++
tp
->
loops
==
2
)
tp
->
log
=
TRUE
;
if
(
tp
->
loops
%
max
(
1
,
(
int
)(
1
.
0
/
tp
->
PlcThread
->
ScanTime
))
==
0
)
pwrs_Node_SupEmon
();
}
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