Skip to content

Add possibility of single signal manipulation #265

@iwane-pl

Description

@iwane-pl
  • OS: Win10 Enterprise 1299
  • Python version: 3.6.2
  • NI-XNET version: 18.5

It would be nice to have a way to manipulate signal values in Signal Out sessions separately. Currently the way to modify a single signal value is as follows:

out_signals = ['Day', 'Hour', 'Minute', 'Month', 'Second', 'Year']
out_session = nixnet.SignalOutSinglePointSession('CAN1', db_name, 'Cluster', out_signals)
out_session.start()
value_buffer = [0 for _ in out_signals]
value_buffer[-2] = 5
out_session.signals.write(value_buffer)

This requires to remember indices of the signals in value_buffer. That can be cumbersome for people writing e.g. test cases using nixnet. My proposal is to make it as follows (in addition to existing bulk access):

out_session.signals['Hour'] = 5   # the best way
out_session.signals[1] = 5   # also good

out_session.signals['Hour'].write(5)  # acceptable
out_session.signals[1].write(5)  # acceptable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions