Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CryoCooler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango devices
Temperature
CryoCooler
Commits
a8d8ffab
Commit
a8d8ffab
authored
Feb 4, 2019
by
Sonia Minolli
Browse files
Options
Downloads
Patches
Plain Diff
Enable hardware polling time
parent
55cc2573
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/CryoCoolerInterface.cpp
+26
-16
26 additions, 16 deletions
src/CryoCoolerInterface.cpp
src/cryo_support/DBOffsets.h
+1
-1
1 addition, 1 deletion
src/cryo_support/DBOffsets.h
with
27 additions
and
17 deletions
src/CryoCoolerInterface.cpp
+
26
−
16
View file @
a8d8ffab
...
...
@@ -94,7 +94,7 @@ namespace CryoCooler_ns
}
conf
.
output_offset
=
DB_END_OUTPUT_OFFSET
;
conf
.
output_length
=
DB_END_OUTPUT_LEN
;
//
conf.periodic_timeout_ms = periodic_timeout_ms;
conf
.
periodic_timeout_ms
=
periodic_timeout_ms
;
hwp
=
new
HWProxy_ns
::
HWProxy
(
host_dev
,
conf
);
if
(
!
hwp
)
...
...
@@ -147,7 +147,7 @@ namespace CryoCooler_ns
conf
.
output_length
=
DB_WRITE_OUTPUT_LEN_V2
;
}
//
conf.periodic_timeout_ms = periodic_timeout_ms;
conf
.
periodic_timeout_ms
=
periodic_timeout_ms
;
hwp_wr
=
new
HWProxy_ns
::
HWProxy
(
host_dev
,
conf
);
if
(
!
hwp_wr
)
...
...
@@ -251,15 +251,19 @@ namespace CryoCooler_ns
DEBUG_STREAM
<<
"CryoCoolerInterface::process_message (1) trying to set command request "
<<
wi
->
byte_offset
<<
std
::
endl
;
if
(
hwp_wr
)
{
// V2_COMMAND_REQUEST_BYTE = 0 in the DBR
// wi->byte_offset contains the command word as defined in the RI command table, e.g. OPEN_V9 BYTE B#16#6 , 0
// we have to write a short (write byte not possible in PLCServer device) as: 0xCMDW 0000
// soso
// V2_COMMAND_REQUEST_BYTE = 0 in the DBW
// wi->byte_offset contains the command word (2 bytes) as defined in the RI command table, e.g. OPEN_V9 BYTE B#16#6
// we have to write the 6 bytes (3 words) of the DBW all at once, e.g. 06 00 00 00 00 00
short
cmd
=
wi
->
byte_offset
;
cmd
=
cmd
<<
8
;
// @SMI : à valider : écrire les 6 octets d'un seul coup ?
hwp_wr
->
write_short
(
"CryoCoolerInterface::process_message (1) trying to write INT value "
,
V2_COMMAND_REQUEST_BYTE
,
cmd
);
// V2_COMMAND_VALUE_BYTE = 2 in the DBR. We write 0 in the next 4 bytes because no value to write for a command
hwp_wr
->
write_real
(
"CryoCoolerInterface::process_message (1) trying to write REAL value "
,
V2_COMMAND_VALUE_BYTE
,
0.0
);
short
dbw
[
V2_COMMAND_REQUEST_DBW_SIZE
];
dbw
[
0
]
=
cmd
;
dbw
[
1
]
=
0
;
dbw
[
2
]
=
0
;
hwp_wr
->
write_shorts
(
"CryoCoolerInterface::process_message (1) trying to write 6 BYTES"
,
V2_COMMAND_REQUEST_BYTE
,
V2_COMMAND_REQUEST_DBW_SIZE
,
&
dbw
[
0
]);
}
}
catch
(...)
...
...
@@ -288,15 +292,21 @@ namespace CryoCooler_ns
DEBUG_STREAM
<<
"CryoCoolerInterface::process_message (1) trying to write REAL value "
<<
wr
->
value
<<
" for command request "
<<
wr
->
byte_offset
<<
std
::
endl
;
if
(
hwp_wr
)
{
// V2_COMMAND_REQUEST_BYTE = 0 in the DBR
// wi->byte_offset contains the command word as defined in the RI command table, e.g. SET_V11 BYTE B#16#11 , 45
// we have to write a short (write byte not possible in PLCServer device) as: 0xCMDW 0000
// soso
// V2_COMMAND_REQUEST_BYTE = 0 in the DBW
// wi->byte_offset contains the command word as defined in the RI command table, e.g. SET_V10 BYTE B#16#10
// we have to write the 6 bytes (3 words) of the DBW all at once, e.g. 10 00 42 50 00 00
short
cmd
=
wr
->
byte_offset
;
cmd
=
cmd
<<
8
;
// @SMI : à valider : écrire les 6 octets d'un seul coup ?
hwp_wr
->
write_short
(
"CryoCoolerInterface::process_message (1) trying to write INT value "
,
V2_COMMAND_REQUEST_BYTE
,
cmd
);
// V2_COMMAND_VALUE_BYTE = 2 in the DBR. We write the real value in the next 4 bytes
hwp_wr
->
write_real
(
"CryoCoolerInterface::process_message (1) trying to write REAL value "
,
V2_COMMAND_VALUE_BYTE
,
wr
->
value
);
long
*
l
=
(
long
*
)
&
wr
->
value
;
short
dbw
[
V2_COMMAND_REQUEST_DBW_SIZE
];
dbw
[
0
]
=
cmd
;
dbw
[
1
]
=
(
short
)(
*
l
&
0x0000FFFF
);
dbw
[
2
]
=
(
short
)((
*
l
&
0xFFFF0000
)
/
0x10000
);
hwp_wr
->
write_shorts
(
"CryoCoolerInterface::process_message (1) trying to write 6 BYTES"
,
V2_COMMAND_REQUEST_BYTE
,
V2_COMMAND_REQUEST_DBW_SIZE
,
&
dbw
[
0
]);
}
}
catch
(...)
...
...
This diff is collapsed.
Click to expand it.
src/cryo_support/DBOffsets.h
+
1
−
1
View file @
a8d8ffab
...
...
@@ -237,7 +237,7 @@ namespace CryoCooler_ns
// V2 protocol interface for commands (byte offsets)
//-----------------------------------------------------------------------------
const
unsigned
int
V2_COMMAND_REQUEST_BYTE
=
0
;
const
unsigned
int
V2_COMMAND_
VALUE_BYTE
=
2
;
const
unsigned
int
V2_COMMAND_
REQUEST_DBW_SIZE
=
3
;
// in words (3 x 2 bytes)
}
//- namespace
...
...
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