nimi-python
nimi-python copied to clipboard
nidcpower_advanced_sequence.py has several issues preventing it from working out of the box on real hardware
Description of issue
The example will always time out because the delay is not multiplied by the number of steps.
timeout = hightime.timedelta(seconds=(delay_in_seconds + 1.0))
should be:
timeout = hightime.timedelta(seconds=(delay_in_seconds * points_per_output_function + 1.0))
Specifying the number of steps as an argument is missing data type.
parser.add_argument('-s', '--number-steps', default=256, help='Number of steps per output function')
should be
parser.add_argument('-s', '--number-steps', default=256, type=int, help='Number of steps per output function')
Waiting on the sequence engine done event does not take the calculated timeout and is not needed since fetch_multiple will block. This can be removed:
session.wait_for_event(nidcpower.Event.SEQUENCE_ENGINE_DONE)
Steps to reproduce issue
Run the example with real hardware