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
e32c20ea
Commit
e32c20ea
authored
Mar 05, 2020
by
Claes Sjöfors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modbus TCP server objects improvments
parent
0122ca72
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
16 deletions
+51
-16
otherio/lib/rt/src/rt_io_m_mb_tcp_server.c
otherio/lib/rt/src/rt_io_m_mb_tcp_server.c
+8
-3
otherio/wbl/mcomp/src/otherio.wb_load
otherio/wbl/mcomp/src/otherio.wb_load
+43
-13
No files found.
otherio/lib/rt/src/rt_io_m_mb_tcp_server.c
View file @
e32c20ea
...
...
@@ -182,7 +182,7 @@ static void* mb_receive(void* data)
break
;
}
addr
-=
mp
->
ReadAddress
;
addr
-=
mp
->
Read
Reg
Address
;
if
(
addr
<
0
||
addr
+
quant
*
2
>
local_card
->
output_size
)
{
exception_code
=
2
;
...
...
@@ -252,6 +252,8 @@ static void* mb_receive(void* data)
break
;
}
addr
-=
mp
->
ReadDigAddress
;
offs
=
addr
/
8
;
bytes
=
(
addr
+
quant
)
/
8
+
(((
addr
+
quant
)
%
8
==
0
)
?
0
:
1
)
-
offs
;
...
...
@@ -332,7 +334,7 @@ static void* mb_receive(void* data)
break
;
}
addr
-=
mp
->
WriteAddress
;
addr
-=
mp
->
Write
Reg
Address
;
if
(
addr
<
0
||
addr
+
2
>
local_card
->
input_size
)
{
exception_code
=
2
;
...
...
@@ -397,7 +399,7 @@ static void* mb_receive(void* data)
break
;
}
addr
-=
mp
->
WriteAddress
;
addr
-=
mp
->
Write
Reg
Address
;
if
(
addr
<
0
||
addr
+
quant
*
2
>
local_card
->
input_size
)
{
exception_code
=
2
;
...
...
@@ -459,6 +461,8 @@ static void* mb_receive(void* data)
break
;
}
addr
-=
mp
->
WriteDigAddress
;
offs
=
addr
/
8
;
if
(
addr
<
0
||
offs
+
local_card
->
di_offset
>=
local_card
->
input_size
...
...
@@ -535,6 +539,7 @@ static void* mb_receive(void* data)
exception_code
=
2
;
break
;
}
addr
-=
mp
->
WriteDigAddress
;
offs
=
addr
/
8
;
bytes
=
(
addr
+
quant
)
/
8
+
(((
addr
+
quant
)
%
8
==
0
)
?
0
:
1
)
-
offs
;
...
...
otherio/wbl/mcomp/src/otherio.wb_load
View file @
e32c20ea
! Generated by wb_print_wbl 02-MAR-2020 23:49:56.61
! Volume OtherIO
! Version V5.7.0
Volume OtherIO $ClassVolume 0.0.250.10
Body SysBody 01-JAN-1970 01:00:00.00
Attr NextOix = "_X668"
...
...
@@ -2338,7 +2341,8 @@ Volume OtherIO $ClassVolume 0.0.250.10
!*/
Object ByteOrderingLE $Attribute 22 29-MAR-2019 11:26:24.84
Body SysBody 29-MAR-2019 11:26:54.23
Attr Flags = 16777216
Attr PgmName = "ByteOrderingLE"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
...
...
@@ -3356,6 +3360,12 @@ Volume OtherIO $ClassVolume 0.0.250.10
! and is the father of channel objects that define the input and
! output area for the module.
!
! The input area should be organized with registers first (ChanAi, ChanIi),
! and then digital inputs (ChanDi).
!
! Likewise the output area should be organized with registers first (ChanAo, ChanIo),
! and then digital outputs (ChanDo).
!
! @classlink Modbus_TCP_Server otherio_modbus_tcp_server.html
!*/
Object Modbus_TCP_ServerModule $ClassDef 7 25-NOV-2009 11:05:45.82
...
...
@@ -3367,7 +3377,7 @@ Volume OtherIO $ClassVolume 0.0.250.10
Object RtBody $ObjBodyDef 1 25-NOV-2009 11:05:23.49
Body SysBody 25-NOV-2009 11:06:00.66
Attr StructName = "Modbus_TCP_ServerModule"
Attr NextAix = "_X2
1
"
Attr NextAix = "_X2
3
"
EndBody
!/**
! Description of the object.
...
...
@@ -3385,12 +3395,10 @@ Volume OtherIO $ClassVolume 0.0.250.10
! The value defines the starting address for the input channels
! of class ChanIi and ChanAi.
!
! Note that the address for ReadDiscreteInputs and ReadCoils are
! not affected by the ReadAddress.
!*/
Object Read
Address $Attribute 12 04-DEC-2009 16:53:13.17
Body SysBody 0
4-DEC-2009 16:53:32.47
Attr PgmName = "ReadAddress"
Object Read
RegAddress $Attribute 12 02-MAR-2020 17:48:30.72
Body SysBody 0
2-MAR-2020 17:48:52.08
Attr PgmName = "Read
Reg
Address"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
...
...
@@ -3402,12 +3410,34 @@ Volume OtherIO $ClassVolume 0.0.250.10
! The value defines the starting address for the output channels
! of class ChanIo and ChanAo.
!
! Note that the address for WriteSingleCoil and WriteMultipleCoils
! are not affected by the WriteAddress.
!*/
Object WriteAddress $Attribute 13 04-DEC-2009 16:53:43.87
Body SysBody 04-DEC-2009 16:53:45.81
Attr PgmName = "WriteAddress"
Object WriteRegAddress $Attribute 13 02-MAR-2020 17:50:49.91
Body SysBody 02-MAR-2020 17:49:25.67
Attr PgmName = "WriteRegAddress"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! @Summary Address for reading digital inputs.
! Address for reading with function code ReadInputs.
! The value defines the starting address for the input channels of class ChanDi
!*/
Object ReadDigAddress $Attribute 21 02-MAR-2020 17:42:32.87
Body SysBody 02-MAR-2020 17:41:32.19
Attr PgmName = "ReadDigAddress"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! @Summary Address for writing digital outputs.
! Address for reading with function code WriteMultipleCoils.
! The value defines the starting address for the output channels of class ChanDo
!*/
Object WriteDigAddress $Attribute 22 02-MAR-2020 17:50:02.32
Body SysBody 02-MAR-2020 17:50:14.30
Attr PgmName = "WriteDigAddress"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
...
...
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