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
406877e0
Commit
406877e0
authored
Mar 16, 2010
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modbus TCP module: ScanInterval added
parent
0725104d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
otherio/lib/rt/src/os_linux/rt_io_m_mb_module.c
otherio/lib/rt/src/os_linux/rt_io_m_mb_module.c
+25
-0
otherio/lib/rt/src/os_linux/rt_io_mb_locals.h
otherio/lib/rt/src/os_linux/rt_io_mb_locals.h
+2
-0
No files found.
otherio/lib/rt/src/os_linux/rt_io_m_mb_module.c
View file @
406877e0
...
...
@@ -89,6 +89,17 @@ static pwr_tStatus IoCardRead (
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
slave
=
(
pwr_sClass_Modbus_TCP_Slave
*
)
rp
->
op
;
if
(
op
->
ScanInterval
>
1
)
{
local
->
has_read_method
=
1
;
if
(
local
->
interval_cnt
!=
0
)
{
local
->
interval_cnt
++
;
if
(
local
->
interval_cnt
>=
op
->
ScanInterval
)
local
->
interval_cnt
=
0
;
return
IO__SUCCESS
;
}
local
->
interval_cnt
++
;
}
if
(
slave
->
Status
==
MB__NORMAL
)
{
io_card_read
(
ctx
,
rp
,
cp
,
local
->
input_area
,
NULL
,
pwr_eByteOrderingEnum_BigEndian
,
pwr_eFloatRepEnum_FloatIntel
);
}
...
...
@@ -112,6 +123,20 @@ static pwr_tStatus IoCardWrite (
pwr_sClass_Modbus_TCP_Slave
*
slave
;
if
(
op
->
ScanInterval
>
1
)
{
if
(
!
local
->
has_read_method
)
{
if
(
local
->
interval_cnt
!=
0
)
{
local
->
interval_cnt
++
;
if
(
local
->
interval_cnt
>=
op
->
ScanInterval
)
local
->
interval_cnt
=
0
;
return
IO__SUCCESS
;
}
local
->
interval_cnt
++
;
}
else
if
(
local
->
interval_cnt
!=
1
)
return
IO__SUCCESS
;
}
op
=
(
pwr_sClass_Modbus_Module
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
slave
=
(
pwr_sClass_Modbus_TCP_Slave
*
)
rp
->
op
;
...
...
otherio/lib/rt/src/os_linux/rt_io_mb_locals.h
View file @
406877e0
...
...
@@ -93,6 +93,8 @@ typedef struct {
int
output_size
;
short
int
no_di
;
short
int
no_do
;
int
interval_cnt
;
int
has_read_method
;
}
io_sCardLocal
;
typedef
struct
{
...
...
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