zaber-motion 7.12.0__py3-none-win32.whl → 7.14.0__py3-none-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zaber_motion/__init__.py +103 -103
- zaber_motion/ascii/__init__.py +73 -73
- zaber_motion/ascii/all_axes.py +352 -352
- zaber_motion/ascii/axis.py +1673 -1666
- zaber_motion/ascii/axis_group.py +391 -391
- zaber_motion/ascii/axis_settings.py +752 -752
- zaber_motion/ascii/connection.py +1174 -1174
- zaber_motion/ascii/device.py +908 -908
- zaber_motion/ascii/device_io.py +1170 -1170
- zaber_motion/ascii/device_settings.py +735 -735
- zaber_motion/ascii/lockstep.py +1184 -1184
- zaber_motion/ascii/oscilloscope.py +635 -635
- zaber_motion/ascii/oscilloscope_data.py +240 -240
- zaber_motion/ascii/pvt.py +105 -105
- zaber_motion/ascii/pvt_buffer.py +146 -146
- zaber_motion/ascii/pvt_io.py +630 -630
- zaber_motion/ascii/pvt_sequence.py +1530 -1530
- zaber_motion/ascii/servo_tuner.py +637 -637
- zaber_motion/ascii/setting_constants.py +1755 -1755
- zaber_motion/ascii/storage.py +905 -905
- zaber_motion/ascii/stream.py +2182 -2182
- zaber_motion/ascii/stream_buffer.py +101 -101
- zaber_motion/ascii/stream_io.py +700 -700
- zaber_motion/ascii/streams.py +105 -105
- zaber_motion/ascii/transport.py +202 -202
- zaber_motion/ascii/trigger.py +886 -886
- zaber_motion/ascii/triggers.py +241 -241
- zaber_motion/ascii/warning_flags.py +178 -178
- zaber_motion/ascii/warnings.py +152 -152
- zaber_motion/async_utils.py +46 -46
- zaber_motion/binary/__init__.py +14 -14
- zaber_motion/binary/connection.py +648 -648
- zaber_motion/binary/device.py +924 -924
- zaber_motion/binary/device_settings.py +121 -121
- zaber_motion/bindings.py +50 -50
- zaber_motion/call.py +198 -198
- zaber_motion/convert_exception.py +138 -138
- zaber_motion/dto/__init__.py +11 -11
- zaber_motion/dto/ascii/__init__.py +46 -46
- zaber_motion/dto/ascii/alert_event.py +110 -110
- zaber_motion/dto/ascii/axis_identity.py +134 -117
- zaber_motion/dto/ascii/axis_type.py +14 -14
- zaber_motion/dto/ascii/can_set_state_axis_response.py +69 -69
- zaber_motion/dto/ascii/can_set_state_device_response.py +75 -75
- zaber_motion/dto/ascii/conversion_factor.py +81 -81
- zaber_motion/dto/ascii/device_identity.py +136 -136
- zaber_motion/dto/ascii/device_io_info.py +108 -108
- zaber_motion/dto/ascii/digital_output_action.py +13 -13
- zaber_motion/dto/ascii/get_axis_setting.py +64 -64
- zaber_motion/dto/ascii/get_axis_setting_result.py +81 -81
- zaber_motion/dto/ascii/get_setting.py +88 -88
- zaber_motion/dto/ascii/get_setting_result.py +87 -87
- zaber_motion/dto/ascii/io_port_label.py +84 -84
- zaber_motion/dto/ascii/io_port_type.py +14 -14
- zaber_motion/dto/ascii/lockstep_axes.py +108 -108
- zaber_motion/dto/ascii/measurement_sequence.py +73 -73
- zaber_motion/dto/ascii/message_type.py +14 -14
- zaber_motion/dto/ascii/optional_measurement_sequence.py +71 -71
- zaber_motion/dto/ascii/oscilloscope_capture_properties.py +116 -116
- zaber_motion/dto/ascii/oscilloscope_data_source.py +11 -11
- zaber_motion/dto/ascii/paramset_info.py +92 -92
- zaber_motion/dto/ascii/pid_tuning.py +125 -125
- zaber_motion/dto/ascii/pvt_axis_definition.py +70 -70
- zaber_motion/dto/ascii/pvt_axis_type.py +11 -11
- zaber_motion/dto/ascii/pvt_csv_data.py +75 -75
- zaber_motion/dto/ascii/pvt_mode.py +12 -12
- zaber_motion/dto/ascii/pvt_sequence_data.py +99 -99
- zaber_motion/dto/ascii/response.py +137 -137
- zaber_motion/dto/ascii/servo_tuning_param.py +66 -66
- zaber_motion/dto/ascii/servo_tuning_paramset.py +21 -21
- zaber_motion/dto/ascii/set_state_axis_response.py +75 -75
- zaber_motion/dto/ascii/set_state_device_response.py +80 -80
- zaber_motion/dto/ascii/simple_tuning.py +118 -118
- zaber_motion/dto/ascii/simple_tuning_param_definition.py +100 -100
- zaber_motion/dto/ascii/stream_axis_definition.py +70 -70
- zaber_motion/dto/ascii/stream_axis_type.py +11 -11
- zaber_motion/dto/ascii/stream_mode.py +13 -13
- zaber_motion/dto/ascii/trigger_action.py +12 -12
- zaber_motion/dto/ascii/trigger_condition.py +15 -15
- zaber_motion/dto/ascii/trigger_enabled_state.py +68 -68
- zaber_motion/dto/ascii/trigger_operation.py +12 -12
- zaber_motion/dto/ascii/trigger_state.py +114 -114
- zaber_motion/dto/ascii/unknown_response_event.py +137 -137
- zaber_motion/dto/axis_address.py +74 -74
- zaber_motion/dto/binary/__init__.py +11 -11
- zaber_motion/dto/binary/binary_settings.py +74 -74
- zaber_motion/dto/binary/command_code.py +106 -106
- zaber_motion/dto/binary/device_identity.py +156 -156
- zaber_motion/dto/binary/device_type.py +12 -12
- zaber_motion/dto/binary/error_code.py +101 -101
- zaber_motion/dto/binary/message.py +91 -91
- zaber_motion/dto/binary/reply_code.py +16 -16
- zaber_motion/dto/binary/reply_only_event.py +91 -91
- zaber_motion/dto/binary/unknown_response_event.py +91 -91
- zaber_motion/dto/channel_address.py +74 -74
- zaber_motion/dto/device_db_source.py +66 -66
- zaber_motion/dto/device_db_source_type.py +11 -11
- zaber_motion/dto/exceptions/__init__.py +24 -24
- zaber_motion/dto/exceptions/binary_command_failed_exception_data.py +57 -57
- zaber_motion/dto/exceptions/command_failed_exception_data.py +151 -151
- zaber_motion/dto/exceptions/command_too_long_exception_data.py +98 -98
- zaber_motion/dto/exceptions/device_address_conflict_exception_data.py +63 -63
- zaber_motion/dto/exceptions/device_db_failed_exception_data.py +74 -74
- zaber_motion/dto/exceptions/device_db_inner_error.py +85 -85
- zaber_motion/dto/exceptions/g_code_execution_exception_data.py +75 -75
- zaber_motion/dto/exceptions/g_code_syntax_exception_data.py +75 -75
- zaber_motion/dto/exceptions/invalid_packet_exception_data.py +63 -63
- zaber_motion/dto/exceptions/invalid_pvt_point.py +69 -69
- zaber_motion/dto/exceptions/invalid_response_exception_data.py +51 -51
- zaber_motion/dto/exceptions/movement_failed_exception_data.py +104 -104
- zaber_motion/dto/exceptions/movement_interrupted_exception_data.py +104 -104
- zaber_motion/dto/exceptions/operation_failed_exception_data.py +104 -104
- zaber_motion/dto/exceptions/pvt_execution_exception_data.py +86 -86
- zaber_motion/dto/exceptions/pvt_movement_failed_exception_data.py +69 -69
- zaber_motion/dto/exceptions/pvt_movement_interrupted_exception_data.py +69 -69
- zaber_motion/dto/exceptions/set_device_state_exception_data.py +176 -176
- zaber_motion/dto/exceptions/set_peripheral_state_exception_data.py +121 -121
- zaber_motion/dto/exceptions/stream_execution_exception_data.py +63 -63
- zaber_motion/dto/exceptions/stream_movement_failed_exception_data.py +69 -69
- zaber_motion/dto/exceptions/stream_movement_interrupted_exception_data.py +69 -69
- zaber_motion/dto/firmware_version.py +91 -91
- zaber_motion/dto/gcode/__init__.py +9 -9
- zaber_motion/dto/gcode/axis_definition.py +74 -74
- zaber_motion/dto/gcode/axis_mapping.py +69 -69
- zaber_motion/dto/gcode/axis_transformation.py +79 -79
- zaber_motion/dto/gcode/device_definition.py +99 -99
- zaber_motion/dto/gcode/translate_message.py +87 -87
- zaber_motion/dto/gcode/translate_result.py +79 -79
- zaber_motion/dto/gcode/translator_config.py +84 -84
- zaber_motion/dto/log_output_mode.py +13 -13
- zaber_motion/dto/measurement.py +67 -67
- zaber_motion/dto/microscopy/__init__.py +6 -6
- zaber_motion/dto/microscopy/autofocus_status.py +57 -57
- zaber_motion/dto/microscopy/microscope_config.py +159 -159
- zaber_motion/dto/microscopy/third_party_components.py +55 -55
- zaber_motion/dto/microscopy/wdi_autofocus_provider_status.py +57 -57
- zaber_motion/dto/named_parameter.py +64 -64
- zaber_motion/dto/product/__init__.py +5 -5
- zaber_motion/dto/product/process_controller_mode.py +13 -13
- zaber_motion/dto/product/process_controller_source.py +72 -72
- zaber_motion/dto/product/process_controller_source_sensor.py +11 -11
- zaber_motion/dto/requests/__init__.py +256 -254
- zaber_motion/dto/requests/alert_event_wrapper.py +82 -82
- zaber_motion/dto/requests/autofocus_focus_request.py +131 -131
- zaber_motion/dto/requests/autofocus_get_objective_params_request.py +121 -121
- zaber_motion/dto/requests/autofocus_get_objective_params_response.py +56 -56
- zaber_motion/dto/requests/autofocus_get_status_response.py +50 -50
- zaber_motion/dto/requests/autofocus_set_objective_params_request.py +141 -141
- zaber_motion/dto/requests/axes_empty_request.py +95 -95
- zaber_motion/dto/requests/axes_get_setting_request.py +121 -121
- zaber_motion/dto/requests/axes_move_request.py +114 -114
- zaber_motion/dto/requests/axis_empty_request.py +79 -79
- zaber_motion/dto/requests/axis_move_type.py +12 -12
- zaber_motion/dto/requests/axis_to_string_request.py +88 -88
- zaber_motion/dto/requests/binary_device_detect_request.py +56 -56
- zaber_motion/dto/requests/binary_device_detect_response.py +57 -57
- zaber_motion/dto/requests/binary_device_get_setting_request.py +89 -89
- zaber_motion/dto/requests/binary_device_home_request.py +88 -88
- zaber_motion/dto/requests/binary_device_move_request.py +111 -111
- zaber_motion/dto/requests/binary_device_set_setting_request.py +100 -100
- zaber_motion/dto/requests/binary_device_stop_request.py +88 -88
- zaber_motion/dto/requests/binary_generic_with_units_request.py +122 -122
- zaber_motion/dto/requests/binary_message_collection.py +56 -56
- zaber_motion/dto/requests/binary_reply_only_event_wrapper.py +82 -82
- zaber_motion/dto/requests/bool_response.py +43 -43
- zaber_motion/dto/requests/can_set_state_axis_response.py +60 -60
- zaber_motion/dto/requests/can_set_state_request.py +100 -100
- zaber_motion/dto/requests/channel_on.py +84 -84
- zaber_motion/dto/requests/channel_set_intensity.py +90 -90
- zaber_motion/dto/requests/check_version_request.py +54 -54
- zaber_motion/dto/requests/custom_interface_close_request.py +60 -60
- zaber_motion/dto/requests/custom_interface_open_response.py +51 -51
- zaber_motion/dto/requests/custom_interface_read_request.py +51 -51
- zaber_motion/dto/requests/custom_interface_write_request.py +60 -60
- zaber_motion/dto/requests/device_cancel_all_outputs_schedule_request.py +80 -80
- zaber_motion/dto/requests/device_cancel_output_schedule_request.py +84 -84
- zaber_motion/dto/requests/device_convert_setting_request.py +116 -116
- zaber_motion/dto/requests/device_detect_request.py +68 -68
- zaber_motion/dto/requests/device_detect_response.py +57 -57
- zaber_motion/dto/requests/device_empty_request.py +65 -65
- zaber_motion/dto/requests/device_get_all_analog_io_request.py +74 -74
- zaber_motion/dto/requests/device_get_all_analog_io_response.py +54 -54
- zaber_motion/dto/requests/device_get_all_digital_io_request.py +74 -74
- zaber_motion/dto/requests/device_get_all_digital_io_response.py +46 -46
- zaber_motion/dto/requests/device_get_analog_io_request.py +88 -88
- zaber_motion/dto/requests/device_get_digital_io_request.py +88 -88
- zaber_motion/dto/requests/device_get_setting_request.py +100 -100
- zaber_motion/dto/requests/device_get_storage_request.py +93 -93
- zaber_motion/dto/requests/device_get_warnings_request.py +84 -84
- zaber_motion/dto/requests/device_get_warnings_response.py +51 -51
- zaber_motion/dto/requests/device_home_request.py +84 -84
- zaber_motion/dto/requests/device_identify_request.py +77 -77
- zaber_motion/dto/requests/device_move_request.py +177 -177
- zaber_motion/dto/requests/device_move_sin_request.py +140 -140
- zaber_motion/dto/requests/device_multi_get_setting_request.py +118 -118
- zaber_motion/dto/requests/device_on_all_request.py +56 -56
- zaber_motion/dto/requests/device_on_all_response.py +57 -57
- zaber_motion/dto/requests/device_restore_request.py +84 -84
- zaber_motion/dto/requests/device_set_all_analog_outputs_request.py +82 -82
- zaber_motion/dto/requests/device_set_all_analog_outputs_schedule_request.py +121 -121
- zaber_motion/dto/requests/device_set_all_digital_outputs_request.py +83 -83
- zaber_motion/dto/requests/device_set_all_digital_outputs_schedule_request.py +122 -122
- zaber_motion/dto/requests/device_set_analog_output_request.py +90 -90
- zaber_motion/dto/requests/device_set_analog_output_schedule_request.py +124 -124
- zaber_motion/dto/requests/device_set_digital_output_request.py +91 -91
- zaber_motion/dto/requests/device_set_digital_output_schedule_request.py +125 -125
- zaber_motion/dto/requests/device_set_lowpass_filter_request.py +102 -102
- zaber_motion/dto/requests/device_set_setting_bool_request.py +93 -93
- zaber_motion/dto/requests/device_set_setting_int_request.py +102 -102
- zaber_motion/dto/requests/device_set_setting_request.py +111 -111
- zaber_motion/dto/requests/device_set_setting_str_request.py +97 -97
- zaber_motion/dto/requests/device_set_storage_bool_request.py +93 -93
- zaber_motion/dto/requests/device_set_storage_number_request.py +99 -99
- zaber_motion/dto/requests/device_set_storage_request.py +102 -102
- zaber_motion/dto/requests/device_set_unit_conversions_request.py +108 -108
- zaber_motion/dto/requests/device_stop_request.py +84 -84
- zaber_motion/dto/requests/device_storage_list_keys_request.py +88 -88
- zaber_motion/dto/requests/device_storage_request.py +88 -88
- zaber_motion/dto/requests/device_type.py +8 -8
- zaber_motion/dto/requests/device_wait_until_idle_request.py +84 -84
- zaber_motion/dto/requests/disconnected_event.py +101 -101
- zaber_motion/dto/requests/double_array_response.py +54 -54
- zaber_motion/dto/requests/double_response.py +48 -48
- zaber_motion/dto/requests/driver_enable_request.py +90 -90
- zaber_motion/dto/requests/empty_autofocus_request.py +107 -107
- zaber_motion/dto/requests/empty_request.py +38 -38
- zaber_motion/dto/requests/errors.py +68 -68
- zaber_motion/dto/requests/find_device_request.py +65 -65
- zaber_motion/dto/requests/find_device_response.py +51 -51
- zaber_motion/dto/requests/forget_devices_request.py +71 -71
- zaber_motion/dto/requests/gateway_event.py +45 -45
- zaber_motion/dto/requests/gateway_request.py +45 -45
- zaber_motion/dto/requests/gateway_response.py +69 -69
- zaber_motion/dto/requests/generic_binary_request.py +107 -107
- zaber_motion/dto/requests/generic_command_request.py +107 -107
- zaber_motion/dto/requests/generic_command_response_collection.py +56 -56
- zaber_motion/dto/requests/get_all_io_port_labels_response.py +56 -56
- zaber_motion/dto/requests/get_axis_setting_results.py +56 -56
- zaber_motion/dto/requests/get_io_port_label_request.py +91 -91
- zaber_motion/dto/requests/get_setting_results.py +56 -56
- zaber_motion/dto/requests/get_simple_tuning_param_definition_response.py +56 -56
- zaber_motion/dto/requests/int_64_response.py +51 -51
- zaber_motion/dto/requests/int_array_response.py +57 -57
- zaber_motion/dto/requests/int_request.py +51 -51
- zaber_motion/dto/requests/int_response.py +51 -51
- zaber_motion/dto/requests/interface_empty_request.py +51 -51
- zaber_motion/dto/requests/interface_type.py +11 -11
- zaber_motion/dto/requests/load_paramset.py +102 -102
- zaber_motion/dto/requests/lockstep_disable_request.py +84 -84
- zaber_motion/dto/requests/lockstep_empty_request.py +79 -79
- zaber_motion/dto/requests/lockstep_enable_request.py +99 -99
- zaber_motion/dto/requests/lockstep_get_axis_numbers_response.py +57 -57
- zaber_motion/dto/requests/lockstep_get_request.py +91 -91
- zaber_motion/dto/requests/lockstep_home_request.py +84 -84
- zaber_motion/dto/requests/lockstep_move_request.py +163 -163
- zaber_motion/dto/requests/lockstep_move_sin_request.py +140 -140
- zaber_motion/dto/requests/lockstep_set_request.py +116 -116
- zaber_motion/dto/requests/lockstep_stop_request.py +84 -84
- zaber_motion/dto/requests/lockstep_wait_until_idle_request.py +84 -84
- zaber_motion/dto/requests/microscope_config_response.py +50 -50
- zaber_motion/dto/requests/microscope_empty_request.py +65 -65
- zaber_motion/dto/requests/microscope_find_request.py +63 -63
- zaber_motion/dto/requests/microscope_init_request.py +70 -70
- zaber_motion/dto/requests/microscope_trigger_camera_request.py +107 -107
- zaber_motion/dto/requests/objective_changer_change_request.py +119 -119
- zaber_motion/dto/requests/objective_changer_create_response.py +79 -79
- zaber_motion/dto/requests/objective_changer_get_current_response.py +51 -51
- zaber_motion/dto/requests/objective_changer_request.py +93 -93
- zaber_motion/dto/requests/objective_changer_set_request.py +116 -116
- zaber_motion/dto/requests/open_binary_interface_request.py +100 -100
- zaber_motion/dto/requests/open_interface_request.py +159 -159
- zaber_motion/dto/requests/open_interface_response.py +51 -51
- zaber_motion/dto/requests/oscilloscope_add_io_channel_request.py +91 -91
- zaber_motion/dto/requests/oscilloscope_add_setting_channel_request.py +88 -88
- zaber_motion/dto/requests/oscilloscope_data_get_request.py +63 -63
- zaber_motion/dto/requests/oscilloscope_data_get_sample_time_request.py +77 -77
- zaber_motion/dto/requests/oscilloscope_data_get_samples_response.py +54 -54
- zaber_motion/dto/requests/oscilloscope_data_identifier.py +51 -51
- zaber_motion/dto/requests/oscilloscope_read_response.py +57 -57
- zaber_motion/dto/requests/oscilloscope_request.py +65 -65
- zaber_motion/dto/requests/oscilloscope_start_request.py +79 -79
- zaber_motion/dto/requests/prepare_command_request.py +108 -108
- zaber_motion/dto/requests/process_on.py +107 -107
- zaber_motion/dto/requests/pvt_buffer_get_sequence_data_request.py +79 -79
- zaber_motion/dto/requests/pvt_csv_request.py +59 -59
- zaber_motion/dto/requests/pvt_generate_positions_request.py +74 -74
- zaber_motion/dto/requests/pvt_generate_velocities_and_times_request.py +96 -96
- zaber_motion/dto/requests/pvt_generate_velocities_request.py +93 -93
- zaber_motion/dto/requests/pvt_load_csv_request.py +45 -45
- zaber_motion/dto/requests/pvt_point_request.py +145 -145
- zaber_motion/dto/requests/pvt_points_request.py +147 -147
- zaber_motion/dto/requests/pvt_save_csv_request.py +74 -74
- zaber_motion/dto/requests/pvt_submit_sequence_data_request.py +93 -93
- zaber_motion/dto/requests/renumber_request.py +79 -79
- zaber_motion/dto/requests/response_type.py +8 -8
- zaber_motion/dto/requests/servo_tuning_paramset_response.py +48 -48
- zaber_motion/dto/requests/servo_tuning_request.py +91 -91
- zaber_motion/dto/requests/set_device_db_layered_sources_request.py +56 -56
- zaber_motion/dto/requests/set_device_db_source_request.py +63 -63
- zaber_motion/dto/requests/set_interface_checksum_enabled_request.py +56 -56
- zaber_motion/dto/requests/set_interface_timeout_request.py +65 -65
- zaber_motion/dto/requests/set_internal_mode_request.py +43 -43
- zaber_motion/dto/requests/set_io_port_label_request.py +100 -100
- zaber_motion/dto/requests/set_log_output_request.py +57 -57
- zaber_motion/dto/requests/set_process_controller_source.py +93 -93
- zaber_motion/dto/requests/set_servo_tuning_pid_request.py +135 -135
- zaber_motion/dto/requests/set_servo_tuning_request.py +116 -116
- zaber_motion/dto/requests/set_simple_tuning.py +174 -174
- zaber_motion/dto/requests/set_state_request.py +93 -93
- zaber_motion/dto/requests/stream_arc_request.py +199 -199
- zaber_motion/dto/requests/stream_buffer_erase_request.py +84 -84
- zaber_motion/dto/requests/stream_buffer_get_content_request.py +84 -84
- zaber_motion/dto/requests/stream_buffer_get_content_response.py +51 -51
- zaber_motion/dto/requests/stream_buffer_list.py +70 -70
- zaber_motion/dto/requests/stream_call_request.py +112 -112
- zaber_motion/dto/requests/stream_cancel_all_outputs_schedule_request.py +99 -99
- zaber_motion/dto/requests/stream_cancel_output_schedule_request.py +103 -103
- zaber_motion/dto/requests/stream_circle_request.py +155 -155
- zaber_motion/dto/requests/stream_empty_request.py +84 -84
- zaber_motion/dto/requests/stream_generic_command_batch_request.py +99 -99
- zaber_motion/dto/requests/stream_generic_command_request.py +93 -93
- zaber_motion/dto/requests/stream_get_axes_response.py +75 -75
- zaber_motion/dto/requests/stream_get_max_centripetal_acceleration_request.py +96 -96
- zaber_motion/dto/requests/stream_get_max_speed_request.py +96 -96
- zaber_motion/dto/requests/stream_get_max_tangential_acceleration_request.py +96 -96
- zaber_motion/dto/requests/stream_line_request.py +135 -135
- zaber_motion/dto/requests/stream_mode_response.py +60 -60
- zaber_motion/dto/requests/stream_segment_type.py +8 -8
- zaber_motion/dto/requests/stream_set_all_analog_outputs_request.py +101 -101
- zaber_motion/dto/requests/stream_set_all_analog_outputs_schedule_request.py +140 -140
- zaber_motion/dto/requests/stream_set_all_digital_outputs_request.py +102 -102
- zaber_motion/dto/requests/stream_set_all_digital_outputs_schedule_request.py +141 -141
- zaber_motion/dto/requests/stream_set_analog_output_request.py +109 -109
- zaber_motion/dto/requests/stream_set_analog_output_schedule_request.py +143 -143
- zaber_motion/dto/requests/stream_set_digital_output_request.py +110 -110
- zaber_motion/dto/requests/stream_set_digital_output_schedule_request.py +144 -144
- zaber_motion/dto/requests/stream_set_hold_request.py +89 -89
- zaber_motion/dto/requests/stream_set_max_centripetal_acceleration_request.py +107 -107
- zaber_motion/dto/requests/stream_set_max_speed_request.py +107 -107
- zaber_motion/dto/requests/stream_set_max_tangential_acceleration_request.py +107 -107
- zaber_motion/dto/requests/stream_setup_live_composite_request.py +123 -123
- zaber_motion/dto/requests/stream_setup_live_request.py +104 -104
- zaber_motion/dto/requests/stream_setup_store_arbitrary_axes_request.py +126 -126
- zaber_motion/dto/requests/stream_setup_store_composite_request.py +151 -151
- zaber_motion/dto/requests/stream_setup_store_request.py +132 -132
- zaber_motion/dto/requests/stream_wait_analog_input_request.py +118 -118
- zaber_motion/dto/requests/stream_wait_digital_input_request.py +103 -103
- zaber_motion/dto/requests/stream_wait_request.py +107 -107
- zaber_motion/dto/requests/stream_wait_until_idle_request.py +89 -89
- zaber_motion/dto/requests/string_array_response.py +51 -51
- zaber_motion/dto/requests/string_response.py +45 -45
- zaber_motion/dto/requests/test_event.py +45 -45
- zaber_motion/dto/requests/test_request.py +55 -55
- zaber_motion/dto/requests/test_request_complex.py +57 -0
- zaber_motion/dto/requests/test_response.py +45 -45
- zaber_motion/dto/requests/test_response_long.py +51 -51
- zaber_motion/dto/requests/toggle_device_db_store_request.py +50 -50
- zaber_motion/dto/requests/tools_list_serial_ports_response.py +51 -51
- zaber_motion/dto/requests/translator_create_from_device_request.py +97 -97
- zaber_motion/dto/requests/translator_create_live_request.py +91 -91
- zaber_motion/dto/requests/translator_create_request.py +62 -62
- zaber_motion/dto/requests/translator_create_response.py +51 -51
- zaber_motion/dto/requests/translator_empty_request.py +51 -51
- zaber_motion/dto/requests/translator_flush_live_request.py +56 -56
- zaber_motion/dto/requests/translator_flush_response.py +51 -51
- zaber_motion/dto/requests/translator_get_axis_offset_request.py +81 -81
- zaber_motion/dto/requests/translator_get_axis_position_request.py +72 -72
- zaber_motion/dto/requests/translator_set_axis_position_request.py +83 -83
- zaber_motion/dto/requests/translator_set_feed_rate_override_request.py +62 -62
- zaber_motion/dto/requests/translator_set_traverse_rate_request.py +74 -74
- zaber_motion/dto/requests/translator_translate_request.py +60 -60
- zaber_motion/dto/requests/trigger_clear_action_request.py +91 -91
- zaber_motion/dto/requests/trigger_empty_request.py +79 -79
- zaber_motion/dto/requests/trigger_enable_request.py +93 -93
- zaber_motion/dto/requests/trigger_enabled_states.py +56 -56
- zaber_motion/dto/requests/trigger_fire_at_interval_request.py +102 -102
- zaber_motion/dto/requests/trigger_fire_when_distance_travelled_request.py +116 -116
- zaber_motion/dto/requests/trigger_fire_when_io_request.py +128 -128
- zaber_motion/dto/requests/trigger_fire_when_request.py +88 -88
- zaber_motion/dto/requests/trigger_fire_when_setting_request.py +137 -137
- zaber_motion/dto/requests/trigger_on_fire_request.py +114 -114
- zaber_motion/dto/requests/trigger_on_fire_set_request.py +149 -149
- zaber_motion/dto/requests/trigger_on_fire_set_to_setting_request.py +149 -149
- zaber_motion/dto/requests/trigger_set_label_request.py +88 -88
- zaber_motion/dto/requests/trigger_states.py +56 -56
- zaber_motion/dto/requests/unit_convert_unit_request.py +71 -71
- zaber_motion/dto/requests/unit_get_enum_request.py +45 -45
- zaber_motion/dto/requests/unit_get_enum_response.py +48 -48
- zaber_motion/dto/requests/unit_get_symbol_request.py +48 -48
- zaber_motion/dto/requests/unit_get_symbol_response.py +45 -45
- zaber_motion/dto/requests/unknown_binary_response_event_wrapper.py +82 -82
- zaber_motion/dto/requests/unknown_response_event_wrapper.py +82 -82
- zaber_motion/dto/requests/wait_to_clear_warnings_request.py +105 -105
- zaber_motion/dto/requests/wait_to_respond_request.py +76 -76
- zaber_motion/dto/requests/wdi_generic_float_request.py +119 -0
- zaber_motion/dto/requests/wdi_generic_request.py +136 -136
- zaber_motion/dto/requests/wdi_get_status_response.py +50 -50
- zaber_motion/dto/rotation_direction.py +13 -13
- zaber_motion/dto_object.py +18 -18
- zaber_motion/events.py +112 -112
- zaber_motion/exceptions/__init__.py +87 -87
- zaber_motion/exceptions/bad_command_exception.py +10 -10
- zaber_motion/exceptions/bad_data_exception.py +10 -10
- zaber_motion/exceptions/binary_command_failed_exception.py +27 -27
- zaber_motion/exceptions/command_failed_exception.py +27 -27
- zaber_motion/exceptions/command_preempted_exception.py +10 -10
- zaber_motion/exceptions/command_too_long_exception.py +27 -27
- zaber_motion/exceptions/connection_closed_exception.py +10 -10
- zaber_motion/exceptions/connection_failed_exception.py +10 -10
- zaber_motion/exceptions/conversion_failed_exception.py +10 -10
- zaber_motion/exceptions/device_address_conflict_exception.py +27 -27
- zaber_motion/exceptions/device_busy_exception.py +10 -10
- zaber_motion/exceptions/device_db_failed_exception.py +27 -27
- zaber_motion/exceptions/device_detection_failed_exception.py +10 -10
- zaber_motion/exceptions/device_failed_exception.py +11 -11
- zaber_motion/exceptions/device_not_identified_exception.py +10 -10
- zaber_motion/exceptions/driver_disabled_exception.py +10 -10
- zaber_motion/exceptions/g_code_execution_exception.py +27 -27
- zaber_motion/exceptions/g_code_syntax_exception.py +27 -27
- zaber_motion/exceptions/incompatible_shared_library_exception.py +11 -11
- zaber_motion/exceptions/internal_error_exception.py +10 -10
- zaber_motion/exceptions/invalid_argument_exception.py +10 -10
- zaber_motion/exceptions/invalid_csv_data_exception.py +10 -10
- zaber_motion/exceptions/invalid_data_exception.py +10 -10
- zaber_motion/exceptions/invalid_operation_exception.py +10 -10
- zaber_motion/exceptions/invalid_packet_exception.py +27 -27
- zaber_motion/exceptions/invalid_park_state_exception.py +10 -10
- zaber_motion/exceptions/invalid_request_data_exception.py +11 -11
- zaber_motion/exceptions/invalid_response_exception.py +27 -27
- zaber_motion/exceptions/io_channel_out_of_range_exception.py +10 -10
- zaber_motion/exceptions/io_failed_exception.py +10 -10
- zaber_motion/exceptions/lockstep_enabled_exception.py +10 -10
- zaber_motion/exceptions/lockstep_not_enabled_exception.py +10 -10
- zaber_motion/exceptions/motion_lib_exception.py +18 -18
- zaber_motion/exceptions/movement_failed_exception.py +27 -27
- zaber_motion/exceptions/movement_interrupted_exception.py +27 -27
- zaber_motion/exceptions/no_device_found_exception.py +10 -10
- zaber_motion/exceptions/no_value_for_key_exception.py +10 -10
- zaber_motion/exceptions/not_supported_exception.py +10 -10
- zaber_motion/exceptions/operation_failed_exception.py +27 -27
- zaber_motion/exceptions/os_failed_exception.py +10 -10
- zaber_motion/exceptions/out_of_request_ids_exception.py +10 -10
- zaber_motion/exceptions/pvt_discontinuity_exception.py +10 -10
- zaber_motion/exceptions/pvt_execution_exception.py +27 -27
- zaber_motion/exceptions/pvt_mode_exception.py +10 -10
- zaber_motion/exceptions/pvt_movement_failed_exception.py +27 -27
- zaber_motion/exceptions/pvt_movement_interrupted_exception.py +27 -27
- zaber_motion/exceptions/pvt_sequence_generation_failed_exception.py +10 -10
- zaber_motion/exceptions/pvt_setup_failed_exception.py +10 -10
- zaber_motion/exceptions/remote_mode_exception.py +11 -11
- zaber_motion/exceptions/request_timeout_exception.py +10 -10
- zaber_motion/exceptions/serial_port_busy_exception.py +10 -10
- zaber_motion/exceptions/set_device_state_failed_exception.py +27 -27
- zaber_motion/exceptions/set_peripheral_state_failed_exception.py +27 -27
- zaber_motion/exceptions/setting_not_found_exception.py +10 -10
- zaber_motion/exceptions/stream_discontinuity_exception.py +10 -10
- zaber_motion/exceptions/stream_execution_exception.py +27 -27
- zaber_motion/exceptions/stream_mode_exception.py +10 -10
- zaber_motion/exceptions/stream_movement_failed_exception.py +27 -27
- zaber_motion/exceptions/stream_movement_interrupted_exception.py +27 -27
- zaber_motion/exceptions/stream_setup_failed_exception.py +10 -10
- zaber_motion/exceptions/timeout_exception.py +10 -10
- zaber_motion/exceptions/transport_already_used_exception.py +10 -10
- zaber_motion/exceptions/unknown_request_exception.py +10 -10
- zaber_motion/gcode/__init__.py +11 -11
- zaber_motion/gcode/offline_translator.py +401 -401
- zaber_motion/gcode/translator.py +424 -424
- zaber_motion/library.py +179 -179
- zaber_motion/microscopy/__init__.py +14 -14
- zaber_motion/microscopy/autofocus.py +645 -645
- zaber_motion/microscopy/camera_trigger.py +108 -108
- zaber_motion/microscopy/filter_changer.py +167 -167
- zaber_motion/microscopy/illuminator.py +139 -139
- zaber_motion/microscopy/illuminator_channel.py +616 -616
- zaber_motion/microscopy/microscope.py +315 -315
- zaber_motion/microscopy/objective_changer.py +403 -403
- zaber_motion/microscopy/wdi_autofocus_provider.py +536 -396
- zaber_motion/product/__init__.py +7 -7
- zaber_motion/product/process.py +818 -818
- zaber_motion/product/process_controller.py +134 -134
- zaber_motion/serialization.py +32 -32
- zaber_motion/tools.py +78 -78
- zaber_motion/unit_table.py +86 -86
- zaber_motion/units.py +206 -206
- zaber_motion/version.py +1 -1
- {zaber_motion-7.12.0.dist-info → zaber_motion-7.14.0.dist-info}/LICENSE.txt +2119 -2119
- {zaber_motion-7.12.0.dist-info → zaber_motion-7.14.0.dist-info}/METADATA +1 -1
- zaber_motion-7.14.0.dist-info/RECORD +496 -0
- zaber_motion_bindings/zaber-motion-core-windows-386.dll +0 -0
- zaber_motion-7.12.0.dist-info/RECORD +0 -494
- {zaber_motion-7.12.0.dist-info → zaber_motion-7.14.0.dist-info}/WHEEL +0 -0
- {zaber_motion-7.12.0.dist-info → zaber_motion-7.14.0.dist-info}/top_level.txt +0 -0
zaber_motion/ascii/device_io.py
CHANGED
|
@@ -1,1170 +1,1170 @@
|
|
|
1
|
-
# ===== THIS FILE IS GENERATED FROM A TEMPLATE ===== #
|
|
2
|
-
# ============== DO NOT EDIT DIRECTLY ============== #
|
|
3
|
-
|
|
4
|
-
from typing import TYPE_CHECKING, List, Optional
|
|
5
|
-
from ..call import call, call_async
|
|
6
|
-
from ..units import Units, TimeUnits, FrequencyUnits
|
|
7
|
-
from ..dto.ascii.device_io_info import DeviceIOInfo
|
|
8
|
-
from ..dto.ascii.digital_output_action import DigitalOutputAction
|
|
9
|
-
from ..dto.ascii.io_port_type import IoPortType
|
|
10
|
-
from ..dto.ascii.io_port_label import IoPortLabel
|
|
11
|
-
|
|
12
|
-
from ..dto import requests as dto
|
|
13
|
-
|
|
14
|
-
if TYPE_CHECKING:
|
|
15
|
-
from .device import Device
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class DeviceIO:
|
|
19
|
-
"""
|
|
20
|
-
Class providing access to the I/O channels of the device.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
def __init__(self, device: 'Device'):
|
|
24
|
-
self._device: 'Device' = device
|
|
25
|
-
|
|
26
|
-
def get_channels_info(
|
|
27
|
-
self
|
|
28
|
-
) -> DeviceIOInfo:
|
|
29
|
-
"""
|
|
30
|
-
Returns the number of I/O channels the device has.
|
|
31
|
-
|
|
32
|
-
Returns:
|
|
33
|
-
An object containing the number of I/O channels the device has.
|
|
34
|
-
"""
|
|
35
|
-
request = dto.DeviceEmptyRequest(
|
|
36
|
-
interface_id=self._device.connection.interface_id,
|
|
37
|
-
device=self._device.device_address,
|
|
38
|
-
)
|
|
39
|
-
response = call(
|
|
40
|
-
"device/get_io_info",
|
|
41
|
-
request,
|
|
42
|
-
DeviceIOInfo.from_binary)
|
|
43
|
-
return response
|
|
44
|
-
|
|
45
|
-
async def get_channels_info_async(
|
|
46
|
-
self
|
|
47
|
-
) -> DeviceIOInfo:
|
|
48
|
-
"""
|
|
49
|
-
Returns the number of I/O channels the device has.
|
|
50
|
-
|
|
51
|
-
Returns:
|
|
52
|
-
An object containing the number of I/O channels the device has.
|
|
53
|
-
"""
|
|
54
|
-
request = dto.DeviceEmptyRequest(
|
|
55
|
-
interface_id=self._device.connection.interface_id,
|
|
56
|
-
device=self._device.device_address,
|
|
57
|
-
)
|
|
58
|
-
response = await call_async(
|
|
59
|
-
"device/get_io_info",
|
|
60
|
-
request,
|
|
61
|
-
DeviceIOInfo.from_binary)
|
|
62
|
-
return response
|
|
63
|
-
|
|
64
|
-
def set_label(
|
|
65
|
-
self,
|
|
66
|
-
port_type: IoPortType,
|
|
67
|
-
channel_number: int,
|
|
68
|
-
label: Optional[str]
|
|
69
|
-
) -> None:
|
|
70
|
-
"""
|
|
71
|
-
Sets the label of the specified channel.
|
|
72
|
-
|
|
73
|
-
Args:
|
|
74
|
-
port_type: The type of channel to set the label of.
|
|
75
|
-
channel_number: Channel number starting at 1.
|
|
76
|
-
label: The label to set for the specified channel.
|
|
77
|
-
If no value or an empty string is provided, this label is deleted.
|
|
78
|
-
"""
|
|
79
|
-
request = dto.SetIoPortLabelRequest(
|
|
80
|
-
interface_id=self._device.connection.interface_id,
|
|
81
|
-
device=self._device.device_address,
|
|
82
|
-
port_type=port_type,
|
|
83
|
-
channel_number=channel_number,
|
|
84
|
-
label=label,
|
|
85
|
-
)
|
|
86
|
-
call("device/set_io_label", request)
|
|
87
|
-
|
|
88
|
-
async def set_label_async(
|
|
89
|
-
self,
|
|
90
|
-
port_type: IoPortType,
|
|
91
|
-
channel_number: int,
|
|
92
|
-
label: Optional[str]
|
|
93
|
-
) -> None:
|
|
94
|
-
"""
|
|
95
|
-
Sets the label of the specified channel.
|
|
96
|
-
|
|
97
|
-
Args:
|
|
98
|
-
port_type: The type of channel to set the label of.
|
|
99
|
-
channel_number: Channel number starting at 1.
|
|
100
|
-
label: The label to set for the specified channel.
|
|
101
|
-
If no value or an empty string is provided, this label is deleted.
|
|
102
|
-
"""
|
|
103
|
-
request = dto.SetIoPortLabelRequest(
|
|
104
|
-
interface_id=self._device.connection.interface_id,
|
|
105
|
-
device=self._device.device_address,
|
|
106
|
-
port_type=port_type,
|
|
107
|
-
channel_number=channel_number,
|
|
108
|
-
label=label,
|
|
109
|
-
)
|
|
110
|
-
await call_async("device/set_io_label", request)
|
|
111
|
-
|
|
112
|
-
def get_label(
|
|
113
|
-
self,
|
|
114
|
-
port_type: IoPortType,
|
|
115
|
-
channel_number: int
|
|
116
|
-
) -> str:
|
|
117
|
-
"""
|
|
118
|
-
Returns the label of the specified channel.
|
|
119
|
-
|
|
120
|
-
Args:
|
|
121
|
-
port_type: The type of channel to get the label of.
|
|
122
|
-
channel_number: Channel number starting at 1.
|
|
123
|
-
|
|
124
|
-
Returns:
|
|
125
|
-
The label of the specified channel.
|
|
126
|
-
"""
|
|
127
|
-
request = dto.GetIoPortLabelRequest(
|
|
128
|
-
interface_id=self._device.connection.interface_id,
|
|
129
|
-
device=self._device.device_address,
|
|
130
|
-
port_type=port_type,
|
|
131
|
-
channel_number=channel_number,
|
|
132
|
-
)
|
|
133
|
-
response = call(
|
|
134
|
-
"device/get_io_label",
|
|
135
|
-
request,
|
|
136
|
-
dto.StringResponse.from_binary)
|
|
137
|
-
return response.value
|
|
138
|
-
|
|
139
|
-
async def get_label_async(
|
|
140
|
-
self,
|
|
141
|
-
port_type: IoPortType,
|
|
142
|
-
channel_number: int
|
|
143
|
-
) -> str:
|
|
144
|
-
"""
|
|
145
|
-
Returns the label of the specified channel.
|
|
146
|
-
|
|
147
|
-
Args:
|
|
148
|
-
port_type: The type of channel to get the label of.
|
|
149
|
-
channel_number: Channel number starting at 1.
|
|
150
|
-
|
|
151
|
-
Returns:
|
|
152
|
-
The label of the specified channel.
|
|
153
|
-
"""
|
|
154
|
-
request = dto.GetIoPortLabelRequest(
|
|
155
|
-
interface_id=self._device.connection.interface_id,
|
|
156
|
-
device=self._device.device_address,
|
|
157
|
-
port_type=port_type,
|
|
158
|
-
channel_number=channel_number,
|
|
159
|
-
)
|
|
160
|
-
response = await call_async(
|
|
161
|
-
"device/get_io_label",
|
|
162
|
-
request,
|
|
163
|
-
dto.StringResponse.from_binary)
|
|
164
|
-
return response.value
|
|
165
|
-
|
|
166
|
-
def get_all_labels(
|
|
167
|
-
self
|
|
168
|
-
) -> List[IoPortLabel]:
|
|
169
|
-
"""
|
|
170
|
-
Returns every label assigned to an IO port on this device.
|
|
171
|
-
|
|
172
|
-
Returns:
|
|
173
|
-
The labels set for this device's IO.
|
|
174
|
-
"""
|
|
175
|
-
request = dto.DeviceEmptyRequest(
|
|
176
|
-
interface_id=self._device.connection.interface_id,
|
|
177
|
-
device=self._device.device_address,
|
|
178
|
-
)
|
|
179
|
-
response = call(
|
|
180
|
-
"device/get_all_io_labels",
|
|
181
|
-
request,
|
|
182
|
-
dto.GetAllIoPortLabelsResponse.from_binary)
|
|
183
|
-
return response.labels
|
|
184
|
-
|
|
185
|
-
async def get_all_labels_async(
|
|
186
|
-
self
|
|
187
|
-
) -> List[IoPortLabel]:
|
|
188
|
-
"""
|
|
189
|
-
Returns every label assigned to an IO port on this device.
|
|
190
|
-
|
|
191
|
-
Returns:
|
|
192
|
-
The labels set for this device's IO.
|
|
193
|
-
"""
|
|
194
|
-
request = dto.DeviceEmptyRequest(
|
|
195
|
-
interface_id=self._device.connection.interface_id,
|
|
196
|
-
device=self._device.device_address,
|
|
197
|
-
)
|
|
198
|
-
response = await call_async(
|
|
199
|
-
"device/get_all_io_labels",
|
|
200
|
-
request,
|
|
201
|
-
dto.GetAllIoPortLabelsResponse.from_binary)
|
|
202
|
-
return response.labels
|
|
203
|
-
|
|
204
|
-
def get_digital_input(
|
|
205
|
-
self,
|
|
206
|
-
channel_number: int
|
|
207
|
-
) -> bool:
|
|
208
|
-
"""
|
|
209
|
-
Returns the current value of the specified digital input channel.
|
|
210
|
-
|
|
211
|
-
Args:
|
|
212
|
-
channel_number: Channel number starting at 1.
|
|
213
|
-
|
|
214
|
-
Returns:
|
|
215
|
-
True if voltage is present on the input channel and false otherwise.
|
|
216
|
-
"""
|
|
217
|
-
request = dto.DeviceGetDigitalIORequest(
|
|
218
|
-
interface_id=self._device.connection.interface_id,
|
|
219
|
-
device=self._device.device_address,
|
|
220
|
-
channel_type="di",
|
|
221
|
-
channel_number=channel_number,
|
|
222
|
-
)
|
|
223
|
-
response = call(
|
|
224
|
-
"device/get_digital_io",
|
|
225
|
-
request,
|
|
226
|
-
dto.BoolResponse.from_binary)
|
|
227
|
-
return response.value
|
|
228
|
-
|
|
229
|
-
async def get_digital_input_async(
|
|
230
|
-
self,
|
|
231
|
-
channel_number: int
|
|
232
|
-
) -> bool:
|
|
233
|
-
"""
|
|
234
|
-
Returns the current value of the specified digital input channel.
|
|
235
|
-
|
|
236
|
-
Args:
|
|
237
|
-
channel_number: Channel number starting at 1.
|
|
238
|
-
|
|
239
|
-
Returns:
|
|
240
|
-
True if voltage is present on the input channel and false otherwise.
|
|
241
|
-
"""
|
|
242
|
-
request = dto.DeviceGetDigitalIORequest(
|
|
243
|
-
interface_id=self._device.connection.interface_id,
|
|
244
|
-
device=self._device.device_address,
|
|
245
|
-
channel_type="di",
|
|
246
|
-
channel_number=channel_number,
|
|
247
|
-
)
|
|
248
|
-
response = await call_async(
|
|
249
|
-
"device/get_digital_io",
|
|
250
|
-
request,
|
|
251
|
-
dto.BoolResponse.from_binary)
|
|
252
|
-
return response.value
|
|
253
|
-
|
|
254
|
-
def get_digital_output(
|
|
255
|
-
self,
|
|
256
|
-
channel_number: int
|
|
257
|
-
) -> bool:
|
|
258
|
-
"""
|
|
259
|
-
Returns the current value of the specified digital output channel.
|
|
260
|
-
|
|
261
|
-
Args:
|
|
262
|
-
channel_number: Channel number starting at 1.
|
|
263
|
-
|
|
264
|
-
Returns:
|
|
265
|
-
True if the output channel is conducting and false otherwise.
|
|
266
|
-
"""
|
|
267
|
-
request = dto.DeviceGetDigitalIORequest(
|
|
268
|
-
interface_id=self._device.connection.interface_id,
|
|
269
|
-
device=self._device.device_address,
|
|
270
|
-
channel_type="do",
|
|
271
|
-
channel_number=channel_number,
|
|
272
|
-
)
|
|
273
|
-
response = call(
|
|
274
|
-
"device/get_digital_io",
|
|
275
|
-
request,
|
|
276
|
-
dto.BoolResponse.from_binary)
|
|
277
|
-
return response.value
|
|
278
|
-
|
|
279
|
-
async def get_digital_output_async(
|
|
280
|
-
self,
|
|
281
|
-
channel_number: int
|
|
282
|
-
) -> bool:
|
|
283
|
-
"""
|
|
284
|
-
Returns the current value of the specified digital output channel.
|
|
285
|
-
|
|
286
|
-
Args:
|
|
287
|
-
channel_number: Channel number starting at 1.
|
|
288
|
-
|
|
289
|
-
Returns:
|
|
290
|
-
True if the output channel is conducting and false otherwise.
|
|
291
|
-
"""
|
|
292
|
-
request = dto.DeviceGetDigitalIORequest(
|
|
293
|
-
interface_id=self._device.connection.interface_id,
|
|
294
|
-
device=self._device.device_address,
|
|
295
|
-
channel_type="do",
|
|
296
|
-
channel_number=channel_number,
|
|
297
|
-
)
|
|
298
|
-
response = await call_async(
|
|
299
|
-
"device/get_digital_io",
|
|
300
|
-
request,
|
|
301
|
-
dto.BoolResponse.from_binary)
|
|
302
|
-
return response.value
|
|
303
|
-
|
|
304
|
-
def get_analog_input(
|
|
305
|
-
self,
|
|
306
|
-
channel_number: int
|
|
307
|
-
) -> float:
|
|
308
|
-
"""
|
|
309
|
-
Returns the current value of the specified analog input channel.
|
|
310
|
-
|
|
311
|
-
Args:
|
|
312
|
-
channel_number: Channel number starting at 1.
|
|
313
|
-
|
|
314
|
-
Returns:
|
|
315
|
-
A measurement of the voltage present on the input channel.
|
|
316
|
-
"""
|
|
317
|
-
request = dto.DeviceGetAnalogIORequest(
|
|
318
|
-
interface_id=self._device.connection.interface_id,
|
|
319
|
-
device=self._device.device_address,
|
|
320
|
-
channel_type="ai",
|
|
321
|
-
channel_number=channel_number,
|
|
322
|
-
)
|
|
323
|
-
response = call(
|
|
324
|
-
"device/get_analog_io",
|
|
325
|
-
request,
|
|
326
|
-
dto.DoubleResponse.from_binary)
|
|
327
|
-
return response.value
|
|
328
|
-
|
|
329
|
-
async def get_analog_input_async(
|
|
330
|
-
self,
|
|
331
|
-
channel_number: int
|
|
332
|
-
) -> float:
|
|
333
|
-
"""
|
|
334
|
-
Returns the current value of the specified analog input channel.
|
|
335
|
-
|
|
336
|
-
Args:
|
|
337
|
-
channel_number: Channel number starting at 1.
|
|
338
|
-
|
|
339
|
-
Returns:
|
|
340
|
-
A measurement of the voltage present on the input channel.
|
|
341
|
-
"""
|
|
342
|
-
request = dto.DeviceGetAnalogIORequest(
|
|
343
|
-
interface_id=self._device.connection.interface_id,
|
|
344
|
-
device=self._device.device_address,
|
|
345
|
-
channel_type="ai",
|
|
346
|
-
channel_number=channel_number,
|
|
347
|
-
)
|
|
348
|
-
response = await call_async(
|
|
349
|
-
"device/get_analog_io",
|
|
350
|
-
request,
|
|
351
|
-
dto.DoubleResponse.from_binary)
|
|
352
|
-
return response.value
|
|
353
|
-
|
|
354
|
-
def get_analog_output(
|
|
355
|
-
self,
|
|
356
|
-
channel_number: int
|
|
357
|
-
) -> float:
|
|
358
|
-
"""
|
|
359
|
-
Returns the current values of the specified analog output channel.
|
|
360
|
-
|
|
361
|
-
Args:
|
|
362
|
-
channel_number: Channel number starting at 1.
|
|
363
|
-
|
|
364
|
-
Returns:
|
|
365
|
-
A measurement of voltage that the output channel is conducting.
|
|
366
|
-
"""
|
|
367
|
-
request = dto.DeviceGetAnalogIORequest(
|
|
368
|
-
interface_id=self._device.connection.interface_id,
|
|
369
|
-
device=self._device.device_address,
|
|
370
|
-
channel_type="ao",
|
|
371
|
-
channel_number=channel_number,
|
|
372
|
-
)
|
|
373
|
-
response = call(
|
|
374
|
-
"device/get_analog_io",
|
|
375
|
-
request,
|
|
376
|
-
dto.DoubleResponse.from_binary)
|
|
377
|
-
return response.value
|
|
378
|
-
|
|
379
|
-
async def get_analog_output_async(
|
|
380
|
-
self,
|
|
381
|
-
channel_number: int
|
|
382
|
-
) -> float:
|
|
383
|
-
"""
|
|
384
|
-
Returns the current values of the specified analog output channel.
|
|
385
|
-
|
|
386
|
-
Args:
|
|
387
|
-
channel_number: Channel number starting at 1.
|
|
388
|
-
|
|
389
|
-
Returns:
|
|
390
|
-
A measurement of voltage that the output channel is conducting.
|
|
391
|
-
"""
|
|
392
|
-
request = dto.DeviceGetAnalogIORequest(
|
|
393
|
-
interface_id=self._device.connection.interface_id,
|
|
394
|
-
device=self._device.device_address,
|
|
395
|
-
channel_type="ao",
|
|
396
|
-
channel_number=channel_number,
|
|
397
|
-
)
|
|
398
|
-
response = await call_async(
|
|
399
|
-
"device/get_analog_io",
|
|
400
|
-
request,
|
|
401
|
-
dto.DoubleResponse.from_binary)
|
|
402
|
-
return response.value
|
|
403
|
-
|
|
404
|
-
def get_all_digital_inputs(
|
|
405
|
-
self
|
|
406
|
-
) -> List[bool]:
|
|
407
|
-
"""
|
|
408
|
-
Returns the current values of all digital input channels.
|
|
409
|
-
|
|
410
|
-
Returns:
|
|
411
|
-
True if voltage is present on the input channel and false otherwise.
|
|
412
|
-
"""
|
|
413
|
-
request = dto.DeviceGetAllDigitalIORequest(
|
|
414
|
-
interface_id=self._device.connection.interface_id,
|
|
415
|
-
device=self._device.device_address,
|
|
416
|
-
channel_type="di",
|
|
417
|
-
)
|
|
418
|
-
response = call(
|
|
419
|
-
"device/get_all_digital_io",
|
|
420
|
-
request,
|
|
421
|
-
dto.DeviceGetAllDigitalIOResponse.from_binary)
|
|
422
|
-
return response.values
|
|
423
|
-
|
|
424
|
-
async def get_all_digital_inputs_async(
|
|
425
|
-
self
|
|
426
|
-
) -> List[bool]:
|
|
427
|
-
"""
|
|
428
|
-
Returns the current values of all digital input channels.
|
|
429
|
-
|
|
430
|
-
Returns:
|
|
431
|
-
True if voltage is present on the input channel and false otherwise.
|
|
432
|
-
"""
|
|
433
|
-
request = dto.DeviceGetAllDigitalIORequest(
|
|
434
|
-
interface_id=self._device.connection.interface_id,
|
|
435
|
-
device=self._device.device_address,
|
|
436
|
-
channel_type="di",
|
|
437
|
-
)
|
|
438
|
-
response = await call_async(
|
|
439
|
-
"device/get_all_digital_io",
|
|
440
|
-
request,
|
|
441
|
-
dto.DeviceGetAllDigitalIOResponse.from_binary)
|
|
442
|
-
return response.values
|
|
443
|
-
|
|
444
|
-
def get_all_digital_outputs(
|
|
445
|
-
self
|
|
446
|
-
) -> List[bool]:
|
|
447
|
-
"""
|
|
448
|
-
Returns the current values of all digital output channels.
|
|
449
|
-
|
|
450
|
-
Returns:
|
|
451
|
-
True if the output channel is conducting and false otherwise.
|
|
452
|
-
"""
|
|
453
|
-
request = dto.DeviceGetAllDigitalIORequest(
|
|
454
|
-
interface_id=self._device.connection.interface_id,
|
|
455
|
-
device=self._device.device_address,
|
|
456
|
-
channel_type="do",
|
|
457
|
-
)
|
|
458
|
-
response = call(
|
|
459
|
-
"device/get_all_digital_io",
|
|
460
|
-
request,
|
|
461
|
-
dto.DeviceGetAllDigitalIOResponse.from_binary)
|
|
462
|
-
return response.values
|
|
463
|
-
|
|
464
|
-
async def get_all_digital_outputs_async(
|
|
465
|
-
self
|
|
466
|
-
) -> List[bool]:
|
|
467
|
-
"""
|
|
468
|
-
Returns the current values of all digital output channels.
|
|
469
|
-
|
|
470
|
-
Returns:
|
|
471
|
-
True if the output channel is conducting and false otherwise.
|
|
472
|
-
"""
|
|
473
|
-
request = dto.DeviceGetAllDigitalIORequest(
|
|
474
|
-
interface_id=self._device.connection.interface_id,
|
|
475
|
-
device=self._device.device_address,
|
|
476
|
-
channel_type="do",
|
|
477
|
-
)
|
|
478
|
-
response = await call_async(
|
|
479
|
-
"device/get_all_digital_io",
|
|
480
|
-
request,
|
|
481
|
-
dto.DeviceGetAllDigitalIOResponse.from_binary)
|
|
482
|
-
return response.values
|
|
483
|
-
|
|
484
|
-
def get_all_analog_inputs(
|
|
485
|
-
self
|
|
486
|
-
) -> List[float]:
|
|
487
|
-
"""
|
|
488
|
-
Returns the current values of all analog input channels.
|
|
489
|
-
|
|
490
|
-
Returns:
|
|
491
|
-
Measurements of the voltages present on the input channels.
|
|
492
|
-
"""
|
|
493
|
-
request = dto.DeviceGetAllAnalogIORequest(
|
|
494
|
-
interface_id=self._device.connection.interface_id,
|
|
495
|
-
device=self._device.device_address,
|
|
496
|
-
channel_type="ai",
|
|
497
|
-
)
|
|
498
|
-
response = call(
|
|
499
|
-
"device/get_all_analog_io",
|
|
500
|
-
request,
|
|
501
|
-
dto.DeviceGetAllAnalogIOResponse.from_binary)
|
|
502
|
-
return response.values
|
|
503
|
-
|
|
504
|
-
async def get_all_analog_inputs_async(
|
|
505
|
-
self
|
|
506
|
-
) -> List[float]:
|
|
507
|
-
"""
|
|
508
|
-
Returns the current values of all analog input channels.
|
|
509
|
-
|
|
510
|
-
Returns:
|
|
511
|
-
Measurements of the voltages present on the input channels.
|
|
512
|
-
"""
|
|
513
|
-
request = dto.DeviceGetAllAnalogIORequest(
|
|
514
|
-
interface_id=self._device.connection.interface_id,
|
|
515
|
-
device=self._device.device_address,
|
|
516
|
-
channel_type="ai",
|
|
517
|
-
)
|
|
518
|
-
response = await call_async(
|
|
519
|
-
"device/get_all_analog_io",
|
|
520
|
-
request,
|
|
521
|
-
dto.DeviceGetAllAnalogIOResponse.from_binary)
|
|
522
|
-
return response.values
|
|
523
|
-
|
|
524
|
-
def get_all_analog_outputs(
|
|
525
|
-
self
|
|
526
|
-
) -> List[float]:
|
|
527
|
-
"""
|
|
528
|
-
Returns the current values of all analog output channels.
|
|
529
|
-
|
|
530
|
-
Returns:
|
|
531
|
-
Measurements of voltage that the output channels are conducting.
|
|
532
|
-
"""
|
|
533
|
-
request = dto.DeviceGetAllAnalogIORequest(
|
|
534
|
-
interface_id=self._device.connection.interface_id,
|
|
535
|
-
device=self._device.device_address,
|
|
536
|
-
channel_type="ao",
|
|
537
|
-
)
|
|
538
|
-
response = call(
|
|
539
|
-
"device/get_all_analog_io",
|
|
540
|
-
request,
|
|
541
|
-
dto.DeviceGetAllAnalogIOResponse.from_binary)
|
|
542
|
-
return response.values
|
|
543
|
-
|
|
544
|
-
async def get_all_analog_outputs_async(
|
|
545
|
-
self
|
|
546
|
-
) -> List[float]:
|
|
547
|
-
"""
|
|
548
|
-
Returns the current values of all analog output channels.
|
|
549
|
-
|
|
550
|
-
Returns:
|
|
551
|
-
Measurements of voltage that the output channels are conducting.
|
|
552
|
-
"""
|
|
553
|
-
request = dto.DeviceGetAllAnalogIORequest(
|
|
554
|
-
interface_id=self._device.connection.interface_id,
|
|
555
|
-
device=self._device.device_address,
|
|
556
|
-
channel_type="ao",
|
|
557
|
-
)
|
|
558
|
-
response = await call_async(
|
|
559
|
-
"device/get_all_analog_io",
|
|
560
|
-
request,
|
|
561
|
-
dto.DeviceGetAllAnalogIOResponse.from_binary)
|
|
562
|
-
return response.values
|
|
563
|
-
|
|
564
|
-
def set_digital_output(
|
|
565
|
-
self,
|
|
566
|
-
channel_number: int,
|
|
567
|
-
value: DigitalOutputAction
|
|
568
|
-
) -> None:
|
|
569
|
-
"""
|
|
570
|
-
Sets value for the specified digital output channel.
|
|
571
|
-
|
|
572
|
-
Args:
|
|
573
|
-
channel_number: Channel number starting at 1.
|
|
574
|
-
value: The type of action to perform on the channel.
|
|
575
|
-
"""
|
|
576
|
-
request = dto.DeviceSetDigitalOutputRequest(
|
|
577
|
-
interface_id=self._device.connection.interface_id,
|
|
578
|
-
device=self._device.device_address,
|
|
579
|
-
channel_number=channel_number,
|
|
580
|
-
value=value,
|
|
581
|
-
)
|
|
582
|
-
call("device/set_digital_output", request)
|
|
583
|
-
|
|
584
|
-
async def set_digital_output_async(
|
|
585
|
-
self,
|
|
586
|
-
channel_number: int,
|
|
587
|
-
value: DigitalOutputAction
|
|
588
|
-
) -> None:
|
|
589
|
-
"""
|
|
590
|
-
Sets value for the specified digital output channel.
|
|
591
|
-
|
|
592
|
-
Args:
|
|
593
|
-
channel_number: Channel number starting at 1.
|
|
594
|
-
value: The type of action to perform on the channel.
|
|
595
|
-
"""
|
|
596
|
-
request = dto.DeviceSetDigitalOutputRequest(
|
|
597
|
-
interface_id=self._device.connection.interface_id,
|
|
598
|
-
device=self._device.device_address,
|
|
599
|
-
channel_number=channel_number,
|
|
600
|
-
value=value,
|
|
601
|
-
)
|
|
602
|
-
await call_async("device/set_digital_output", request)
|
|
603
|
-
|
|
604
|
-
def set_all_digital_outputs(
|
|
605
|
-
self,
|
|
606
|
-
values: List[DigitalOutputAction]
|
|
607
|
-
) -> None:
|
|
608
|
-
"""
|
|
609
|
-
Sets values for all digital output channels.
|
|
610
|
-
|
|
611
|
-
Args:
|
|
612
|
-
values: The type of action to perform on the channel.
|
|
613
|
-
"""
|
|
614
|
-
request = dto.DeviceSetAllDigitalOutputsRequest(
|
|
615
|
-
interface_id=self._device.connection.interface_id,
|
|
616
|
-
device=self._device.device_address,
|
|
617
|
-
values=values,
|
|
618
|
-
)
|
|
619
|
-
call("device/set_all_digital_outputs", request)
|
|
620
|
-
|
|
621
|
-
async def set_all_digital_outputs_async(
|
|
622
|
-
self,
|
|
623
|
-
values: List[DigitalOutputAction]
|
|
624
|
-
) -> None:
|
|
625
|
-
"""
|
|
626
|
-
Sets values for all digital output channels.
|
|
627
|
-
|
|
628
|
-
Args:
|
|
629
|
-
values: The type of action to perform on the channel.
|
|
630
|
-
"""
|
|
631
|
-
request = dto.DeviceSetAllDigitalOutputsRequest(
|
|
632
|
-
interface_id=self._device.connection.interface_id,
|
|
633
|
-
device=self._device.device_address,
|
|
634
|
-
values=values,
|
|
635
|
-
)
|
|
636
|
-
await call_async("device/set_all_digital_outputs", request)
|
|
637
|
-
|
|
638
|
-
def set_digital_output_schedule(
|
|
639
|
-
self,
|
|
640
|
-
channel_number: int,
|
|
641
|
-
value: DigitalOutputAction,
|
|
642
|
-
future_value: DigitalOutputAction,
|
|
643
|
-
delay: float,
|
|
644
|
-
unit: TimeUnits = Units.NATIVE
|
|
645
|
-
) -> None:
|
|
646
|
-
"""
|
|
647
|
-
Sets current and future value for the specified digital output channel.
|
|
648
|
-
Requires at least Firmware 7.37.
|
|
649
|
-
|
|
650
|
-
Args:
|
|
651
|
-
channel_number: Channel number starting at 1.
|
|
652
|
-
value: The type of action to perform immediately on the channel.
|
|
653
|
-
future_value: The type of action to perform in the future on the channel.
|
|
654
|
-
delay: Delay between setting current value and setting future value.
|
|
655
|
-
unit: Units of time.
|
|
656
|
-
"""
|
|
657
|
-
if delay <= 0:
|
|
658
|
-
raise ValueError('Delay must be a positive value.')
|
|
659
|
-
|
|
660
|
-
request = dto.DeviceSetDigitalOutputScheduleRequest(
|
|
661
|
-
interface_id=self._device.connection.interface_id,
|
|
662
|
-
device=self._device.device_address,
|
|
663
|
-
channel_number=channel_number,
|
|
664
|
-
value=value,
|
|
665
|
-
future_value=future_value,
|
|
666
|
-
delay=delay,
|
|
667
|
-
unit=unit,
|
|
668
|
-
)
|
|
669
|
-
call("device/set_digital_output_schedule", request)
|
|
670
|
-
|
|
671
|
-
async def set_digital_output_schedule_async(
|
|
672
|
-
self,
|
|
673
|
-
channel_number: int,
|
|
674
|
-
value: DigitalOutputAction,
|
|
675
|
-
future_value: DigitalOutputAction,
|
|
676
|
-
delay: float,
|
|
677
|
-
unit: TimeUnits = Units.NATIVE
|
|
678
|
-
) -> None:
|
|
679
|
-
"""
|
|
680
|
-
Sets current and future value for the specified digital output channel.
|
|
681
|
-
Requires at least Firmware 7.37.
|
|
682
|
-
|
|
683
|
-
Args:
|
|
684
|
-
channel_number: Channel number starting at 1.
|
|
685
|
-
value: The type of action to perform immediately on the channel.
|
|
686
|
-
future_value: The type of action to perform in the future on the channel.
|
|
687
|
-
delay: Delay between setting current value and setting future value.
|
|
688
|
-
unit: Units of time.
|
|
689
|
-
"""
|
|
690
|
-
if delay <= 0:
|
|
691
|
-
raise ValueError('Delay must be a positive value.')
|
|
692
|
-
|
|
693
|
-
request = dto.DeviceSetDigitalOutputScheduleRequest(
|
|
694
|
-
interface_id=self._device.connection.interface_id,
|
|
695
|
-
device=self._device.device_address,
|
|
696
|
-
channel_number=channel_number,
|
|
697
|
-
value=value,
|
|
698
|
-
future_value=future_value,
|
|
699
|
-
delay=delay,
|
|
700
|
-
unit=unit,
|
|
701
|
-
)
|
|
702
|
-
await call_async("device/set_digital_output_schedule", request)
|
|
703
|
-
|
|
704
|
-
def set_all_digital_outputs_schedule(
|
|
705
|
-
self,
|
|
706
|
-
values: List[DigitalOutputAction],
|
|
707
|
-
future_values: List[DigitalOutputAction],
|
|
708
|
-
delay: float,
|
|
709
|
-
unit: TimeUnits = Units.NATIVE
|
|
710
|
-
) -> None:
|
|
711
|
-
"""
|
|
712
|
-
Sets current and future values for all digital output channels.
|
|
713
|
-
Requires at least Firmware 7.37.
|
|
714
|
-
|
|
715
|
-
Args:
|
|
716
|
-
values: The type of actions to perform immediately on output channels.
|
|
717
|
-
future_values: The type of actions to perform in the future on output channels.
|
|
718
|
-
delay: Delay between setting current values and setting future values.
|
|
719
|
-
unit: Units of time.
|
|
720
|
-
"""
|
|
721
|
-
if delay <= 0:
|
|
722
|
-
raise ValueError('Delay must be a positive value.')
|
|
723
|
-
|
|
724
|
-
request = dto.DeviceSetAllDigitalOutputsScheduleRequest(
|
|
725
|
-
interface_id=self._device.connection.interface_id,
|
|
726
|
-
device=self._device.device_address,
|
|
727
|
-
values=values,
|
|
728
|
-
future_values=future_values,
|
|
729
|
-
delay=delay,
|
|
730
|
-
unit=unit,
|
|
731
|
-
)
|
|
732
|
-
call("device/set_all_digital_outputs_schedule", request)
|
|
733
|
-
|
|
734
|
-
async def set_all_digital_outputs_schedule_async(
|
|
735
|
-
self,
|
|
736
|
-
values: List[DigitalOutputAction],
|
|
737
|
-
future_values: List[DigitalOutputAction],
|
|
738
|
-
delay: float,
|
|
739
|
-
unit: TimeUnits = Units.NATIVE
|
|
740
|
-
) -> None:
|
|
741
|
-
"""
|
|
742
|
-
Sets current and future values for all digital output channels.
|
|
743
|
-
Requires at least Firmware 7.37.
|
|
744
|
-
|
|
745
|
-
Args:
|
|
746
|
-
values: The type of actions to perform immediately on output channels.
|
|
747
|
-
future_values: The type of actions to perform in the future on output channels.
|
|
748
|
-
delay: Delay between setting current values and setting future values.
|
|
749
|
-
unit: Units of time.
|
|
750
|
-
"""
|
|
751
|
-
if delay <= 0:
|
|
752
|
-
raise ValueError('Delay must be a positive value.')
|
|
753
|
-
|
|
754
|
-
request = dto.DeviceSetAllDigitalOutputsScheduleRequest(
|
|
755
|
-
interface_id=self._device.connection.interface_id,
|
|
756
|
-
device=self._device.device_address,
|
|
757
|
-
values=values,
|
|
758
|
-
future_values=future_values,
|
|
759
|
-
delay=delay,
|
|
760
|
-
unit=unit,
|
|
761
|
-
)
|
|
762
|
-
await call_async("device/set_all_digital_outputs_schedule", request)
|
|
763
|
-
|
|
764
|
-
def set_analog_output(
|
|
765
|
-
self,
|
|
766
|
-
channel_number: int,
|
|
767
|
-
value: float
|
|
768
|
-
) -> None:
|
|
769
|
-
"""
|
|
770
|
-
Sets value for the specified analog output channel.
|
|
771
|
-
|
|
772
|
-
Args:
|
|
773
|
-
channel_number: Channel number starting at 1.
|
|
774
|
-
value: Value to set the output channel voltage to.
|
|
775
|
-
"""
|
|
776
|
-
request = dto.DeviceSetAnalogOutputRequest(
|
|
777
|
-
interface_id=self._device.connection.interface_id,
|
|
778
|
-
device=self._device.device_address,
|
|
779
|
-
channel_number=channel_number,
|
|
780
|
-
value=value,
|
|
781
|
-
)
|
|
782
|
-
call("device/set_analog_output", request)
|
|
783
|
-
|
|
784
|
-
async def set_analog_output_async(
|
|
785
|
-
self,
|
|
786
|
-
channel_number: int,
|
|
787
|
-
value: float
|
|
788
|
-
) -> None:
|
|
789
|
-
"""
|
|
790
|
-
Sets value for the specified analog output channel.
|
|
791
|
-
|
|
792
|
-
Args:
|
|
793
|
-
channel_number: Channel number starting at 1.
|
|
794
|
-
value: Value to set the output channel voltage to.
|
|
795
|
-
"""
|
|
796
|
-
request = dto.DeviceSetAnalogOutputRequest(
|
|
797
|
-
interface_id=self._device.connection.interface_id,
|
|
798
|
-
device=self._device.device_address,
|
|
799
|
-
channel_number=channel_number,
|
|
800
|
-
value=value,
|
|
801
|
-
)
|
|
802
|
-
await call_async("device/set_analog_output", request)
|
|
803
|
-
|
|
804
|
-
def set_all_analog_outputs(
|
|
805
|
-
self,
|
|
806
|
-
values: List[float]
|
|
807
|
-
) -> None:
|
|
808
|
-
"""
|
|
809
|
-
Sets values for all analog output channels.
|
|
810
|
-
|
|
811
|
-
Args:
|
|
812
|
-
values: Voltage values to set the output channels to.
|
|
813
|
-
"""
|
|
814
|
-
request = dto.DeviceSetAllAnalogOutputsRequest(
|
|
815
|
-
interface_id=self._device.connection.interface_id,
|
|
816
|
-
device=self._device.device_address,
|
|
817
|
-
values=values,
|
|
818
|
-
)
|
|
819
|
-
call("device/set_all_analog_outputs", request)
|
|
820
|
-
|
|
821
|
-
async def set_all_analog_outputs_async(
|
|
822
|
-
self,
|
|
823
|
-
values: List[float]
|
|
824
|
-
) -> None:
|
|
825
|
-
"""
|
|
826
|
-
Sets values for all analog output channels.
|
|
827
|
-
|
|
828
|
-
Args:
|
|
829
|
-
values: Voltage values to set the output channels to.
|
|
830
|
-
"""
|
|
831
|
-
request = dto.DeviceSetAllAnalogOutputsRequest(
|
|
832
|
-
interface_id=self._device.connection.interface_id,
|
|
833
|
-
device=self._device.device_address,
|
|
834
|
-
values=values,
|
|
835
|
-
)
|
|
836
|
-
await call_async("device/set_all_analog_outputs", request)
|
|
837
|
-
|
|
838
|
-
def set_analog_output_schedule(
|
|
839
|
-
self,
|
|
840
|
-
channel_number: int,
|
|
841
|
-
value: float,
|
|
842
|
-
future_value: float,
|
|
843
|
-
delay: float,
|
|
844
|
-
unit: TimeUnits = Units.NATIVE
|
|
845
|
-
) -> None:
|
|
846
|
-
"""
|
|
847
|
-
Sets current and future value for the specified analog output channel.
|
|
848
|
-
Requires at least Firmware 7.38.
|
|
849
|
-
|
|
850
|
-
Args:
|
|
851
|
-
channel_number: Channel number starting at 1.
|
|
852
|
-
value: Value to set the output channel voltage to immediately.
|
|
853
|
-
future_value: Value to set the output channel voltage to in the future.
|
|
854
|
-
delay: Delay between setting current value and setting future value.
|
|
855
|
-
unit: Units of time.
|
|
856
|
-
"""
|
|
857
|
-
if delay <= 0:
|
|
858
|
-
raise ValueError('Delay must be a positive value.')
|
|
859
|
-
|
|
860
|
-
request = dto.DeviceSetAnalogOutputScheduleRequest(
|
|
861
|
-
interface_id=self._device.connection.interface_id,
|
|
862
|
-
device=self._device.device_address,
|
|
863
|
-
channel_number=channel_number,
|
|
864
|
-
value=value,
|
|
865
|
-
future_value=future_value,
|
|
866
|
-
delay=delay,
|
|
867
|
-
unit=unit,
|
|
868
|
-
)
|
|
869
|
-
call("device/set_analog_output_schedule", request)
|
|
870
|
-
|
|
871
|
-
async def set_analog_output_schedule_async(
|
|
872
|
-
self,
|
|
873
|
-
channel_number: int,
|
|
874
|
-
value: float,
|
|
875
|
-
future_value: float,
|
|
876
|
-
delay: float,
|
|
877
|
-
unit: TimeUnits = Units.NATIVE
|
|
878
|
-
) -> None:
|
|
879
|
-
"""
|
|
880
|
-
Sets current and future value for the specified analog output channel.
|
|
881
|
-
Requires at least Firmware 7.38.
|
|
882
|
-
|
|
883
|
-
Args:
|
|
884
|
-
channel_number: Channel number starting at 1.
|
|
885
|
-
value: Value to set the output channel voltage to immediately.
|
|
886
|
-
future_value: Value to set the output channel voltage to in the future.
|
|
887
|
-
delay: Delay between setting current value and setting future value.
|
|
888
|
-
unit: Units of time.
|
|
889
|
-
"""
|
|
890
|
-
if delay <= 0:
|
|
891
|
-
raise ValueError('Delay must be a positive value.')
|
|
892
|
-
|
|
893
|
-
request = dto.DeviceSetAnalogOutputScheduleRequest(
|
|
894
|
-
interface_id=self._device.connection.interface_id,
|
|
895
|
-
device=self._device.device_address,
|
|
896
|
-
channel_number=channel_number,
|
|
897
|
-
value=value,
|
|
898
|
-
future_value=future_value,
|
|
899
|
-
delay=delay,
|
|
900
|
-
unit=unit,
|
|
901
|
-
)
|
|
902
|
-
await call_async("device/set_analog_output_schedule", request)
|
|
903
|
-
|
|
904
|
-
def set_all_analog_outputs_schedule(
|
|
905
|
-
self,
|
|
906
|
-
values: List[float],
|
|
907
|
-
future_values: List[float],
|
|
908
|
-
delay: float,
|
|
909
|
-
unit: TimeUnits = Units.NATIVE
|
|
910
|
-
) -> None:
|
|
911
|
-
"""
|
|
912
|
-
Sets current and future values for all analog output channels.
|
|
913
|
-
Requires at least Firmware 7.38.
|
|
914
|
-
|
|
915
|
-
Args:
|
|
916
|
-
values: Voltage values to set the output channels to immediately.
|
|
917
|
-
future_values: Voltage values to set the output channels to in the future.
|
|
918
|
-
delay: Delay between setting current values and setting future values.
|
|
919
|
-
unit: Units of time.
|
|
920
|
-
"""
|
|
921
|
-
if delay <= 0:
|
|
922
|
-
raise ValueError('Delay must be a positive value.')
|
|
923
|
-
|
|
924
|
-
request = dto.DeviceSetAllAnalogOutputsScheduleRequest(
|
|
925
|
-
interface_id=self._device.connection.interface_id,
|
|
926
|
-
device=self._device.device_address,
|
|
927
|
-
values=values,
|
|
928
|
-
future_values=future_values,
|
|
929
|
-
delay=delay,
|
|
930
|
-
unit=unit,
|
|
931
|
-
)
|
|
932
|
-
call("device/set_all_analog_outputs_schedule", request)
|
|
933
|
-
|
|
934
|
-
async def set_all_analog_outputs_schedule_async(
|
|
935
|
-
self,
|
|
936
|
-
values: List[float],
|
|
937
|
-
future_values: List[float],
|
|
938
|
-
delay: float,
|
|
939
|
-
unit: TimeUnits = Units.NATIVE
|
|
940
|
-
) -> None:
|
|
941
|
-
"""
|
|
942
|
-
Sets current and future values for all analog output channels.
|
|
943
|
-
Requires at least Firmware 7.38.
|
|
944
|
-
|
|
945
|
-
Args:
|
|
946
|
-
values: Voltage values to set the output channels to immediately.
|
|
947
|
-
future_values: Voltage values to set the output channels to in the future.
|
|
948
|
-
delay: Delay between setting current values and setting future values.
|
|
949
|
-
unit: Units of time.
|
|
950
|
-
"""
|
|
951
|
-
if delay <= 0:
|
|
952
|
-
raise ValueError('Delay must be a positive value.')
|
|
953
|
-
|
|
954
|
-
request = dto.DeviceSetAllAnalogOutputsScheduleRequest(
|
|
955
|
-
interface_id=self._device.connection.interface_id,
|
|
956
|
-
device=self._device.device_address,
|
|
957
|
-
values=values,
|
|
958
|
-
future_values=future_values,
|
|
959
|
-
delay=delay,
|
|
960
|
-
unit=unit,
|
|
961
|
-
)
|
|
962
|
-
await call_async("device/set_all_analog_outputs_schedule", request)
|
|
963
|
-
|
|
964
|
-
def set_analog_input_lowpass_filter(
|
|
965
|
-
self,
|
|
966
|
-
channel_number: int,
|
|
967
|
-
cutoff_frequency: float,
|
|
968
|
-
unit: FrequencyUnits = Units.NATIVE
|
|
969
|
-
) -> None:
|
|
970
|
-
"""
|
|
971
|
-
Sets the cutoff frequency of the low-pass filter for the specified analog input channel.
|
|
972
|
-
Set the frequency to 0 to disable the filter.
|
|
973
|
-
|
|
974
|
-
Args:
|
|
975
|
-
channel_number: Channel number starting at 1.
|
|
976
|
-
cutoff_frequency: Cutoff frequency of the low-pass filter.
|
|
977
|
-
unit: Units of frequency.
|
|
978
|
-
"""
|
|
979
|
-
request = dto.DeviceSetLowpassFilterRequest(
|
|
980
|
-
interface_id=self._device.connection.interface_id,
|
|
981
|
-
device=self._device.device_address,
|
|
982
|
-
channel_number=channel_number,
|
|
983
|
-
cutoff_frequency=cutoff_frequency,
|
|
984
|
-
unit=unit,
|
|
985
|
-
)
|
|
986
|
-
call("device/set_lowpass_filter", request)
|
|
987
|
-
|
|
988
|
-
async def set_analog_input_lowpass_filter_async(
|
|
989
|
-
self,
|
|
990
|
-
channel_number: int,
|
|
991
|
-
cutoff_frequency: float,
|
|
992
|
-
unit: FrequencyUnits = Units.NATIVE
|
|
993
|
-
) -> None:
|
|
994
|
-
"""
|
|
995
|
-
Sets the cutoff frequency of the low-pass filter for the specified analog input channel.
|
|
996
|
-
Set the frequency to 0 to disable the filter.
|
|
997
|
-
|
|
998
|
-
Args:
|
|
999
|
-
channel_number: Channel number starting at 1.
|
|
1000
|
-
cutoff_frequency: Cutoff frequency of the low-pass filter.
|
|
1001
|
-
unit: Units of frequency.
|
|
1002
|
-
"""
|
|
1003
|
-
request = dto.DeviceSetLowpassFilterRequest(
|
|
1004
|
-
interface_id=self._device.connection.interface_id,
|
|
1005
|
-
device=self._device.device_address,
|
|
1006
|
-
channel_number=channel_number,
|
|
1007
|
-
cutoff_frequency=cutoff_frequency,
|
|
1008
|
-
unit=unit,
|
|
1009
|
-
)
|
|
1010
|
-
await call_async("device/set_lowpass_filter", request)
|
|
1011
|
-
|
|
1012
|
-
def cancel_digital_output_schedule(
|
|
1013
|
-
self,
|
|
1014
|
-
channel_number: int
|
|
1015
|
-
) -> None:
|
|
1016
|
-
"""
|
|
1017
|
-
Cancels a scheduled digital output action.
|
|
1018
|
-
Requires at least Firmware 7.37.
|
|
1019
|
-
|
|
1020
|
-
Args:
|
|
1021
|
-
channel_number: Channel number starting at 1.
|
|
1022
|
-
"""
|
|
1023
|
-
request = dto.DeviceCancelOutputScheduleRequest(
|
|
1024
|
-
interface_id=self._device.connection.interface_id,
|
|
1025
|
-
device=self._device.device_address,
|
|
1026
|
-
analog=False,
|
|
1027
|
-
channel_number=channel_number,
|
|
1028
|
-
)
|
|
1029
|
-
call("device/cancel_output_schedule", request)
|
|
1030
|
-
|
|
1031
|
-
async def cancel_digital_output_schedule_async(
|
|
1032
|
-
self,
|
|
1033
|
-
channel_number: int
|
|
1034
|
-
) -> None:
|
|
1035
|
-
"""
|
|
1036
|
-
Cancels a scheduled digital output action.
|
|
1037
|
-
Requires at least Firmware 7.37.
|
|
1038
|
-
|
|
1039
|
-
Args:
|
|
1040
|
-
channel_number: Channel number starting at 1.
|
|
1041
|
-
"""
|
|
1042
|
-
request = dto.DeviceCancelOutputScheduleRequest(
|
|
1043
|
-
interface_id=self._device.connection.interface_id,
|
|
1044
|
-
device=self._device.device_address,
|
|
1045
|
-
analog=False,
|
|
1046
|
-
channel_number=channel_number,
|
|
1047
|
-
)
|
|
1048
|
-
await call_async("device/cancel_output_schedule", request)
|
|
1049
|
-
|
|
1050
|
-
def cancel_all_digital_outputs_schedule(
|
|
1051
|
-
self,
|
|
1052
|
-
channels: List[bool] = []
|
|
1053
|
-
) -> None:
|
|
1054
|
-
"""
|
|
1055
|
-
Cancel all scheduled digital output actions.
|
|
1056
|
-
Requires at least Firmware 7.37.
|
|
1057
|
-
|
|
1058
|
-
Args:
|
|
1059
|
-
channels: Optionally specify which channels to cancel.
|
|
1060
|
-
Array length must be empty or equal to the number of channels on device.
|
|
1061
|
-
Specifying "True" for a channel will cancel the scheduled digital output action for that channel.
|
|
1062
|
-
"""
|
|
1063
|
-
request = dto.DeviceCancelAllOutputsScheduleRequest(
|
|
1064
|
-
interface_id=self._device.connection.interface_id,
|
|
1065
|
-
device=self._device.device_address,
|
|
1066
|
-
analog=False,
|
|
1067
|
-
channels=channels,
|
|
1068
|
-
)
|
|
1069
|
-
call("device/cancel_all_outputs_schedule", request)
|
|
1070
|
-
|
|
1071
|
-
async def cancel_all_digital_outputs_schedule_async(
|
|
1072
|
-
self,
|
|
1073
|
-
channels: List[bool] = []
|
|
1074
|
-
) -> None:
|
|
1075
|
-
"""
|
|
1076
|
-
Cancel all scheduled digital output actions.
|
|
1077
|
-
Requires at least Firmware 7.37.
|
|
1078
|
-
|
|
1079
|
-
Args:
|
|
1080
|
-
channels: Optionally specify which channels to cancel.
|
|
1081
|
-
Array length must be empty or equal to the number of channels on device.
|
|
1082
|
-
Specifying "True" for a channel will cancel the scheduled digital output action for that channel.
|
|
1083
|
-
"""
|
|
1084
|
-
request = dto.DeviceCancelAllOutputsScheduleRequest(
|
|
1085
|
-
interface_id=self._device.connection.interface_id,
|
|
1086
|
-
device=self._device.device_address,
|
|
1087
|
-
analog=False,
|
|
1088
|
-
channels=channels,
|
|
1089
|
-
)
|
|
1090
|
-
await call_async("device/cancel_all_outputs_schedule", request)
|
|
1091
|
-
|
|
1092
|
-
def cancel_analog_output_schedule(
|
|
1093
|
-
self,
|
|
1094
|
-
channel_number: int
|
|
1095
|
-
) -> None:
|
|
1096
|
-
"""
|
|
1097
|
-
Cancels a scheduled analog output value.
|
|
1098
|
-
Requires at least Firmware 7.38.
|
|
1099
|
-
|
|
1100
|
-
Args:
|
|
1101
|
-
channel_number: Channel number starting at 1.
|
|
1102
|
-
"""
|
|
1103
|
-
request = dto.DeviceCancelOutputScheduleRequest(
|
|
1104
|
-
interface_id=self._device.connection.interface_id,
|
|
1105
|
-
device=self._device.device_address,
|
|
1106
|
-
analog=True,
|
|
1107
|
-
channel_number=channel_number,
|
|
1108
|
-
)
|
|
1109
|
-
call("device/cancel_output_schedule", request)
|
|
1110
|
-
|
|
1111
|
-
async def cancel_analog_output_schedule_async(
|
|
1112
|
-
self,
|
|
1113
|
-
channel_number: int
|
|
1114
|
-
) -> None:
|
|
1115
|
-
"""
|
|
1116
|
-
Cancels a scheduled analog output value.
|
|
1117
|
-
Requires at least Firmware 7.38.
|
|
1118
|
-
|
|
1119
|
-
Args:
|
|
1120
|
-
channel_number: Channel number starting at 1.
|
|
1121
|
-
"""
|
|
1122
|
-
request = dto.DeviceCancelOutputScheduleRequest(
|
|
1123
|
-
interface_id=self._device.connection.interface_id,
|
|
1124
|
-
device=self._device.device_address,
|
|
1125
|
-
analog=True,
|
|
1126
|
-
channel_number=channel_number,
|
|
1127
|
-
)
|
|
1128
|
-
await call_async("device/cancel_output_schedule", request)
|
|
1129
|
-
|
|
1130
|
-
def cancel_all_analog_outputs_schedule(
|
|
1131
|
-
self,
|
|
1132
|
-
channels: List[bool] = []
|
|
1133
|
-
) -> None:
|
|
1134
|
-
"""
|
|
1135
|
-
Cancel all scheduled analog output actions.
|
|
1136
|
-
Requires at least Firmware 7.38.
|
|
1137
|
-
|
|
1138
|
-
Args:
|
|
1139
|
-
channels: Optionally specify which channels to cancel.
|
|
1140
|
-
Array length must be empty or equal to the number of channels on device.
|
|
1141
|
-
Specifying "True" for a channel will cancel the scheduled analog output value for that channel.
|
|
1142
|
-
"""
|
|
1143
|
-
request = dto.DeviceCancelAllOutputsScheduleRequest(
|
|
1144
|
-
interface_id=self._device.connection.interface_id,
|
|
1145
|
-
device=self._device.device_address,
|
|
1146
|
-
analog=True,
|
|
1147
|
-
channels=channels,
|
|
1148
|
-
)
|
|
1149
|
-
call("device/cancel_all_outputs_schedule", request)
|
|
1150
|
-
|
|
1151
|
-
async def cancel_all_analog_outputs_schedule_async(
|
|
1152
|
-
self,
|
|
1153
|
-
channels: List[bool] = []
|
|
1154
|
-
) -> None:
|
|
1155
|
-
"""
|
|
1156
|
-
Cancel all scheduled analog output actions.
|
|
1157
|
-
Requires at least Firmware 7.38.
|
|
1158
|
-
|
|
1159
|
-
Args:
|
|
1160
|
-
channels: Optionally specify which channels to cancel.
|
|
1161
|
-
Array length must be empty or equal to the number of channels on device.
|
|
1162
|
-
Specifying "True" for a channel will cancel the scheduled analog output value for that channel.
|
|
1163
|
-
"""
|
|
1164
|
-
request = dto.DeviceCancelAllOutputsScheduleRequest(
|
|
1165
|
-
interface_id=self._device.connection.interface_id,
|
|
1166
|
-
device=self._device.device_address,
|
|
1167
|
-
analog=True,
|
|
1168
|
-
channels=channels,
|
|
1169
|
-
)
|
|
1170
|
-
await call_async("device/cancel_all_outputs_schedule", request)
|
|
1
|
+
# ===== THIS FILE IS GENERATED FROM A TEMPLATE ===== #
|
|
2
|
+
# ============== DO NOT EDIT DIRECTLY ============== #
|
|
3
|
+
|
|
4
|
+
from typing import TYPE_CHECKING, List, Optional
|
|
5
|
+
from ..call import call, call_async
|
|
6
|
+
from ..units import Units, TimeUnits, FrequencyUnits
|
|
7
|
+
from ..dto.ascii.device_io_info import DeviceIOInfo
|
|
8
|
+
from ..dto.ascii.digital_output_action import DigitalOutputAction
|
|
9
|
+
from ..dto.ascii.io_port_type import IoPortType
|
|
10
|
+
from ..dto.ascii.io_port_label import IoPortLabel
|
|
11
|
+
|
|
12
|
+
from ..dto import requests as dto
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from .device import Device
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class DeviceIO:
|
|
19
|
+
"""
|
|
20
|
+
Class providing access to the I/O channels of the device.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self, device: 'Device'):
|
|
24
|
+
self._device: 'Device' = device
|
|
25
|
+
|
|
26
|
+
def get_channels_info(
|
|
27
|
+
self
|
|
28
|
+
) -> DeviceIOInfo:
|
|
29
|
+
"""
|
|
30
|
+
Returns the number of I/O channels the device has.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
An object containing the number of I/O channels the device has.
|
|
34
|
+
"""
|
|
35
|
+
request = dto.DeviceEmptyRequest(
|
|
36
|
+
interface_id=self._device.connection.interface_id,
|
|
37
|
+
device=self._device.device_address,
|
|
38
|
+
)
|
|
39
|
+
response = call(
|
|
40
|
+
"device/get_io_info",
|
|
41
|
+
request,
|
|
42
|
+
DeviceIOInfo.from_binary)
|
|
43
|
+
return response
|
|
44
|
+
|
|
45
|
+
async def get_channels_info_async(
|
|
46
|
+
self
|
|
47
|
+
) -> DeviceIOInfo:
|
|
48
|
+
"""
|
|
49
|
+
Returns the number of I/O channels the device has.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
An object containing the number of I/O channels the device has.
|
|
53
|
+
"""
|
|
54
|
+
request = dto.DeviceEmptyRequest(
|
|
55
|
+
interface_id=self._device.connection.interface_id,
|
|
56
|
+
device=self._device.device_address,
|
|
57
|
+
)
|
|
58
|
+
response = await call_async(
|
|
59
|
+
"device/get_io_info",
|
|
60
|
+
request,
|
|
61
|
+
DeviceIOInfo.from_binary)
|
|
62
|
+
return response
|
|
63
|
+
|
|
64
|
+
def set_label(
|
|
65
|
+
self,
|
|
66
|
+
port_type: IoPortType,
|
|
67
|
+
channel_number: int,
|
|
68
|
+
label: Optional[str]
|
|
69
|
+
) -> None:
|
|
70
|
+
"""
|
|
71
|
+
Sets the label of the specified channel.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
port_type: The type of channel to set the label of.
|
|
75
|
+
channel_number: Channel number starting at 1.
|
|
76
|
+
label: The label to set for the specified channel.
|
|
77
|
+
If no value or an empty string is provided, this label is deleted.
|
|
78
|
+
"""
|
|
79
|
+
request = dto.SetIoPortLabelRequest(
|
|
80
|
+
interface_id=self._device.connection.interface_id,
|
|
81
|
+
device=self._device.device_address,
|
|
82
|
+
port_type=port_type,
|
|
83
|
+
channel_number=channel_number,
|
|
84
|
+
label=label,
|
|
85
|
+
)
|
|
86
|
+
call("device/set_io_label", request)
|
|
87
|
+
|
|
88
|
+
async def set_label_async(
|
|
89
|
+
self,
|
|
90
|
+
port_type: IoPortType,
|
|
91
|
+
channel_number: int,
|
|
92
|
+
label: Optional[str]
|
|
93
|
+
) -> None:
|
|
94
|
+
"""
|
|
95
|
+
Sets the label of the specified channel.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
port_type: The type of channel to set the label of.
|
|
99
|
+
channel_number: Channel number starting at 1.
|
|
100
|
+
label: The label to set for the specified channel.
|
|
101
|
+
If no value or an empty string is provided, this label is deleted.
|
|
102
|
+
"""
|
|
103
|
+
request = dto.SetIoPortLabelRequest(
|
|
104
|
+
interface_id=self._device.connection.interface_id,
|
|
105
|
+
device=self._device.device_address,
|
|
106
|
+
port_type=port_type,
|
|
107
|
+
channel_number=channel_number,
|
|
108
|
+
label=label,
|
|
109
|
+
)
|
|
110
|
+
await call_async("device/set_io_label", request)
|
|
111
|
+
|
|
112
|
+
def get_label(
|
|
113
|
+
self,
|
|
114
|
+
port_type: IoPortType,
|
|
115
|
+
channel_number: int
|
|
116
|
+
) -> str:
|
|
117
|
+
"""
|
|
118
|
+
Returns the label of the specified channel.
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
port_type: The type of channel to get the label of.
|
|
122
|
+
channel_number: Channel number starting at 1.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
The label of the specified channel.
|
|
126
|
+
"""
|
|
127
|
+
request = dto.GetIoPortLabelRequest(
|
|
128
|
+
interface_id=self._device.connection.interface_id,
|
|
129
|
+
device=self._device.device_address,
|
|
130
|
+
port_type=port_type,
|
|
131
|
+
channel_number=channel_number,
|
|
132
|
+
)
|
|
133
|
+
response = call(
|
|
134
|
+
"device/get_io_label",
|
|
135
|
+
request,
|
|
136
|
+
dto.StringResponse.from_binary)
|
|
137
|
+
return response.value
|
|
138
|
+
|
|
139
|
+
async def get_label_async(
|
|
140
|
+
self,
|
|
141
|
+
port_type: IoPortType,
|
|
142
|
+
channel_number: int
|
|
143
|
+
) -> str:
|
|
144
|
+
"""
|
|
145
|
+
Returns the label of the specified channel.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
port_type: The type of channel to get the label of.
|
|
149
|
+
channel_number: Channel number starting at 1.
|
|
150
|
+
|
|
151
|
+
Returns:
|
|
152
|
+
The label of the specified channel.
|
|
153
|
+
"""
|
|
154
|
+
request = dto.GetIoPortLabelRequest(
|
|
155
|
+
interface_id=self._device.connection.interface_id,
|
|
156
|
+
device=self._device.device_address,
|
|
157
|
+
port_type=port_type,
|
|
158
|
+
channel_number=channel_number,
|
|
159
|
+
)
|
|
160
|
+
response = await call_async(
|
|
161
|
+
"device/get_io_label",
|
|
162
|
+
request,
|
|
163
|
+
dto.StringResponse.from_binary)
|
|
164
|
+
return response.value
|
|
165
|
+
|
|
166
|
+
def get_all_labels(
|
|
167
|
+
self
|
|
168
|
+
) -> List[IoPortLabel]:
|
|
169
|
+
"""
|
|
170
|
+
Returns every label assigned to an IO port on this device.
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
The labels set for this device's IO.
|
|
174
|
+
"""
|
|
175
|
+
request = dto.DeviceEmptyRequest(
|
|
176
|
+
interface_id=self._device.connection.interface_id,
|
|
177
|
+
device=self._device.device_address,
|
|
178
|
+
)
|
|
179
|
+
response = call(
|
|
180
|
+
"device/get_all_io_labels",
|
|
181
|
+
request,
|
|
182
|
+
dto.GetAllIoPortLabelsResponse.from_binary)
|
|
183
|
+
return response.labels
|
|
184
|
+
|
|
185
|
+
async def get_all_labels_async(
|
|
186
|
+
self
|
|
187
|
+
) -> List[IoPortLabel]:
|
|
188
|
+
"""
|
|
189
|
+
Returns every label assigned to an IO port on this device.
|
|
190
|
+
|
|
191
|
+
Returns:
|
|
192
|
+
The labels set for this device's IO.
|
|
193
|
+
"""
|
|
194
|
+
request = dto.DeviceEmptyRequest(
|
|
195
|
+
interface_id=self._device.connection.interface_id,
|
|
196
|
+
device=self._device.device_address,
|
|
197
|
+
)
|
|
198
|
+
response = await call_async(
|
|
199
|
+
"device/get_all_io_labels",
|
|
200
|
+
request,
|
|
201
|
+
dto.GetAllIoPortLabelsResponse.from_binary)
|
|
202
|
+
return response.labels
|
|
203
|
+
|
|
204
|
+
def get_digital_input(
|
|
205
|
+
self,
|
|
206
|
+
channel_number: int
|
|
207
|
+
) -> bool:
|
|
208
|
+
"""
|
|
209
|
+
Returns the current value of the specified digital input channel.
|
|
210
|
+
|
|
211
|
+
Args:
|
|
212
|
+
channel_number: Channel number starting at 1.
|
|
213
|
+
|
|
214
|
+
Returns:
|
|
215
|
+
True if voltage is present on the input channel and false otherwise.
|
|
216
|
+
"""
|
|
217
|
+
request = dto.DeviceGetDigitalIORequest(
|
|
218
|
+
interface_id=self._device.connection.interface_id,
|
|
219
|
+
device=self._device.device_address,
|
|
220
|
+
channel_type="di",
|
|
221
|
+
channel_number=channel_number,
|
|
222
|
+
)
|
|
223
|
+
response = call(
|
|
224
|
+
"device/get_digital_io",
|
|
225
|
+
request,
|
|
226
|
+
dto.BoolResponse.from_binary)
|
|
227
|
+
return response.value
|
|
228
|
+
|
|
229
|
+
async def get_digital_input_async(
|
|
230
|
+
self,
|
|
231
|
+
channel_number: int
|
|
232
|
+
) -> bool:
|
|
233
|
+
"""
|
|
234
|
+
Returns the current value of the specified digital input channel.
|
|
235
|
+
|
|
236
|
+
Args:
|
|
237
|
+
channel_number: Channel number starting at 1.
|
|
238
|
+
|
|
239
|
+
Returns:
|
|
240
|
+
True if voltage is present on the input channel and false otherwise.
|
|
241
|
+
"""
|
|
242
|
+
request = dto.DeviceGetDigitalIORequest(
|
|
243
|
+
interface_id=self._device.connection.interface_id,
|
|
244
|
+
device=self._device.device_address,
|
|
245
|
+
channel_type="di",
|
|
246
|
+
channel_number=channel_number,
|
|
247
|
+
)
|
|
248
|
+
response = await call_async(
|
|
249
|
+
"device/get_digital_io",
|
|
250
|
+
request,
|
|
251
|
+
dto.BoolResponse.from_binary)
|
|
252
|
+
return response.value
|
|
253
|
+
|
|
254
|
+
def get_digital_output(
|
|
255
|
+
self,
|
|
256
|
+
channel_number: int
|
|
257
|
+
) -> bool:
|
|
258
|
+
"""
|
|
259
|
+
Returns the current value of the specified digital output channel.
|
|
260
|
+
|
|
261
|
+
Args:
|
|
262
|
+
channel_number: Channel number starting at 1.
|
|
263
|
+
|
|
264
|
+
Returns:
|
|
265
|
+
True if the output channel is conducting and false otherwise.
|
|
266
|
+
"""
|
|
267
|
+
request = dto.DeviceGetDigitalIORequest(
|
|
268
|
+
interface_id=self._device.connection.interface_id,
|
|
269
|
+
device=self._device.device_address,
|
|
270
|
+
channel_type="do",
|
|
271
|
+
channel_number=channel_number,
|
|
272
|
+
)
|
|
273
|
+
response = call(
|
|
274
|
+
"device/get_digital_io",
|
|
275
|
+
request,
|
|
276
|
+
dto.BoolResponse.from_binary)
|
|
277
|
+
return response.value
|
|
278
|
+
|
|
279
|
+
async def get_digital_output_async(
|
|
280
|
+
self,
|
|
281
|
+
channel_number: int
|
|
282
|
+
) -> bool:
|
|
283
|
+
"""
|
|
284
|
+
Returns the current value of the specified digital output channel.
|
|
285
|
+
|
|
286
|
+
Args:
|
|
287
|
+
channel_number: Channel number starting at 1.
|
|
288
|
+
|
|
289
|
+
Returns:
|
|
290
|
+
True if the output channel is conducting and false otherwise.
|
|
291
|
+
"""
|
|
292
|
+
request = dto.DeviceGetDigitalIORequest(
|
|
293
|
+
interface_id=self._device.connection.interface_id,
|
|
294
|
+
device=self._device.device_address,
|
|
295
|
+
channel_type="do",
|
|
296
|
+
channel_number=channel_number,
|
|
297
|
+
)
|
|
298
|
+
response = await call_async(
|
|
299
|
+
"device/get_digital_io",
|
|
300
|
+
request,
|
|
301
|
+
dto.BoolResponse.from_binary)
|
|
302
|
+
return response.value
|
|
303
|
+
|
|
304
|
+
def get_analog_input(
|
|
305
|
+
self,
|
|
306
|
+
channel_number: int
|
|
307
|
+
) -> float:
|
|
308
|
+
"""
|
|
309
|
+
Returns the current value of the specified analog input channel.
|
|
310
|
+
|
|
311
|
+
Args:
|
|
312
|
+
channel_number: Channel number starting at 1.
|
|
313
|
+
|
|
314
|
+
Returns:
|
|
315
|
+
A measurement of the voltage present on the input channel.
|
|
316
|
+
"""
|
|
317
|
+
request = dto.DeviceGetAnalogIORequest(
|
|
318
|
+
interface_id=self._device.connection.interface_id,
|
|
319
|
+
device=self._device.device_address,
|
|
320
|
+
channel_type="ai",
|
|
321
|
+
channel_number=channel_number,
|
|
322
|
+
)
|
|
323
|
+
response = call(
|
|
324
|
+
"device/get_analog_io",
|
|
325
|
+
request,
|
|
326
|
+
dto.DoubleResponse.from_binary)
|
|
327
|
+
return response.value
|
|
328
|
+
|
|
329
|
+
async def get_analog_input_async(
|
|
330
|
+
self,
|
|
331
|
+
channel_number: int
|
|
332
|
+
) -> float:
|
|
333
|
+
"""
|
|
334
|
+
Returns the current value of the specified analog input channel.
|
|
335
|
+
|
|
336
|
+
Args:
|
|
337
|
+
channel_number: Channel number starting at 1.
|
|
338
|
+
|
|
339
|
+
Returns:
|
|
340
|
+
A measurement of the voltage present on the input channel.
|
|
341
|
+
"""
|
|
342
|
+
request = dto.DeviceGetAnalogIORequest(
|
|
343
|
+
interface_id=self._device.connection.interface_id,
|
|
344
|
+
device=self._device.device_address,
|
|
345
|
+
channel_type="ai",
|
|
346
|
+
channel_number=channel_number,
|
|
347
|
+
)
|
|
348
|
+
response = await call_async(
|
|
349
|
+
"device/get_analog_io",
|
|
350
|
+
request,
|
|
351
|
+
dto.DoubleResponse.from_binary)
|
|
352
|
+
return response.value
|
|
353
|
+
|
|
354
|
+
def get_analog_output(
|
|
355
|
+
self,
|
|
356
|
+
channel_number: int
|
|
357
|
+
) -> float:
|
|
358
|
+
"""
|
|
359
|
+
Returns the current values of the specified analog output channel.
|
|
360
|
+
|
|
361
|
+
Args:
|
|
362
|
+
channel_number: Channel number starting at 1.
|
|
363
|
+
|
|
364
|
+
Returns:
|
|
365
|
+
A measurement of voltage that the output channel is conducting.
|
|
366
|
+
"""
|
|
367
|
+
request = dto.DeviceGetAnalogIORequest(
|
|
368
|
+
interface_id=self._device.connection.interface_id,
|
|
369
|
+
device=self._device.device_address,
|
|
370
|
+
channel_type="ao",
|
|
371
|
+
channel_number=channel_number,
|
|
372
|
+
)
|
|
373
|
+
response = call(
|
|
374
|
+
"device/get_analog_io",
|
|
375
|
+
request,
|
|
376
|
+
dto.DoubleResponse.from_binary)
|
|
377
|
+
return response.value
|
|
378
|
+
|
|
379
|
+
async def get_analog_output_async(
|
|
380
|
+
self,
|
|
381
|
+
channel_number: int
|
|
382
|
+
) -> float:
|
|
383
|
+
"""
|
|
384
|
+
Returns the current values of the specified analog output channel.
|
|
385
|
+
|
|
386
|
+
Args:
|
|
387
|
+
channel_number: Channel number starting at 1.
|
|
388
|
+
|
|
389
|
+
Returns:
|
|
390
|
+
A measurement of voltage that the output channel is conducting.
|
|
391
|
+
"""
|
|
392
|
+
request = dto.DeviceGetAnalogIORequest(
|
|
393
|
+
interface_id=self._device.connection.interface_id,
|
|
394
|
+
device=self._device.device_address,
|
|
395
|
+
channel_type="ao",
|
|
396
|
+
channel_number=channel_number,
|
|
397
|
+
)
|
|
398
|
+
response = await call_async(
|
|
399
|
+
"device/get_analog_io",
|
|
400
|
+
request,
|
|
401
|
+
dto.DoubleResponse.from_binary)
|
|
402
|
+
return response.value
|
|
403
|
+
|
|
404
|
+
def get_all_digital_inputs(
|
|
405
|
+
self
|
|
406
|
+
) -> List[bool]:
|
|
407
|
+
"""
|
|
408
|
+
Returns the current values of all digital input channels.
|
|
409
|
+
|
|
410
|
+
Returns:
|
|
411
|
+
True if voltage is present on the input channel and false otherwise.
|
|
412
|
+
"""
|
|
413
|
+
request = dto.DeviceGetAllDigitalIORequest(
|
|
414
|
+
interface_id=self._device.connection.interface_id,
|
|
415
|
+
device=self._device.device_address,
|
|
416
|
+
channel_type="di",
|
|
417
|
+
)
|
|
418
|
+
response = call(
|
|
419
|
+
"device/get_all_digital_io",
|
|
420
|
+
request,
|
|
421
|
+
dto.DeviceGetAllDigitalIOResponse.from_binary)
|
|
422
|
+
return response.values
|
|
423
|
+
|
|
424
|
+
async def get_all_digital_inputs_async(
|
|
425
|
+
self
|
|
426
|
+
) -> List[bool]:
|
|
427
|
+
"""
|
|
428
|
+
Returns the current values of all digital input channels.
|
|
429
|
+
|
|
430
|
+
Returns:
|
|
431
|
+
True if voltage is present on the input channel and false otherwise.
|
|
432
|
+
"""
|
|
433
|
+
request = dto.DeviceGetAllDigitalIORequest(
|
|
434
|
+
interface_id=self._device.connection.interface_id,
|
|
435
|
+
device=self._device.device_address,
|
|
436
|
+
channel_type="di",
|
|
437
|
+
)
|
|
438
|
+
response = await call_async(
|
|
439
|
+
"device/get_all_digital_io",
|
|
440
|
+
request,
|
|
441
|
+
dto.DeviceGetAllDigitalIOResponse.from_binary)
|
|
442
|
+
return response.values
|
|
443
|
+
|
|
444
|
+
def get_all_digital_outputs(
|
|
445
|
+
self
|
|
446
|
+
) -> List[bool]:
|
|
447
|
+
"""
|
|
448
|
+
Returns the current values of all digital output channels.
|
|
449
|
+
|
|
450
|
+
Returns:
|
|
451
|
+
True if the output channel is conducting and false otherwise.
|
|
452
|
+
"""
|
|
453
|
+
request = dto.DeviceGetAllDigitalIORequest(
|
|
454
|
+
interface_id=self._device.connection.interface_id,
|
|
455
|
+
device=self._device.device_address,
|
|
456
|
+
channel_type="do",
|
|
457
|
+
)
|
|
458
|
+
response = call(
|
|
459
|
+
"device/get_all_digital_io",
|
|
460
|
+
request,
|
|
461
|
+
dto.DeviceGetAllDigitalIOResponse.from_binary)
|
|
462
|
+
return response.values
|
|
463
|
+
|
|
464
|
+
async def get_all_digital_outputs_async(
|
|
465
|
+
self
|
|
466
|
+
) -> List[bool]:
|
|
467
|
+
"""
|
|
468
|
+
Returns the current values of all digital output channels.
|
|
469
|
+
|
|
470
|
+
Returns:
|
|
471
|
+
True if the output channel is conducting and false otherwise.
|
|
472
|
+
"""
|
|
473
|
+
request = dto.DeviceGetAllDigitalIORequest(
|
|
474
|
+
interface_id=self._device.connection.interface_id,
|
|
475
|
+
device=self._device.device_address,
|
|
476
|
+
channel_type="do",
|
|
477
|
+
)
|
|
478
|
+
response = await call_async(
|
|
479
|
+
"device/get_all_digital_io",
|
|
480
|
+
request,
|
|
481
|
+
dto.DeviceGetAllDigitalIOResponse.from_binary)
|
|
482
|
+
return response.values
|
|
483
|
+
|
|
484
|
+
def get_all_analog_inputs(
|
|
485
|
+
self
|
|
486
|
+
) -> List[float]:
|
|
487
|
+
"""
|
|
488
|
+
Returns the current values of all analog input channels.
|
|
489
|
+
|
|
490
|
+
Returns:
|
|
491
|
+
Measurements of the voltages present on the input channels.
|
|
492
|
+
"""
|
|
493
|
+
request = dto.DeviceGetAllAnalogIORequest(
|
|
494
|
+
interface_id=self._device.connection.interface_id,
|
|
495
|
+
device=self._device.device_address,
|
|
496
|
+
channel_type="ai",
|
|
497
|
+
)
|
|
498
|
+
response = call(
|
|
499
|
+
"device/get_all_analog_io",
|
|
500
|
+
request,
|
|
501
|
+
dto.DeviceGetAllAnalogIOResponse.from_binary)
|
|
502
|
+
return response.values
|
|
503
|
+
|
|
504
|
+
async def get_all_analog_inputs_async(
|
|
505
|
+
self
|
|
506
|
+
) -> List[float]:
|
|
507
|
+
"""
|
|
508
|
+
Returns the current values of all analog input channels.
|
|
509
|
+
|
|
510
|
+
Returns:
|
|
511
|
+
Measurements of the voltages present on the input channels.
|
|
512
|
+
"""
|
|
513
|
+
request = dto.DeviceGetAllAnalogIORequest(
|
|
514
|
+
interface_id=self._device.connection.interface_id,
|
|
515
|
+
device=self._device.device_address,
|
|
516
|
+
channel_type="ai",
|
|
517
|
+
)
|
|
518
|
+
response = await call_async(
|
|
519
|
+
"device/get_all_analog_io",
|
|
520
|
+
request,
|
|
521
|
+
dto.DeviceGetAllAnalogIOResponse.from_binary)
|
|
522
|
+
return response.values
|
|
523
|
+
|
|
524
|
+
def get_all_analog_outputs(
|
|
525
|
+
self
|
|
526
|
+
) -> List[float]:
|
|
527
|
+
"""
|
|
528
|
+
Returns the current values of all analog output channels.
|
|
529
|
+
|
|
530
|
+
Returns:
|
|
531
|
+
Measurements of voltage that the output channels are conducting.
|
|
532
|
+
"""
|
|
533
|
+
request = dto.DeviceGetAllAnalogIORequest(
|
|
534
|
+
interface_id=self._device.connection.interface_id,
|
|
535
|
+
device=self._device.device_address,
|
|
536
|
+
channel_type="ao",
|
|
537
|
+
)
|
|
538
|
+
response = call(
|
|
539
|
+
"device/get_all_analog_io",
|
|
540
|
+
request,
|
|
541
|
+
dto.DeviceGetAllAnalogIOResponse.from_binary)
|
|
542
|
+
return response.values
|
|
543
|
+
|
|
544
|
+
async def get_all_analog_outputs_async(
|
|
545
|
+
self
|
|
546
|
+
) -> List[float]:
|
|
547
|
+
"""
|
|
548
|
+
Returns the current values of all analog output channels.
|
|
549
|
+
|
|
550
|
+
Returns:
|
|
551
|
+
Measurements of voltage that the output channels are conducting.
|
|
552
|
+
"""
|
|
553
|
+
request = dto.DeviceGetAllAnalogIORequest(
|
|
554
|
+
interface_id=self._device.connection.interface_id,
|
|
555
|
+
device=self._device.device_address,
|
|
556
|
+
channel_type="ao",
|
|
557
|
+
)
|
|
558
|
+
response = await call_async(
|
|
559
|
+
"device/get_all_analog_io",
|
|
560
|
+
request,
|
|
561
|
+
dto.DeviceGetAllAnalogIOResponse.from_binary)
|
|
562
|
+
return response.values
|
|
563
|
+
|
|
564
|
+
def set_digital_output(
|
|
565
|
+
self,
|
|
566
|
+
channel_number: int,
|
|
567
|
+
value: DigitalOutputAction
|
|
568
|
+
) -> None:
|
|
569
|
+
"""
|
|
570
|
+
Sets value for the specified digital output channel.
|
|
571
|
+
|
|
572
|
+
Args:
|
|
573
|
+
channel_number: Channel number starting at 1.
|
|
574
|
+
value: The type of action to perform on the channel.
|
|
575
|
+
"""
|
|
576
|
+
request = dto.DeviceSetDigitalOutputRequest(
|
|
577
|
+
interface_id=self._device.connection.interface_id,
|
|
578
|
+
device=self._device.device_address,
|
|
579
|
+
channel_number=channel_number,
|
|
580
|
+
value=value,
|
|
581
|
+
)
|
|
582
|
+
call("device/set_digital_output", request)
|
|
583
|
+
|
|
584
|
+
async def set_digital_output_async(
|
|
585
|
+
self,
|
|
586
|
+
channel_number: int,
|
|
587
|
+
value: DigitalOutputAction
|
|
588
|
+
) -> None:
|
|
589
|
+
"""
|
|
590
|
+
Sets value for the specified digital output channel.
|
|
591
|
+
|
|
592
|
+
Args:
|
|
593
|
+
channel_number: Channel number starting at 1.
|
|
594
|
+
value: The type of action to perform on the channel.
|
|
595
|
+
"""
|
|
596
|
+
request = dto.DeviceSetDigitalOutputRequest(
|
|
597
|
+
interface_id=self._device.connection.interface_id,
|
|
598
|
+
device=self._device.device_address,
|
|
599
|
+
channel_number=channel_number,
|
|
600
|
+
value=value,
|
|
601
|
+
)
|
|
602
|
+
await call_async("device/set_digital_output", request)
|
|
603
|
+
|
|
604
|
+
def set_all_digital_outputs(
|
|
605
|
+
self,
|
|
606
|
+
values: List[DigitalOutputAction]
|
|
607
|
+
) -> None:
|
|
608
|
+
"""
|
|
609
|
+
Sets values for all digital output channels.
|
|
610
|
+
|
|
611
|
+
Args:
|
|
612
|
+
values: The type of action to perform on the channel.
|
|
613
|
+
"""
|
|
614
|
+
request = dto.DeviceSetAllDigitalOutputsRequest(
|
|
615
|
+
interface_id=self._device.connection.interface_id,
|
|
616
|
+
device=self._device.device_address,
|
|
617
|
+
values=values,
|
|
618
|
+
)
|
|
619
|
+
call("device/set_all_digital_outputs", request)
|
|
620
|
+
|
|
621
|
+
async def set_all_digital_outputs_async(
|
|
622
|
+
self,
|
|
623
|
+
values: List[DigitalOutputAction]
|
|
624
|
+
) -> None:
|
|
625
|
+
"""
|
|
626
|
+
Sets values for all digital output channels.
|
|
627
|
+
|
|
628
|
+
Args:
|
|
629
|
+
values: The type of action to perform on the channel.
|
|
630
|
+
"""
|
|
631
|
+
request = dto.DeviceSetAllDigitalOutputsRequest(
|
|
632
|
+
interface_id=self._device.connection.interface_id,
|
|
633
|
+
device=self._device.device_address,
|
|
634
|
+
values=values,
|
|
635
|
+
)
|
|
636
|
+
await call_async("device/set_all_digital_outputs", request)
|
|
637
|
+
|
|
638
|
+
def set_digital_output_schedule(
|
|
639
|
+
self,
|
|
640
|
+
channel_number: int,
|
|
641
|
+
value: DigitalOutputAction,
|
|
642
|
+
future_value: DigitalOutputAction,
|
|
643
|
+
delay: float,
|
|
644
|
+
unit: TimeUnits = Units.NATIVE
|
|
645
|
+
) -> None:
|
|
646
|
+
"""
|
|
647
|
+
Sets current and future value for the specified digital output channel.
|
|
648
|
+
Requires at least Firmware 7.37.
|
|
649
|
+
|
|
650
|
+
Args:
|
|
651
|
+
channel_number: Channel number starting at 1.
|
|
652
|
+
value: The type of action to perform immediately on the channel.
|
|
653
|
+
future_value: The type of action to perform in the future on the channel.
|
|
654
|
+
delay: Delay between setting current value and setting future value.
|
|
655
|
+
unit: Units of time.
|
|
656
|
+
"""
|
|
657
|
+
if delay <= 0:
|
|
658
|
+
raise ValueError('Delay must be a positive value.')
|
|
659
|
+
|
|
660
|
+
request = dto.DeviceSetDigitalOutputScheduleRequest(
|
|
661
|
+
interface_id=self._device.connection.interface_id,
|
|
662
|
+
device=self._device.device_address,
|
|
663
|
+
channel_number=channel_number,
|
|
664
|
+
value=value,
|
|
665
|
+
future_value=future_value,
|
|
666
|
+
delay=delay,
|
|
667
|
+
unit=unit,
|
|
668
|
+
)
|
|
669
|
+
call("device/set_digital_output_schedule", request)
|
|
670
|
+
|
|
671
|
+
async def set_digital_output_schedule_async(
|
|
672
|
+
self,
|
|
673
|
+
channel_number: int,
|
|
674
|
+
value: DigitalOutputAction,
|
|
675
|
+
future_value: DigitalOutputAction,
|
|
676
|
+
delay: float,
|
|
677
|
+
unit: TimeUnits = Units.NATIVE
|
|
678
|
+
) -> None:
|
|
679
|
+
"""
|
|
680
|
+
Sets current and future value for the specified digital output channel.
|
|
681
|
+
Requires at least Firmware 7.37.
|
|
682
|
+
|
|
683
|
+
Args:
|
|
684
|
+
channel_number: Channel number starting at 1.
|
|
685
|
+
value: The type of action to perform immediately on the channel.
|
|
686
|
+
future_value: The type of action to perform in the future on the channel.
|
|
687
|
+
delay: Delay between setting current value and setting future value.
|
|
688
|
+
unit: Units of time.
|
|
689
|
+
"""
|
|
690
|
+
if delay <= 0:
|
|
691
|
+
raise ValueError('Delay must be a positive value.')
|
|
692
|
+
|
|
693
|
+
request = dto.DeviceSetDigitalOutputScheduleRequest(
|
|
694
|
+
interface_id=self._device.connection.interface_id,
|
|
695
|
+
device=self._device.device_address,
|
|
696
|
+
channel_number=channel_number,
|
|
697
|
+
value=value,
|
|
698
|
+
future_value=future_value,
|
|
699
|
+
delay=delay,
|
|
700
|
+
unit=unit,
|
|
701
|
+
)
|
|
702
|
+
await call_async("device/set_digital_output_schedule", request)
|
|
703
|
+
|
|
704
|
+
def set_all_digital_outputs_schedule(
|
|
705
|
+
self,
|
|
706
|
+
values: List[DigitalOutputAction],
|
|
707
|
+
future_values: List[DigitalOutputAction],
|
|
708
|
+
delay: float,
|
|
709
|
+
unit: TimeUnits = Units.NATIVE
|
|
710
|
+
) -> None:
|
|
711
|
+
"""
|
|
712
|
+
Sets current and future values for all digital output channels.
|
|
713
|
+
Requires at least Firmware 7.37.
|
|
714
|
+
|
|
715
|
+
Args:
|
|
716
|
+
values: The type of actions to perform immediately on output channels.
|
|
717
|
+
future_values: The type of actions to perform in the future on output channels.
|
|
718
|
+
delay: Delay between setting current values and setting future values.
|
|
719
|
+
unit: Units of time.
|
|
720
|
+
"""
|
|
721
|
+
if delay <= 0:
|
|
722
|
+
raise ValueError('Delay must be a positive value.')
|
|
723
|
+
|
|
724
|
+
request = dto.DeviceSetAllDigitalOutputsScheduleRequest(
|
|
725
|
+
interface_id=self._device.connection.interface_id,
|
|
726
|
+
device=self._device.device_address,
|
|
727
|
+
values=values,
|
|
728
|
+
future_values=future_values,
|
|
729
|
+
delay=delay,
|
|
730
|
+
unit=unit,
|
|
731
|
+
)
|
|
732
|
+
call("device/set_all_digital_outputs_schedule", request)
|
|
733
|
+
|
|
734
|
+
async def set_all_digital_outputs_schedule_async(
|
|
735
|
+
self,
|
|
736
|
+
values: List[DigitalOutputAction],
|
|
737
|
+
future_values: List[DigitalOutputAction],
|
|
738
|
+
delay: float,
|
|
739
|
+
unit: TimeUnits = Units.NATIVE
|
|
740
|
+
) -> None:
|
|
741
|
+
"""
|
|
742
|
+
Sets current and future values for all digital output channels.
|
|
743
|
+
Requires at least Firmware 7.37.
|
|
744
|
+
|
|
745
|
+
Args:
|
|
746
|
+
values: The type of actions to perform immediately on output channels.
|
|
747
|
+
future_values: The type of actions to perform in the future on output channels.
|
|
748
|
+
delay: Delay between setting current values and setting future values.
|
|
749
|
+
unit: Units of time.
|
|
750
|
+
"""
|
|
751
|
+
if delay <= 0:
|
|
752
|
+
raise ValueError('Delay must be a positive value.')
|
|
753
|
+
|
|
754
|
+
request = dto.DeviceSetAllDigitalOutputsScheduleRequest(
|
|
755
|
+
interface_id=self._device.connection.interface_id,
|
|
756
|
+
device=self._device.device_address,
|
|
757
|
+
values=values,
|
|
758
|
+
future_values=future_values,
|
|
759
|
+
delay=delay,
|
|
760
|
+
unit=unit,
|
|
761
|
+
)
|
|
762
|
+
await call_async("device/set_all_digital_outputs_schedule", request)
|
|
763
|
+
|
|
764
|
+
def set_analog_output(
|
|
765
|
+
self,
|
|
766
|
+
channel_number: int,
|
|
767
|
+
value: float
|
|
768
|
+
) -> None:
|
|
769
|
+
"""
|
|
770
|
+
Sets value for the specified analog output channel.
|
|
771
|
+
|
|
772
|
+
Args:
|
|
773
|
+
channel_number: Channel number starting at 1.
|
|
774
|
+
value: Value to set the output channel voltage to.
|
|
775
|
+
"""
|
|
776
|
+
request = dto.DeviceSetAnalogOutputRequest(
|
|
777
|
+
interface_id=self._device.connection.interface_id,
|
|
778
|
+
device=self._device.device_address,
|
|
779
|
+
channel_number=channel_number,
|
|
780
|
+
value=value,
|
|
781
|
+
)
|
|
782
|
+
call("device/set_analog_output", request)
|
|
783
|
+
|
|
784
|
+
async def set_analog_output_async(
|
|
785
|
+
self,
|
|
786
|
+
channel_number: int,
|
|
787
|
+
value: float
|
|
788
|
+
) -> None:
|
|
789
|
+
"""
|
|
790
|
+
Sets value for the specified analog output channel.
|
|
791
|
+
|
|
792
|
+
Args:
|
|
793
|
+
channel_number: Channel number starting at 1.
|
|
794
|
+
value: Value to set the output channel voltage to.
|
|
795
|
+
"""
|
|
796
|
+
request = dto.DeviceSetAnalogOutputRequest(
|
|
797
|
+
interface_id=self._device.connection.interface_id,
|
|
798
|
+
device=self._device.device_address,
|
|
799
|
+
channel_number=channel_number,
|
|
800
|
+
value=value,
|
|
801
|
+
)
|
|
802
|
+
await call_async("device/set_analog_output", request)
|
|
803
|
+
|
|
804
|
+
def set_all_analog_outputs(
|
|
805
|
+
self,
|
|
806
|
+
values: List[float]
|
|
807
|
+
) -> None:
|
|
808
|
+
"""
|
|
809
|
+
Sets values for all analog output channels.
|
|
810
|
+
|
|
811
|
+
Args:
|
|
812
|
+
values: Voltage values to set the output channels to.
|
|
813
|
+
"""
|
|
814
|
+
request = dto.DeviceSetAllAnalogOutputsRequest(
|
|
815
|
+
interface_id=self._device.connection.interface_id,
|
|
816
|
+
device=self._device.device_address,
|
|
817
|
+
values=values,
|
|
818
|
+
)
|
|
819
|
+
call("device/set_all_analog_outputs", request)
|
|
820
|
+
|
|
821
|
+
async def set_all_analog_outputs_async(
|
|
822
|
+
self,
|
|
823
|
+
values: List[float]
|
|
824
|
+
) -> None:
|
|
825
|
+
"""
|
|
826
|
+
Sets values for all analog output channels.
|
|
827
|
+
|
|
828
|
+
Args:
|
|
829
|
+
values: Voltage values to set the output channels to.
|
|
830
|
+
"""
|
|
831
|
+
request = dto.DeviceSetAllAnalogOutputsRequest(
|
|
832
|
+
interface_id=self._device.connection.interface_id,
|
|
833
|
+
device=self._device.device_address,
|
|
834
|
+
values=values,
|
|
835
|
+
)
|
|
836
|
+
await call_async("device/set_all_analog_outputs", request)
|
|
837
|
+
|
|
838
|
+
def set_analog_output_schedule(
|
|
839
|
+
self,
|
|
840
|
+
channel_number: int,
|
|
841
|
+
value: float,
|
|
842
|
+
future_value: float,
|
|
843
|
+
delay: float,
|
|
844
|
+
unit: TimeUnits = Units.NATIVE
|
|
845
|
+
) -> None:
|
|
846
|
+
"""
|
|
847
|
+
Sets current and future value for the specified analog output channel.
|
|
848
|
+
Requires at least Firmware 7.38.
|
|
849
|
+
|
|
850
|
+
Args:
|
|
851
|
+
channel_number: Channel number starting at 1.
|
|
852
|
+
value: Value to set the output channel voltage to immediately.
|
|
853
|
+
future_value: Value to set the output channel voltage to in the future.
|
|
854
|
+
delay: Delay between setting current value and setting future value.
|
|
855
|
+
unit: Units of time.
|
|
856
|
+
"""
|
|
857
|
+
if delay <= 0:
|
|
858
|
+
raise ValueError('Delay must be a positive value.')
|
|
859
|
+
|
|
860
|
+
request = dto.DeviceSetAnalogOutputScheduleRequest(
|
|
861
|
+
interface_id=self._device.connection.interface_id,
|
|
862
|
+
device=self._device.device_address,
|
|
863
|
+
channel_number=channel_number,
|
|
864
|
+
value=value,
|
|
865
|
+
future_value=future_value,
|
|
866
|
+
delay=delay,
|
|
867
|
+
unit=unit,
|
|
868
|
+
)
|
|
869
|
+
call("device/set_analog_output_schedule", request)
|
|
870
|
+
|
|
871
|
+
async def set_analog_output_schedule_async(
|
|
872
|
+
self,
|
|
873
|
+
channel_number: int,
|
|
874
|
+
value: float,
|
|
875
|
+
future_value: float,
|
|
876
|
+
delay: float,
|
|
877
|
+
unit: TimeUnits = Units.NATIVE
|
|
878
|
+
) -> None:
|
|
879
|
+
"""
|
|
880
|
+
Sets current and future value for the specified analog output channel.
|
|
881
|
+
Requires at least Firmware 7.38.
|
|
882
|
+
|
|
883
|
+
Args:
|
|
884
|
+
channel_number: Channel number starting at 1.
|
|
885
|
+
value: Value to set the output channel voltage to immediately.
|
|
886
|
+
future_value: Value to set the output channel voltage to in the future.
|
|
887
|
+
delay: Delay between setting current value and setting future value.
|
|
888
|
+
unit: Units of time.
|
|
889
|
+
"""
|
|
890
|
+
if delay <= 0:
|
|
891
|
+
raise ValueError('Delay must be a positive value.')
|
|
892
|
+
|
|
893
|
+
request = dto.DeviceSetAnalogOutputScheduleRequest(
|
|
894
|
+
interface_id=self._device.connection.interface_id,
|
|
895
|
+
device=self._device.device_address,
|
|
896
|
+
channel_number=channel_number,
|
|
897
|
+
value=value,
|
|
898
|
+
future_value=future_value,
|
|
899
|
+
delay=delay,
|
|
900
|
+
unit=unit,
|
|
901
|
+
)
|
|
902
|
+
await call_async("device/set_analog_output_schedule", request)
|
|
903
|
+
|
|
904
|
+
def set_all_analog_outputs_schedule(
|
|
905
|
+
self,
|
|
906
|
+
values: List[float],
|
|
907
|
+
future_values: List[float],
|
|
908
|
+
delay: float,
|
|
909
|
+
unit: TimeUnits = Units.NATIVE
|
|
910
|
+
) -> None:
|
|
911
|
+
"""
|
|
912
|
+
Sets current and future values for all analog output channels.
|
|
913
|
+
Requires at least Firmware 7.38.
|
|
914
|
+
|
|
915
|
+
Args:
|
|
916
|
+
values: Voltage values to set the output channels to immediately.
|
|
917
|
+
future_values: Voltage values to set the output channels to in the future.
|
|
918
|
+
delay: Delay between setting current values and setting future values.
|
|
919
|
+
unit: Units of time.
|
|
920
|
+
"""
|
|
921
|
+
if delay <= 0:
|
|
922
|
+
raise ValueError('Delay must be a positive value.')
|
|
923
|
+
|
|
924
|
+
request = dto.DeviceSetAllAnalogOutputsScheduleRequest(
|
|
925
|
+
interface_id=self._device.connection.interface_id,
|
|
926
|
+
device=self._device.device_address,
|
|
927
|
+
values=values,
|
|
928
|
+
future_values=future_values,
|
|
929
|
+
delay=delay,
|
|
930
|
+
unit=unit,
|
|
931
|
+
)
|
|
932
|
+
call("device/set_all_analog_outputs_schedule", request)
|
|
933
|
+
|
|
934
|
+
async def set_all_analog_outputs_schedule_async(
|
|
935
|
+
self,
|
|
936
|
+
values: List[float],
|
|
937
|
+
future_values: List[float],
|
|
938
|
+
delay: float,
|
|
939
|
+
unit: TimeUnits = Units.NATIVE
|
|
940
|
+
) -> None:
|
|
941
|
+
"""
|
|
942
|
+
Sets current and future values for all analog output channels.
|
|
943
|
+
Requires at least Firmware 7.38.
|
|
944
|
+
|
|
945
|
+
Args:
|
|
946
|
+
values: Voltage values to set the output channels to immediately.
|
|
947
|
+
future_values: Voltage values to set the output channels to in the future.
|
|
948
|
+
delay: Delay between setting current values and setting future values.
|
|
949
|
+
unit: Units of time.
|
|
950
|
+
"""
|
|
951
|
+
if delay <= 0:
|
|
952
|
+
raise ValueError('Delay must be a positive value.')
|
|
953
|
+
|
|
954
|
+
request = dto.DeviceSetAllAnalogOutputsScheduleRequest(
|
|
955
|
+
interface_id=self._device.connection.interface_id,
|
|
956
|
+
device=self._device.device_address,
|
|
957
|
+
values=values,
|
|
958
|
+
future_values=future_values,
|
|
959
|
+
delay=delay,
|
|
960
|
+
unit=unit,
|
|
961
|
+
)
|
|
962
|
+
await call_async("device/set_all_analog_outputs_schedule", request)
|
|
963
|
+
|
|
964
|
+
def set_analog_input_lowpass_filter(
|
|
965
|
+
self,
|
|
966
|
+
channel_number: int,
|
|
967
|
+
cutoff_frequency: float,
|
|
968
|
+
unit: FrequencyUnits = Units.NATIVE
|
|
969
|
+
) -> None:
|
|
970
|
+
"""
|
|
971
|
+
Sets the cutoff frequency of the low-pass filter for the specified analog input channel.
|
|
972
|
+
Set the frequency to 0 to disable the filter.
|
|
973
|
+
|
|
974
|
+
Args:
|
|
975
|
+
channel_number: Channel number starting at 1.
|
|
976
|
+
cutoff_frequency: Cutoff frequency of the low-pass filter.
|
|
977
|
+
unit: Units of frequency.
|
|
978
|
+
"""
|
|
979
|
+
request = dto.DeviceSetLowpassFilterRequest(
|
|
980
|
+
interface_id=self._device.connection.interface_id,
|
|
981
|
+
device=self._device.device_address,
|
|
982
|
+
channel_number=channel_number,
|
|
983
|
+
cutoff_frequency=cutoff_frequency,
|
|
984
|
+
unit=unit,
|
|
985
|
+
)
|
|
986
|
+
call("device/set_lowpass_filter", request)
|
|
987
|
+
|
|
988
|
+
async def set_analog_input_lowpass_filter_async(
|
|
989
|
+
self,
|
|
990
|
+
channel_number: int,
|
|
991
|
+
cutoff_frequency: float,
|
|
992
|
+
unit: FrequencyUnits = Units.NATIVE
|
|
993
|
+
) -> None:
|
|
994
|
+
"""
|
|
995
|
+
Sets the cutoff frequency of the low-pass filter for the specified analog input channel.
|
|
996
|
+
Set the frequency to 0 to disable the filter.
|
|
997
|
+
|
|
998
|
+
Args:
|
|
999
|
+
channel_number: Channel number starting at 1.
|
|
1000
|
+
cutoff_frequency: Cutoff frequency of the low-pass filter.
|
|
1001
|
+
unit: Units of frequency.
|
|
1002
|
+
"""
|
|
1003
|
+
request = dto.DeviceSetLowpassFilterRequest(
|
|
1004
|
+
interface_id=self._device.connection.interface_id,
|
|
1005
|
+
device=self._device.device_address,
|
|
1006
|
+
channel_number=channel_number,
|
|
1007
|
+
cutoff_frequency=cutoff_frequency,
|
|
1008
|
+
unit=unit,
|
|
1009
|
+
)
|
|
1010
|
+
await call_async("device/set_lowpass_filter", request)
|
|
1011
|
+
|
|
1012
|
+
def cancel_digital_output_schedule(
|
|
1013
|
+
self,
|
|
1014
|
+
channel_number: int
|
|
1015
|
+
) -> None:
|
|
1016
|
+
"""
|
|
1017
|
+
Cancels a scheduled digital output action.
|
|
1018
|
+
Requires at least Firmware 7.37.
|
|
1019
|
+
|
|
1020
|
+
Args:
|
|
1021
|
+
channel_number: Channel number starting at 1.
|
|
1022
|
+
"""
|
|
1023
|
+
request = dto.DeviceCancelOutputScheduleRequest(
|
|
1024
|
+
interface_id=self._device.connection.interface_id,
|
|
1025
|
+
device=self._device.device_address,
|
|
1026
|
+
analog=False,
|
|
1027
|
+
channel_number=channel_number,
|
|
1028
|
+
)
|
|
1029
|
+
call("device/cancel_output_schedule", request)
|
|
1030
|
+
|
|
1031
|
+
async def cancel_digital_output_schedule_async(
|
|
1032
|
+
self,
|
|
1033
|
+
channel_number: int
|
|
1034
|
+
) -> None:
|
|
1035
|
+
"""
|
|
1036
|
+
Cancels a scheduled digital output action.
|
|
1037
|
+
Requires at least Firmware 7.37.
|
|
1038
|
+
|
|
1039
|
+
Args:
|
|
1040
|
+
channel_number: Channel number starting at 1.
|
|
1041
|
+
"""
|
|
1042
|
+
request = dto.DeviceCancelOutputScheduleRequest(
|
|
1043
|
+
interface_id=self._device.connection.interface_id,
|
|
1044
|
+
device=self._device.device_address,
|
|
1045
|
+
analog=False,
|
|
1046
|
+
channel_number=channel_number,
|
|
1047
|
+
)
|
|
1048
|
+
await call_async("device/cancel_output_schedule", request)
|
|
1049
|
+
|
|
1050
|
+
def cancel_all_digital_outputs_schedule(
|
|
1051
|
+
self,
|
|
1052
|
+
channels: List[bool] = []
|
|
1053
|
+
) -> None:
|
|
1054
|
+
"""
|
|
1055
|
+
Cancel all scheduled digital output actions.
|
|
1056
|
+
Requires at least Firmware 7.37.
|
|
1057
|
+
|
|
1058
|
+
Args:
|
|
1059
|
+
channels: Optionally specify which channels to cancel.
|
|
1060
|
+
Array length must be empty or equal to the number of channels on device.
|
|
1061
|
+
Specifying "True" for a channel will cancel the scheduled digital output action for that channel.
|
|
1062
|
+
"""
|
|
1063
|
+
request = dto.DeviceCancelAllOutputsScheduleRequest(
|
|
1064
|
+
interface_id=self._device.connection.interface_id,
|
|
1065
|
+
device=self._device.device_address,
|
|
1066
|
+
analog=False,
|
|
1067
|
+
channels=channels,
|
|
1068
|
+
)
|
|
1069
|
+
call("device/cancel_all_outputs_schedule", request)
|
|
1070
|
+
|
|
1071
|
+
async def cancel_all_digital_outputs_schedule_async(
|
|
1072
|
+
self,
|
|
1073
|
+
channels: List[bool] = []
|
|
1074
|
+
) -> None:
|
|
1075
|
+
"""
|
|
1076
|
+
Cancel all scheduled digital output actions.
|
|
1077
|
+
Requires at least Firmware 7.37.
|
|
1078
|
+
|
|
1079
|
+
Args:
|
|
1080
|
+
channels: Optionally specify which channels to cancel.
|
|
1081
|
+
Array length must be empty or equal to the number of channels on device.
|
|
1082
|
+
Specifying "True" for a channel will cancel the scheduled digital output action for that channel.
|
|
1083
|
+
"""
|
|
1084
|
+
request = dto.DeviceCancelAllOutputsScheduleRequest(
|
|
1085
|
+
interface_id=self._device.connection.interface_id,
|
|
1086
|
+
device=self._device.device_address,
|
|
1087
|
+
analog=False,
|
|
1088
|
+
channels=channels,
|
|
1089
|
+
)
|
|
1090
|
+
await call_async("device/cancel_all_outputs_schedule", request)
|
|
1091
|
+
|
|
1092
|
+
def cancel_analog_output_schedule(
|
|
1093
|
+
self,
|
|
1094
|
+
channel_number: int
|
|
1095
|
+
) -> None:
|
|
1096
|
+
"""
|
|
1097
|
+
Cancels a scheduled analog output value.
|
|
1098
|
+
Requires at least Firmware 7.38.
|
|
1099
|
+
|
|
1100
|
+
Args:
|
|
1101
|
+
channel_number: Channel number starting at 1.
|
|
1102
|
+
"""
|
|
1103
|
+
request = dto.DeviceCancelOutputScheduleRequest(
|
|
1104
|
+
interface_id=self._device.connection.interface_id,
|
|
1105
|
+
device=self._device.device_address,
|
|
1106
|
+
analog=True,
|
|
1107
|
+
channel_number=channel_number,
|
|
1108
|
+
)
|
|
1109
|
+
call("device/cancel_output_schedule", request)
|
|
1110
|
+
|
|
1111
|
+
async def cancel_analog_output_schedule_async(
|
|
1112
|
+
self,
|
|
1113
|
+
channel_number: int
|
|
1114
|
+
) -> None:
|
|
1115
|
+
"""
|
|
1116
|
+
Cancels a scheduled analog output value.
|
|
1117
|
+
Requires at least Firmware 7.38.
|
|
1118
|
+
|
|
1119
|
+
Args:
|
|
1120
|
+
channel_number: Channel number starting at 1.
|
|
1121
|
+
"""
|
|
1122
|
+
request = dto.DeviceCancelOutputScheduleRequest(
|
|
1123
|
+
interface_id=self._device.connection.interface_id,
|
|
1124
|
+
device=self._device.device_address,
|
|
1125
|
+
analog=True,
|
|
1126
|
+
channel_number=channel_number,
|
|
1127
|
+
)
|
|
1128
|
+
await call_async("device/cancel_output_schedule", request)
|
|
1129
|
+
|
|
1130
|
+
def cancel_all_analog_outputs_schedule(
|
|
1131
|
+
self,
|
|
1132
|
+
channels: List[bool] = []
|
|
1133
|
+
) -> None:
|
|
1134
|
+
"""
|
|
1135
|
+
Cancel all scheduled analog output actions.
|
|
1136
|
+
Requires at least Firmware 7.38.
|
|
1137
|
+
|
|
1138
|
+
Args:
|
|
1139
|
+
channels: Optionally specify which channels to cancel.
|
|
1140
|
+
Array length must be empty or equal to the number of channels on device.
|
|
1141
|
+
Specifying "True" for a channel will cancel the scheduled analog output value for that channel.
|
|
1142
|
+
"""
|
|
1143
|
+
request = dto.DeviceCancelAllOutputsScheduleRequest(
|
|
1144
|
+
interface_id=self._device.connection.interface_id,
|
|
1145
|
+
device=self._device.device_address,
|
|
1146
|
+
analog=True,
|
|
1147
|
+
channels=channels,
|
|
1148
|
+
)
|
|
1149
|
+
call("device/cancel_all_outputs_schedule", request)
|
|
1150
|
+
|
|
1151
|
+
async def cancel_all_analog_outputs_schedule_async(
|
|
1152
|
+
self,
|
|
1153
|
+
channels: List[bool] = []
|
|
1154
|
+
) -> None:
|
|
1155
|
+
"""
|
|
1156
|
+
Cancel all scheduled analog output actions.
|
|
1157
|
+
Requires at least Firmware 7.38.
|
|
1158
|
+
|
|
1159
|
+
Args:
|
|
1160
|
+
channels: Optionally specify which channels to cancel.
|
|
1161
|
+
Array length must be empty or equal to the number of channels on device.
|
|
1162
|
+
Specifying "True" for a channel will cancel the scheduled analog output value for that channel.
|
|
1163
|
+
"""
|
|
1164
|
+
request = dto.DeviceCancelAllOutputsScheduleRequest(
|
|
1165
|
+
interface_id=self._device.connection.interface_id,
|
|
1166
|
+
device=self._device.device_address,
|
|
1167
|
+
analog=True,
|
|
1168
|
+
channels=channels,
|
|
1169
|
+
)
|
|
1170
|
+
await call_async("device/cancel_all_outputs_schedule", request)
|