You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work with a SFC6000D via I2C with a RPi 5 and Python 3.11. I think there is a problem with the transfer of values in the UpdateSetpoint function.
The processing of the input values of update_setpoint fails with t.pack() in transfer.py. A pointer address is passed here instead of the value. I'm not sure if this is the case for all functions in which a value is passed to the controller. However, I have not checked this. All functions without value transfer work perfectly.
I have implemented the following solution, but it is not ideal as it does not solve the actual problem but deals with the symptoms. The pack() function is defined in rx_tx_data.py. Here I enter the further processing of the value (update_setpoint), which is passed as arg in argument_list[]. If the CMD_ID = 0xf054 (UpdateSetpoint), arg = arg.value is set. This ensures that the value and not the address is passed.
If I output the argument_list[] without the customisation, the output looks like this: <sensirion_i2c_sfx6xxx.result_types.SignalRawFlow object at 0x7ffebff2d150>
After the adjustment, the value is output instead of the address. (e.g. as rawFlow = -18381)
def pack(self, argument_list=[]): data_to_pack = [self._cmd_id] for arg in argument_list: if self._cmd_id == 0xf054: arg = arg.value if isinstance(arg, str): data_to_pack.append(self._string_to_bytes(arg)) elif isinstance(arg, (list, tuple)): data_to_pack.extend(arg) else: data_to_pack.append(arg)
The text was updated successfully, but these errors were encountered:
I think the problem, is that it is not clear how to work with the returned signals from the driver.
As you already figured out, you get the a SignalRawFlow when you do a measurement. If you want to use this signal as a setpoint you have to provide the .value and not the whole signal.
Here is some pseudo code on what I refer to.
I am also not sure if I understand your problem correctly. I don't think you want to set the set_point to the measured flow since the set point controls the flow, resp. the measured flow should follow the configured setpoint.
Hi I just had some more time looking into the issue and opened a pull request that should hopefully fix the issue with update setpoint and another issue with reading the product identifier.
I work with a SFC6000D via I2C with a RPi 5 and Python 3.11. I think there is a problem with the transfer of values in the UpdateSetpoint function.
The processing of the input values of update_setpoint fails with t.pack() in transfer.py. A pointer address is passed here instead of the value. I'm not sure if this is the case for all functions in which a value is passed to the controller. However, I have not checked this. All functions without value transfer work perfectly.
I have implemented the following solution, but it is not ideal as it does not solve the actual problem but deals with the symptoms. The pack() function is defined in rx_tx_data.py. Here I enter the further processing of the value (update_setpoint), which is passed as arg in argument_list[]. If the CMD_ID = 0xf054 (UpdateSetpoint), arg = arg.value is set. This ensures that the value and not the address is passed.
If I output the argument_list[] without the customisation, the output looks like this:
<sensirion_i2c_sfx6xxx.result_types.SignalRawFlow object at 0x7ffebff2d150>
After the adjustment, the value is output instead of the address. (e.g. as rawFlow = -18381)
def pack(self, argument_list=[]):
data_to_pack = [self._cmd_id]
for arg in argument_list:
if self._cmd_id == 0xf054:
arg = arg.value
if isinstance(arg, str):
data_to_pack.append(self._string_to_bytes(arg))
elif isinstance(arg, (list, tuple)):
data_to_pack.extend(arg)
else:
data_to_pack.append(arg)
The text was updated successfully, but these errors were encountered: