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
9b6f43bf
Commit
9b6f43bf
authored
Oct 17, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modbus TCP module with both read and write
parent
7ef3456a
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
691 additions
and
474 deletions
+691
-474
otherio/lib/rt/src/os_linux/rt_io_m_mb_module.c
otherio/lib/rt/src/os_linux/rt_io_m_mb_module.c
+8
-8
otherio/lib/rt/src/os_linux/rt_io_m_mb_tcp_slave.c
otherio/lib/rt/src/os_linux/rt_io_m_mb_tcp_slave.c
+422
-438
otherio/lib/rt/src/os_linux/rt_io_mb_locals.h
otherio/lib/rt/src/os_linux/rt_io_mb_locals.h
+4
-0
otherio/lib/rt/src/rt_io_otherio.meth
otherio/lib/rt/src/rt_io_otherio.meth
+1
-0
otherio/wbl/mcomp/src/otherio.wb_load
otherio/wbl/mcomp/src/otherio.wb_load
+252
-26
wb/lib/wb/src/wb_c_chandi.cpp
wb/lib/wb/src/wb_c_chandi.cpp
+2
-1
wb/lib/wb/src/wb_c_chanii.cpp
wb/lib/wb/src/wb_c_chanii.cpp
+2
-1
No files found.
otherio/lib/rt/src/os_linux/rt_io_m_mb_module.c
View file @
9b6f43bf
...
...
@@ -71,12 +71,12 @@ static pwr_tStatus IoCardInit (
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
io_sCardLocal
Msg
*
local
;
pwr_sClass_Modbus_Module
*
op
;
int
i
;
op
=
(
pwr_sClass_Modbus_Module
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
local
=
(
(
io_sCardLocal
*
)
cp
->
Local
)
->
msg
;
for
(
i
=
0
;
i
<
IO_MAXCHAN
;
i
++
)
{
local
->
scancount
[
i
]
=
0
;
...
...
@@ -98,12 +98,12 @@ static pwr_tStatus IoCardRead (
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
io_sCardLocal
Msg
*
local
;
pwr_sClass_Modbus_Module
*
op
;
pwr_sClass_Modbus_TCP_Slave
*
slave
;
op
=
(
pwr_sClass_Modbus_Module
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
local
=
(
(
io_sCardLocal
*
)
cp
->
Local
)
->
msg
;
slave
=
(
pwr_sClass_Modbus_TCP_Slave
*
)
rp
->
op
;
if
(
op
->
ScanInterval
>
1
)
{
...
...
@@ -118,7 +118,7 @@ static pwr_tStatus IoCardRead (
}
if
(
slave
->
Status
==
MB__NORMAL
)
{
io_bus_card_read
(
ctx
,
rp
,
cp
,
local
->
input_area
,
NULL
,
pwr_eByteOrderingEnum_BigEndian
,
pwr_eFloatRepEnum_FloatIntel
);
io_bus_card_read
(
ctx
,
rp
,
cp
,
slave
->
Inputs
,
NULL
,
pwr_eByteOrderingEnum_BigEndian
,
pwr_eFloatRepEnum_FloatIntel
);
}
// printf("Method Modbus_Module-IoCardRead\n");
return
IO__SUCCESS
;
...
...
@@ -135,13 +135,13 @@ static pwr_tStatus IoCardWrite (
io_sCard
*
cp
)
{
io_sCardLocal
*
local
;
io_sCardLocal
Msg
*
local
;
pwr_sClass_Modbus_Module
*
op
;
pwr_sClass_Modbus_TCP_Slave
*
slave
;
op
=
(
pwr_sClass_Modbus_Module
*
)
cp
->
op
;
local
=
(
io_sCardLocal
*
)
cp
->
Local
;
local
=
(
(
io_sCardLocal
*
)
cp
->
Local
)
->
msg
;
slave
=
(
pwr_sClass_Modbus_TCP_Slave
*
)
rp
->
op
;
if
(
op
->
ScanInterval
>
1
)
{
...
...
@@ -159,7 +159,7 @@ static pwr_tStatus IoCardWrite (
}
if
(
slave
->
Status
==
MB__NORMAL
)
{
io_bus_card_write
(
ctx
,
cp
,
local
->
output_area
,
pwr_eByteOrderingEnum_BigEndian
,
pwr_eFloatRepEnum_FloatIntel
);
io_bus_card_write
(
ctx
,
cp
,
slave
->
Outputs
,
pwr_eByteOrderingEnum_BigEndian
,
pwr_eFloatRepEnum_FloatIntel
);
}
// printf("Method Modbus_Module-IoCardWrite\n");
return
IO__SUCCESS
;
...
...
otherio/lib/rt/src/os_linux/rt_io_m_mb_tcp_slave.c
View file @
9b6f43bf
This diff is collapsed.
Click to expand it.
otherio/lib/rt/src/os_linux/rt_io_mb_locals.h
View file @
9b6f43bf
...
...
@@ -112,6 +112,10 @@ typedef struct {
short
int
no_do
;
int
interval_cnt
;
int
has_read_method
;
}
io_sCardLocalMsg
;
typedef
struct
{
io_sCardLocalMsg
msg
[
2
];
}
io_sCardLocal
;
typedef
struct
{
...
...
otherio/lib/rt/src/rt_io_otherio.meth
View file @
9b6f43bf
...
...
@@ -2,6 +2,7 @@ MotionControl_USB
MotionControl_USBIO
Modbus_TCP_Slave
Modbus_Module
Modbus_ModuleReadWrite
Modbus_Master
Modbus_TCP_Server
Modbus_TCP_ServerModule
...
...
otherio/wbl/mcomp/src/otherio.wb_load
View file @
9b6f43bf
This diff is collapsed.
Click to expand it.
wb/lib/wb/src/wb_c_chandi.cpp
View file @
9b6f43bf
...
...
@@ -142,7 +142,8 @@ static pwr_tStatus PostCreate( ldh_tSesContext Session,
if
(
!
repr_set
)
{
wb_cdef
father_cdef
=
sp
->
cdef
(
Class
);
if
(
strcmp
(
father_cdef
.
name
(),
"Modbus_TCP_ServerModule"
)
==
0
||
strcmp
(
father_cdef
.
name
(),
"Modbus_Module"
)
==
0
)
{
strcmp
(
father_cdef
.
name
(),
"Modbus_Module"
)
==
0
||
strcmp
(
father_cdef
.
name
(),
"Modbus_ModuleReadWrite"
)
==
0
)
{
wb_attribute
a
=
sp
->
attribute
(
Object
,
"RtBody"
,
"Representation"
);
if
(
!
a
)
return
a
.
sts
();
...
...
wb/lib/wb/src/wb_c_chanii.cpp
View file @
9b6f43bf
...
...
@@ -104,7 +104,8 @@ static pwr_tStatus PostCreate( ldh_tSesContext Session,
if
(
!
repr_set
)
{
wb_cdef
father_cdef
=
sp
->
cdef
(
Class
);
if
(
strcmp
(
father_cdef
.
name
(),
"Modbus_TCP_ServerModule"
)
==
0
||
strcmp
(
father_cdef
.
name
(),
"Modbus_Module"
)
==
0
)
{
strcmp
(
father_cdef
.
name
(),
"Modbus_Module"
)
==
0
||
strcmp
(
father_cdef
.
name
(),
"Modbus_ModuleReadWrite"
)
==
0
)
{
wb_attribute
a
=
sp
->
attribute
(
Object
,
"RtBody"
,
"Representation"
);
if
(
!
a
)
return
a
.
sts
();
...
...
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