Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opensilecs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
silecs
opensilecs
Commits
34bda116
Commit
34bda116
authored
7 years ago
by
kochalas
Committed by
al.schwinn
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[SIL-279] Fix offset calculation for SNAP7 I/O
parent
c739ab6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
silecs-communication-cpp/src/silecs-communication/interface/communication/SNAP7Connection.cpp
+3
-1
3 additions, 1 deletion
...communication/interface/communication/SNAP7Connection.cpp
with
3 additions
and
1 deletion
silecs-communication-cpp/src/silecs-communication/interface/communication/SNAP7Connection.cpp
+
3
−
1
View file @
34bda116
...
...
@@ -243,6 +243,7 @@ int SNAP7Connection::readIO(PLC* thePLC, unsigned long address, unsigned long of
//DATA topic makes sense with RECV one
if
(
RECV
&
Log
::
topics_
)
LOG
(
DATA
)
<<
"Read data, address: "
<<
address
<<
", ofs: "
<<
offset
<<
", byte-size: "
<<
size
;
address
+=
offset
;
err
=
Cli_EBRead
(
recvClient_
,
(
int
)
address
,
(
int
)
size
,
(
void
*
)
pBuffer
);
checkError
(
thePLC
,
err
,
false
);
// close the connection, will try again at the next access
}
...
...
@@ -260,6 +261,7 @@ int SNAP7Connection::writeIO(PLC* thePLC, unsigned long address, unsigned long o
//DATA topic makes sense with SEND one
if
(
SEND
&
Log
::
topics_
)
LOG
(
DATA
)
<<
"Write data, address: "
<<
address
<<
", ofs: "
<<
offset
<<
", byte-size: "
<<
size
;
address
+=
offset
;
err
=
Cli_ABWrite
(
sendClient_
,
(
int
)
address
,
(
int
)
size
,
(
void
*
)
pBuffer
);
checkError
(
thePLC
,
err
,
false
);
// close the connection, will try again at the next access
}
...
...
@@ -271,7 +273,7 @@ bool SNAP7Connection::checkError(PLC* thePLC, int err, bool retry)
{
if
(
err
!=
0
)
{
LOG
(
COMM
)
<<
"Transaction failure with PLC: "
<<
thePLC
->
getName
()
<<
getErrorMessage
(
err
);
LOG
(
COMM
)
<<
"Transaction failure with PLC: "
<<
thePLC
->
getName
()
<<
" "
<<
getErrorMessage
(
err
);
if
(
retry
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment