Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsequential correction to IFM SBN246 temperature decode. #761

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

swh76
Copy link
Contributor

@swh76 swh76 commented Sep 26, 2024

Description

I think the decode of the temperature data from the IFM SBN246 sensor drops the MSB here;

_b_temp = binary[17:30]

From the IO-Link process data description;

Screenshot 2024-09-26 at 1 10 27 PM

but running a 32-bit word through the existing code;

value='abcdefghijklmnopqrstuvwxyz123456'
_b_flow = binary[0:16]
_b_temp = binary[17:30]
print(f'_b_flow = {_b_flow}')
print(f'_b_temp = {_b_temp}')

gives

_b_flow = abcdefghijklmnop
_b_temp = rstuvwxyz1234

which misses the MSB of the temperature process data field (letter 'q' here). This PR fixes that.

Motivation and Context

In my lab this makes no difference, probably because it would only matter if the temperatures were much higher. The same is almost certainly true in the field. This change probably doesn't matter, I just noticed it when I was working out the decode for a different IFM sensor.

How Has This Been Tested?

I compiled and tested on my two SBN246 sensors in my lab at SLAC and it made no difference.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@swh76 swh76 requested a review from sanahabhimani September 26, 2024 20:17
@swh76 swh76 self-assigned this Sep 26, 2024
@swh76 swh76 added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Sep 26, 2024
@BrianJKoopman BrianJKoopman self-requested a review October 1, 2024 13:36
Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@BrianJKoopman BrianJKoopman merged commit a86e845 into main Oct 1, 2024
5 checks passed
@BrianJKoopman BrianJKoopman deleted the ifm_sbn246_agent_temp_decode_fix branch October 1, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants