Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python_test_scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
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
LOFAR2.0
python_test_scripts
Commits
f0888d61
Commit
f0888d61
authored
Aug 4, 2021
by
Gijs Schoonderbeek
Browse files
Options
Downloads
Patches
Plain Diff
pol read-out after testing, quick fix low currents
parent
5b40bb2f
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
APSPU_I2C.py
+8
-2
8 additions, 2 deletions
APSPU_I2C.py
rd_apspu.py
+1
-0
1 addition, 0 deletions
rd_apspu.py
with
9 additions
and
2 deletions
APSPU_I2C.py
+
8
−
2
View file @
f0888d61
...
...
@@ -48,9 +48,13 @@ RUN_MONITOR = 0x80
# Calculate floating point value according PMBus lineair
def
calc_lin_2bytes
(
data
):
expo
=
((
data
[
1
]
&
0xf8
)
>>
3
)
if
expo
>
2
**
4
:
if
expo
==
1
:
expo
=
-
7
if
expo
>
(
2
**
4
):
expo
=
expo
-
2
**
5
mantisse
=
(
data
[
1
]
&
0x7
)
*
0x100
+
data
[
0
]
if
mantisse
>
(
2
**
(
8
+
2
)):
mantisse
=
mantisse
-
2
**
(
8
+
3
)
output
=
mantisse
*
2
**
expo
return
output
...
...
@@ -59,8 +63,10 @@ def calc_lin_3bytes(data,mode):
expo
=
(
mode
[
0
]
&
0x1F
)
if
expo
>
2
**
4
:
expo
=
expo
-
2
**
5
output
=
(
data
[
1
]
*
256
+
data
[
0
])
*
2
**
expo
mant
=
(
data
[
1
]
*
256
+
data
[
0
])
output
=
mant
*
2
**
expo
return
output
def
tach
(
tach_msb
,
tach_lsb
):
tach_pulse_per_revolution
=
2
tach
=
(
int
(
tach_msb
,
16
)
*
8
)
+
(
int
(
tach_lsb
,
16
)
/
32
)
...
...
This diff is collapsed.
Click to expand it.
rd_apspu.py
+
1
−
0
View file @
f0888d61
...
...
@@ -146,6 +146,7 @@ class PolClass:
# Function to read the output current of the Point of Load DC/DC converter
#
if
self
.
status
:
ret_ack
,
raw_value
=
self
.
pol_dev
.
read_bytes
(
0x39
,
2
)
ret_ack
,
raw_value
=
self
.
pol_dev
.
read_bytes
(
LP_IOUT
,
2
)
ret_value
=
[]
ret_value
.
append
(
int
(
raw_value
[:
2
],
16
))
...
...
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