-
Python 미니프로그램 내장 함수design 2026. 2. 2. 09:21
TSMaster Python API Reference
생성일: 2026-02-02
도구: TSMaster
언어: Python통계
- 전체 API 개수: 473
- 카테고리: 3
- 매칭 성공: 461
- 프로토타입만: 12
- 상세정보만: 0
Table of Contents
1. app (260 APIs)
- 1.1 add_application
- 1.2 add_direct_mapping_can
- 1.3 add_direct_mapping_with_factor_offset_can
- 1.4 add_expression_mapping
- 1.5 add_path_to_environment
- 1.6 add_system_constant
- 1.7 am_get_running_state
- 1.8 am_run
- 1.9 am_select_sub_module
- 1.10 am_stop
- 1.11 call_library_api
- 1.12 call_mini_program_api
- 1.13 call_system_api
- 1.14 check
- 1.15 check_terminate
- 1.16 clear_measurement_form
- 1.17 configure_can_baudrate
- 1.18 configure_canfd_baudrate
- 1.19 configure_lin_baudrate
- 1.20 connect
- 1.21 create_system_var
- 1.22 debug_log
- 1.23 del_application
- 1.24 del_mapping
- 1.25 delete_path_from_environment
- 1.26 delete_symbol_mapping_item
- 1.27 delete_symbol_mapping_items
- 1.28 delete_system_constant
- 1.29 delete_system_var
- 1.30 directory_exists
- 1.31 disconnect
- 1.32 enable_all_graphics
- 1.33 enable_symbol_mapping_engine
- 1.34 enable_symbol_mapping_item
- 1.35 end_log
- 1.36 excel_get_cell_count
- 1.37 excel_get_cell_value
- 1.38 excel_get_sheet_count
- 1.39 excel_get_sheet_name
- 1.40 excel_load
- 1.41 excel_set_cell_count
- 1.42 excel_set_cell_value
- 1.43 excel_set_sheet_count
- 1.44 excel_set_sheet_name
- 1.45 excel_unload
- 1.46 excel_unload_all
- 1.47 execute_app
- 1.48 execute_python_script
- 1.49 execute_python_string
- 1.50 force_directory
- 1.51 get_application_list
- 1.52 get_can_channel_count
- 1.53 get_configuration_file_name
- 1.54 get_configuration_file_path
- 1.55 get_constant_double
- 1.56 get_current_application
- 1.57 get_custom_components_dir
- 1.58 get_doc_path
- 1.59 get_error_description
- 1.60 get_flexray_channel_count
- 1.61 get_hardware_id_array
- 1.62 get_hardware_id_string
- 1.63 get_host_app_path
- 1.64 get_lin_channel_count
- 1.65 get_main_window_handle
- 1.66 get_mapping
- 1.67 get_system_var_address
- 1.68 get_system_var_def_by_index
- 1.69 get_system_var_def_by_name
- 1.70 get_system_var_generic
- 1.71 get_system_var_internal_count
- 1.72 get_system_var_logging
- 1.73 get_system_var_user_count
- 1.74 get_system_var_value
- 1.75 get_timestamp_us
- 1.76 get_tsmaster_version
- 1.77 get_turbo_mode
- 1.78 ini_close
- 1.79 ini_create
- 1.80 ini_delete_key
- 1.81 ini_delete_section
- 1.82 ini_key_exists
- 1.83 ini_read_bool
- 1.84 ini_read_float
- 1.85 ini_read_int32
- 1.86 ini_read_int64
- 1.87 ini_read_string
- 1.88 ini_section_exists
- 1.89 ini_write_bool
- 1.90 ini_write_float
- 1.91 ini_write_int32
- 1.92 ini_write_int64
- 1.93 ini_write_string
- 1.94 is_connected
- 1.95 is_tsmaster_host
- 1.96 load_plugin
- 1.97 load_symbol_mapping_settings
- 1.98 log_text
- 1.99 make_toast
- 1.100 mini_delay_cpu
- 1.101 open_directory_and_select_file
- 1.102 open_help_doc
- 1.103 panel_get_bkgd_color
- 1.104 panel_get_enable
- 1.105 panel_get_opacity
- 1.106 panel_get_position_xy
- 1.107 panel_get_rotation_angle
- 1.108 panel_get_rotation_center
- 1.109 panel_get_scale_xy
- 1.110 panel_get_selector_items
- 1.111 panel_get_width_height
- 1.112 panel_set_bkgd_color
- 1.113 panel_set_enable
- 1.114 panel_set_height
- 1.115 panel_set_opacity
- 1.116 panel_set_position_x
- 1.117 panel_set_position_xy
- 1.118 panel_set_position_y
- 1.119 panel_set_rotation_angle
- 1.120 panel_set_rotation_center
- 1.121 panel_set_scale_x
- 1.122 panel_set_scale_y
- 1.123 panel_set_selector_items
- 1.124 panel_set_width
- 1.125 panel_set_width_height
- 1.126 pause
- 1.127 play_sound
- 1.128 print_delta_time
- 1.129 print_system_var_value
- 1.130 prompt_user_input_string
- 1.131 prompt_user_input_value
- 1.132 read_mat_file_end
- 1.133 read_mat_file_start
- 1.134 read_mat_file_variable_count
- 1.135 read_mat_file_variable_double
- 1.136 read_mat_file_variable_string
- 1.137 read_text_file_end
- 1.138 read_text_file_line
- 1.139 read_text_file_start
- 1.140 run_form
- 1.141 run_python_script
- 1.142 save_screenshot
- 1.143 save_symbol_mapping_settings
- 1.144 set_analysis_time_range
- 1.145 set_can_channel_count
- 1.146 set_check_failed_terminate
- 1.147 set_current_application
- 1.148 set_default_output_dir
- 1.149 set_flexray_channel_count
- 1.150 set_lin_channel_count
- 1.151 set_mapping
- 1.152 set_system_var_double
- 1.153 set_system_var_double_array
- 1.154 set_system_var_double_array_async
- 1.155 set_system_var_double_async
- 1.156 set_system_var_generic
- 1.157 set_system_var_generic_async
- 1.158 set_system_var_int32
- 1.159 set_system_var_int32_array
- 1.160 set_system_var_int32_array_async
- 1.161 set_system_var_int32_async
- 1.162 set_system_var_int64_array_from_string
- 1.163 set_system_var_int64_array_from_string_async
- 1.164 set_system_var_int64_from_string
- 1.165 set_system_var_int64_from_string_async
- 1.166 set_system_var_logging
- 1.167 set_system_var_string
- 1.168 set_system_var_string_async
- 1.169 set_system_var_uint32
- 1.170 set_system_var_uint32_async
- 1.171 set_system_var_uint64_from_string
- 1.172 set_system_var_uint64_from_string_async
- 1.173 set_system_var_uint8_array
- 1.174 set_system_var_uint8_array_async
- 1.175 set_system_var_unit
- 1.176 set_system_var_value_table
- 1.177 set_thread_priority
- 1.178 set_turbo_mode
- 1.179 show_confirm_dialog
- 1.180 show_window_system_messages
- 1.181 start_log
- 1.182 stim_get_signal_status
- 1.183 stim_set_signal_status
- 1.184 stop_form
- 1.185 terminate_app_by_name
- 1.186 terminate_application
- 1.187 tsdb_get_can_db_count
- 1.188 tsdb_get_can_db_properties_by_address
- 1.189 tsdb_get_can_db_properties_by_index
- 1.190 tsdb_get_can_ecu_properties_by_address
- 1.191 tsdb_get_can_ecu_properties_by_index
- 1.192 tsdb_get_can_frame_properties_by_address
- 1.193 tsdb_get_can_frame_properties_by_db_index
- 1.194 tsdb_get_can_frame_properties_by_index
- 1.195 tsdb_get_can_signal_properties_by_address
- 1.196 tsdb_get_can_signal_properties_by_db_index
- 1.197 tsdb_get_can_signal_properties_by_frame_index
- 1.198 tsdb_get_can_signal_properties_by_index
- 1.199 tsdb_get_flexray_db_count
- 1.200 tsdb_get_flexray_db_properties_by_address
- 1.201 tsdb_get_flexray_db_properties_by_index
- 1.202 tsdb_get_flexray_ecu_properties_by_address
- 1.203 tsdb_get_flexray_ecu_properties_by_index
- 1.204 tsdb_get_flexray_frame_properties_by_address
- 1.205 tsdb_get_flexray_frame_properties_by_db_index
- 1.206 tsdb_get_flexray_frame_properties_by_index
- 1.207 tsdb_get_flexray_signal_properties_by_address
- 1.208 tsdb_get_flexray_signal_properties_by_db_index
- 1.209 tsdb_get_flexray_signal_properties_by_frame_index
- 1.210 tsdb_get_flexray_signal_properties_by_index
- 1.211 tsdb_get_lin_db_count
- 1.212 tsdb_get_lin_db_properties_by_address
- 1.213 tsdb_get_lin_db_properties_by_index
- 1.214 tsdb_get_lin_ecu_properties_by_address
- 1.215 tsdb_get_lin_ecu_properties_by_index
- 1.216 tsdb_get_lin_frame_properties_by_address
- 1.217 tsdb_get_lin_frame_properties_by_db_index
- 1.218 tsdb_get_lin_frame_properties_by_index
- 1.219 tsdb_get_lin_signal_properties_by_address
- 1.220 tsdb_get_lin_signal_properties_by_db_index
- 1.221 tsdb_get_lin_signal_properties_by_frame_index
- 1.222 tsdb_get_lin_signal_properties_by_index
- 1.223 tsdb_load_can_db
- 1.224 tsdb_load_flexray_db
- 1.225 tsdb_load_lin_db
- 1.226 tsdb_unload_can_db
- 1.227 tsdb_unload_can_dbs
- 1.228 tsdb_unload_flexray_db
- 1.229 tsdb_unload_flexray_dbs
- 1.230 tsdb_unload_lin_db
- 1.231 tsdb_unload_lin_dbs
- 1.232 ui_get_component
- 1.233 ui_get_form_unique_id
- 1.234 ui_kill_form
- 1.235 ui_panel_clear_control
- 1.236 ui_place_form
- 1.237 ui_set_form_unique_id
- 1.238 ui_show_form
- 1.239 ui_show_open_file_dialog
- 1.240 ui_show_page_by_index
- 1.241 ui_show_page_by_name
- 1.242 ui_show_save_file_dialog
- 1.243 ui_show_select_directory_dialog
- 1.244 ui_toggle_mdi_form
- 1.245 unload_plugin
- 1.246 wait
- 1.247 wait_system_var
- 1.248 wait_system_var_disappear
- 1.249 wait_system_var_existance
- 1.250 write_mat_file_end
- 1.251 write_mat_file_start
- 1.252 write_mat_file_variable_double
- 1.253 write_mat_file_variable_double_array
- 1.254 write_mat_file_variable_string
- 1.255 write_realtime_comment
- 1.256 write_text_file_end
- 1.257 write_text_file_line
- 1.258 write_text_file_line_double_array
- 1.259 write_text_file_line_string_array
- 1.260 write_text_file_start
2. com (176 APIs)
- 2.1 add_cyclic_message_can
- 2.2 block_current_pretx
- 2.3 can_pdu_container_get_cycle_by_index
- 2.4 can_pdu_container_get_cycle_count
- 2.5 can_pdu_container_refresh
- 2.6 can_pdu_container_set_cycle_by_index
- 2.7 can_pdu_container_set_cycle_count
- 2.8 can_rbs_activate_all_networks
- 2.9 can_rbs_activate_message_by_name
- 2.10 can_rbs_activate_network_by_name
- 2.11 can_rbs_activate_node_by_name
- 2.12 can_rbs_batch_set_end
- 2.13 can_rbs_batch_set_signal
- 2.14 can_rbs_batch_set_start
- 2.15 can_rbs_configure
- 2.16 can_rbs_enable
- 2.17 can_rbs_fault_inject_clear
- 2.18 can_rbs_fault_inject_message_lost
- 2.19 can_rbs_fault_inject_signal_alter
- 2.20 can_rbs_get_signal_value_by_address
- 2.21 can_rbs_get_signal_value_by_element
- 2.22 can_rbs_is_running
- 2.23 can_rbs_set_crc_signal
- 2.24 can_rbs_set_message_cycle_by_name
- 2.25 can_rbs_set_message_direction
- 2.26 can_rbs_set_normal_signal
- 2.27 can_rbs_set_rc_signal
- 2.28 can_rbs_set_rc_signal_with_limit
- 2.29 can_rbs_set_signal_value_by_address
- 2.30 can_rbs_set_signal_value_by_element
- 2.31 can_rbs_start
- 2.32 can_rbs_stop
- 2.33 clear_bus_statistics
- 2.34 del_cyclic_message_can
- 2.35 del_cyclic_messages
- 2.36 enable_bus_statistics
- 2.37 flexray_rbs_activate_all_clusters
- 2.38 flexray_rbs_activate_cluster_by_name
- 2.39 flexray_rbs_activate_ecu_by_name
- 2.40 flexray_rbs_activate_frame_by_name
- 2.41 flexray_rbs_batch_set_end
- 2.42 flexray_rbs_batch_set_signal
- 2.43 flexray_rbs_batch_set_start
- 2.44 flexray_rbs_configure
- 2.45 flexray_rbs_enable
- 2.46 flexray_rbs_get_signal_value_by_address
- 2.47 flexray_rbs_get_signal_value_by_element
- 2.48 flexray_rbs_is_running
- 2.49 flexray_rbs_set_crc_signal
- 2.50 flexray_rbs_set_frame_direction
- 2.51 flexray_rbs_set_normal_signal
- 2.52 flexray_rbs_set_rc_signal
- 2.53 flexray_rbs_set_rc_signal_with_limit
- 2.54 flexray_rbs_set_signal_value_by_address
- 2.55 flexray_rbs_set_signal_value_by_element
- 2.56 flexray_rbs_start
- 2.57 flexray_rbs_stop
- 2.58 flexray_rbs_update_frame_by_header
- 2.59 get_bus_statistics
- 2.60 get_can_signal_value
- 2.61 get_flexray_signal_value
- 2.62 get_fps_can
- 2.63 get_fps_canfd
- 2.64 get_fps_lin
- 2.65 get_lin_signal_value
- 2.66 inject_can_message
- 2.67 inject_flexray_frame
- 2.68 inject_lin_message
- 2.69 ioip_connect_tcp_server
- 2.70 ioip_connect_udp_server
- 2.71 ioip_create
- 2.72 ioip_delete
- 2.73 ioip_disconnect_tcp_server
- 2.74 ioip_enable_tcp_server
- 2.75 ioip_enable_udp_server
- 2.76 ioip_receive_tcp_client_response
- 2.77 ioip_receive_udp_client_response
- 2.78 ioip_send_buffer_tcp
- 2.79 ioip_send_buffer_udp
- 2.80 ioip_send_tcp_server_response
- 2.81 ioip_send_udp_broadcast
- 2.82 ioip_send_udp_server_response
- 2.83 ioip_set_udp_server_buffer_size
- 2.84 j1939_extract_id
- 2.85 j1939_get_destination
- 2.86 j1939_get_dp
- 2.87 j1939_get_edp
- 2.88 j1939_get_last_pdu
- 2.89 j1939_get_last_pdu_as_string
- 2.90 j1939_get_pgn
- 2.91 j1939_get_priority
- 2.92 j1939_get_r
- 2.93 j1939_get_source
- 2.94 j1939_make_id
- 2.95 j1939_set_destination
- 2.96 j1939_set_dp
- 2.97 j1939_set_edp
- 2.98 j1939_set_pgn
- 2.99 j1939_set_priority
- 2.100 j1939_set_r
- 2.101 j1939_set_source
- 2.102 j1939_transmit_pdu_as_string_async
- 2.103 j1939_transmit_pdu_as_string_sync
- 2.104 j1939_transmit_pdu_async
- 2.105 j1939_transmit_pdu_sync
- 2.106 lin_rbs_activate_all_networks
- 2.107 lin_rbs_activate_message_by_name
- 2.108 lin_rbs_activate_network_by_name
- 2.109 lin_rbs_activate_node_by_name
- 2.110 lin_rbs_batch_set_end
- 2.111 lin_rbs_batch_set_signal
- 2.112 lin_rbs_batch_set_start
- 2.113 lin_rbs_configure
- 2.114 lin_rbs_enable
- 2.115 lin_rbs_get_signal_value_by_address
- 2.116 lin_rbs_get_signal_value_by_element
- 2.117 lin_rbs_is_running
- 2.118 lin_rbs_set_message_delay_time_by_name
- 2.119 lin_rbs_set_signal_value_by_address
- 2.120 lin_rbs_set_signal_value_by_element
- 2.121 lin_rbs_start
- 2.122 lin_rbs_stop
- 2.123 set_can_signal_value
- 2.124 set_flexray_signal_value
- 2.125 set_lin_signal_value
- 2.126 sgnsrv_get_can_signal_phy_value_in_msg
- 2.127 sgnsrv_get_can_signal_phy_value_latest
- 2.128 sgnsrv_get_flexray_signal_phy_value_in_frame
- 2.129 sgnsrv_get_flexray_signal_phy_value_latest
- 2.130 sgnsrv_get_lin_signal_phy_value_in_msg
- 2.131 sgnsrv_get_lin_signal_phy_value_latest
- 2.132 sgnsrv_register_can_signal_by_msg_identifier
- 2.133 sgnsrv_register_can_signal_by_msg_name
- 2.134 sgnsrv_register_flexray_signal_by_frame
- 2.135 sgnsrv_register_flexray_signal_by_frame_name
- 2.136 sgnsrv_register_lin_signal_by_msg_identifier
- 2.137 sgnsrv_register_lin_signal_by_msg_name
- 2.138 transmit_can_async
- 2.139 transmit_can_async_wo_pretx
- 2.140 transmit_can_sync
- 2.141 transmit_flexray_async
- 2.142 transmit_flexray_async_wo_pretx
- 2.143 transmit_flexray_sync
- 2.144 transmit_lin_async
- 2.145 transmit_lin_async_wo_pretx
- 2.146 transmit_lin_sync
- 2.147 tslog_add_online_replay_config
- 2.148 tslog_asc_to_blf
- 2.149 tslog_blf_read_end
- 2.150 tslog_blf_read_object
- 2.151 tslog_blf_read_object_w_comment
- 2.152 tslog_blf_read_start
- 2.153 tslog_blf_read_status
- 2.154 tslog_blf_seek_object_time
- 2.155 tslog_blf_to_asc
- 2.156 tslog_blf_write_can
- 2.157 tslog_blf_write_end
- 2.158 tslog_blf_write_flexray
- 2.159 tslog_blf_write_lin
- 2.160 tslog_blf_write_realtime_comment
- 2.161 tslog_blf_write_set_max_count
- 2.162 tslog_blf_write_start
- 2.163 tslog_blf_write_start_w_timestamp
- 2.164 tslog_del_online_replay_config
- 2.165 tslog_del_online_replay_configs
- 2.166 tslog_get_online_replay_config
- 2.167 tslog_get_online_replay_count
- 2.168 tslog_get_online_replay_status
- 2.169 tslog_pause_online_replay
- 2.170 tslog_pause_online_replays
- 2.171 tslog_set_online_replay_config
- 2.172 tslog_start_online_replay
- 2.173 tslog_start_online_replays
- 2.174 tslog_stop_online_replay
- 2.175 tslog_stop_online_replays
- 2.176 wait_can_message
3. test (37 APIs)
- 3.1 check_error_begin
- 3.2 check_error_end
- 3.3 check_test_terminate
- 3.4 check_verdict
- 3.5 debug_log_info
- 3.6 log_info
- 3.7 log_string
- 3.8 log_value
- 3.9 retrieve_current_result_folder
- 3.10 set_verdict_cok
- 3.11 set_verdict_nok
- 3.12 set_verdict_ok
- 3.13 signal_checker_add_check_with_time
- 3.14 signal_checker_add_check_with_trigger
- 3.15 signal_checker_add_falling_edge_with_time
- 3.16 signal_checker_add_falling_edge_with_trigger
- 3.17 signal_checker_add_follow_with_time
- 3.18 signal_checker_add_follow_with_trigger
- 3.19 signal_checker_add_jump_with_time
- 3.20 signal_checker_add_jump_with_trigger
- 3.21 signal_checker_add_monotony_falling_with_time
- 3.22 signal_checker_add_monotony_falling_with_trigger
- 3.23 signal_checker_add_monotony_rising_with_time
- 3.24 signal_checker_add_monotony_rising_with_trigger
- 3.25 signal_checker_add_rising_edge_with_time
- 3.26 signal_checker_add_rising_edge_with_trigger
- 3.27 signal_checker_add_statistics_with_time
- 3.28 signal_checker_add_statistics_with_trigger
- 3.29 signal_checker_add_unchange_with_time
- 3.30 signal_checker_add_unchange_with_trigger
- 3.31 signal_checker_check_statistics
- 3.32 signal_checker_clear
- 3.33 signal_checker_enable
- 3.34 signal_checker_get_result
- 3.35 write_result_image
- 3.36 write_result_string
- 3.37 write_result_value
1. app
1.1 add_application
Prototype:
int add_application(AAppName: str)Group: app
Description:
add an application by name, the channel mappings can be added or edited after this operationParameters:
Name Const Type Description AAppName No u8 Application name Returns: int
Example:
# add a new application named "TSMaster" app.add_application("TSMaster")
1.2 add_direct_mapping_can
Prototype:
int add_direct_mapping_can(ADestinationVarName: str, ASignalAddress: str, ADirection: int)Group: app
Description:
add or update direct mapping from CAN signal to system variableParameters:
Name Const Type Description ADestinationVarName No u8 the destination system variable name ASignalAddress No u8 CAN signal address in database ADirection No s16 see definition of TSymbolMappingDirection in TSMaster header file Returns: int
Example:
if app.add_direct_mapping_can("var1", "0/CAN_FD_Powertrain/Engine/EngineData/Gear", TSymbolMappingDirection_SignalToSysVar)== 0: app.log_text("add or update success", lvlInfo)
1.3 add_direct_mapping_with_factor_offset_can
Prototype:
int add_direct_mapping_with_factor_offset_can(ADestinationVarName: str, ASignalAddress: str, ADirection: int, AFactor: float, AOffset: float)Group: app
Description:
add or update direct mapping from CAN signal to system variable, with factor and offset adjustableParameters:
Name Const Type Description ADestinationVarName No u8 the destination system variable name ASignalAddress No u8 CAN signal address in database ADirection No s16 see definition of TSymbolMappingDirection in TSMaster header file AFactor No s32 sysvar = factor * sgn + offset, default = 1 AOffset No s32 sysvar = factor * sgn + offset, default = 0 Returns: int
Example:
if app.add_direct_mapping_with_factor_offset_can('map_can_factor', '0/CAN_FD_Powertrain/[xx]/EngineData/EngSpeed', TSymbolMappingDirection_SignalToSysVar, 2.1, 1.3) == 0: app.log_text("add direct mapping with factor offset can", lvlOK)
1.4 add_expression_mapping
Prototype:
int add_expression_mapping(ADestinationVarName: str, AExpression: str, AArguments: str)Group: app
Description:
add expression mapping from multiple signals to a specific system variableParameters:
Name Const Type Description ADestinationVarName No u8 the destination system variable name AExpression No u8 the expression for mapping signal calculation AArguments No u8 argument list separated by comma, single argument separated by /, you can copy argument list from symbol mapping list Returns: int
Example:
if 0 == app.add_expression_mapping('map_can_expr', 'x1 / 20 + x2 * 3', 'CAN/0/CAN_FD_Powertrain/[xx]/EngineData/EngSpeed,SysVar/stim_var'): pass # add success
1.5 add_path_to_environment
Prototype:
int add_path_to_environment(APath: str)Group: app
Description:
add path to environment variable PATHParameters:
Name Const Type Description APath No u8 path string Returns: int
Example:
app.add_path_to_environment("C:\LC_Ramdisk")
1.6 add_system_constant
Prototype:
int add_system_constant(AName: str, AValue: float, ADescription: str)Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
1.7 am_get_running_state
Prototype:
Tuple am_get_running_state(AModuleName: str)Group: app
Description:
get current automation module running stateParameters:
Name Const Type Description AModuleName No u8 the name of automation module Returns: Tuple
Example:
state = app.am_get_running_state('APITools') app.log_text("app.am_get_running_state('APITools') = " + str(state), lvlOK)
1.8 am_run
Prototype:
int am_run(AModuleName: str, ASubModuleName: str, AParameterGroupName: str, AIsSync: bool)Group: app
Description:
run specified automation sub module with or without parameter groupParameters:
Name Const Type Description AModuleName No u8 the name of automation module ASubModuleName No u8 the sub module name of automation module, if this parameter is empty, all checked sub modules are scheduled AParameterGroupName No u8 the name of specified parameter group, if this parameter is empty, the sub module without parameter group is scheduled AIsSync No u16 Execute this automation module synchronously or asynchronously Returns: int
Example:
# to execute automation module sync. if app.am_run('APITools', 'am_SubModule1', 'log1', False) == 0: pass # run completed
1.9 am_select_sub_module
Prototype:
int am_select_sub_module(AIsSelect: bool, AModuleName: str, ASubModuleName: str, AParameterGroupName: str)Group: app
Description:
check or uncheck selection of parameter groups of automation sub modulesParameters:
Name Const Type Description AIsSelect No u16 true: to check selection, false: to uncheck selection AModuleName No u8 the name of specified automation module ASubModuleName No u8 the name of sub group of automation module, if this parameter is empty, all parameter groups will be checked or unchecked AParameterGroupName No u8 the name of parameter group inside specified sub group of automation module, if this parameter is empty, all parameter groups inside this sub module will be checked or unchecked Returns: int
Example:
if app.am_select_sub_module(True, 'APITools', 'am_SubModule1', 'log1') == 0: pass # checked
1.10 am_stop
Prototype:
int am_stop(AModuleName: str, AIsSync: bool)Group: app
Description:
stop running of specified automation moduleParameters:
Name Const Type Description AModuleName No u8 the name of automation module AIsSync No u16 Stop this automation module synchronously or asynchronously Returns: int
Example:
if app.am_stop("module1", True) == 0: pass # this module is now stopped
1.11 call_library_api
Prototype:
Tuple call_library_api(AAPIName: str, AArgs: typing.List[str])Group: app
Description:
딧痰훨雷TSMaster鬼넋埼욋API변鑒Parameters:
Name Const Type Description AAPIName No char* API츰냔,절흔app.connect AArgCapacity No s32 꽝鑒俚륜눔휭좆 Returns: Tuple
Example:
argvs = ['var1', '1', 'string default value','this is a comment'] s =app.call_library_api("app.create_system_var",argvs) app.log_text("app.call_library_api('app.create_system_var',['var1', '1', 'string default value','this is a comment'])=" + str(s), lvlOK)
1.12 call_mini_program_api
Prototype:
Tuple call_mini_program_api(ALibName: str, AFuncName: str, AInParameters: str)Group: app
Description:
call arbitrary mini program library function using only string parametersParameters:
Name Const Type Description ALibName No u8 mini program library name AFuncName No u8 mini program function name AInParameters No u8 function input parameters spearated by ";" Returns: Tuple
Example:
s = app.call_mini_program_api('crc', 'virtual_func1', '11,22,33') app.log_text("app.call_mini_program_api('crc', 'virtual_func1', '11,22,33')=" + str(s), lvlOK)
1.13 call_system_api
Prototype:
Tuple call_system_api(AAPIName: str, AArgs: typing.List[str])Group: app
Description:
딧痰훨雷TSMaster溝固API변鑒Parameters:
Name Const Type Description AAPIName No char* API츰냔,절흔app.connect AArgCapacity No s32 꽝鑒俚륜눔휭좆 Returns: Tuple
Example:
argvs = ['var1', '1', 'string default value','this is a comment'] s =app.call_system_api("app.create_system_var",argvs) app.log_text("app.call_system_api('app.create_system_var',['var1', '1', 'string default value','this is a comment'])=" + str(s), lvlOK)
1.14 check
Prototype:
bool check(AErrorCode: int)Group: app
Description:
check if function return value is OK, if not, the error information will be printed. if return value is not 0, the result is OK.Parameters:
Name Const Type Description AErrorCode No s16 error code from previous function call Returns: bool
Example:
ret = app.connect() if app.check(ret) == 0: # app connected without any error app.log_text("application connected", lvlOK)
1.15 check_terminate
Prototype:
int check_terminate(AInstance: MpInstance)Group: app
Description:
check if user wants to stop the current mini program, return 0 means the current mini program is requested to be terminatedParameters:
Name Const Type Description AInstance No pdouble This is an instance Returns: int
Example:
while True: if 0 == app.check_terminate(Instance): print("break") break # wait some time app.wait(1, "")
1.16 clear_measurement_form
Prototype:
int clear_measurement_form(AFormCaption: str)Group: app
Description:
clear measurement data in specific formParameters:
Name Const Type Description AFormCaption No u8 the caption of the specific form, if left blank, all measurement forms are cleared Returns: int
Example:
# to clear all measurement forms app.clear_measurement_form("") # to clear only "Graphics" form's data points app.clear_measurement_form("SysGraphics")
1.17 configure_can_baudrate
Prototype:
int configure_can_baudrate(AIdxChn: int, ABaudrateKbps: float, AListenOnly: bool, AInstallTermResistor120Ohm: bool)Group: app
Description:
configure baud-rate settings of specific CAN channelParameters:
Name Const Type Description AIdxChn No s16 Channel index starting from 0 ABaudrateKbps No s32 Baud-rate in Kbps AListenOnly No u16 true: listen only; false: normal mode AInstallTermResistor120Ohm No u16 true: 120 Ohm termination resistor is active; false: 120 Ohm termination resistor is not active Returns: int
Example:
if 0 == app.configure_can_baudrate(CH1, 500, False, True): app.log_text("CAN controller on channel 1 has been configured", lvlOK)
1.18 configure_canfd_baudrate
Prototype:
int configure_canfd_baudrate(AIdxChn: int, ABaudrateArbKbps: float, ABaudrateDataKbps: float, AControllerType: int, AControllerMode: int, AInstallTermResistor120Ohm: bool)Group: app
Description:
configure baud-rate settings of specific CAN FD channelParameters:
Name Const Type Description AIdxChn No s16 Channel index starting from 0 ABaudrateArbKbps No s32 Baud-rate settings in arbitration field in Kbps ABaudrateDataKbps No s32 Baud-rate settings in data field in Kbps AControllerType No s16 CAN FD controller type, can be fdtCAN, fdtISOCANFD, fdtNonISOCANFD AControllerMode No s16 CAN FD controller mode, can be fdmNormal, fdmACKOff, fdmRestricted AInstallTermResistor120Ohm No u16 true: 120 Ohm termination resistor is active; false: 120 Ohm termination resistor is not active Returns: int
Example:
# configure ISO CAN FD controller on channel 1: # normal mode, 500 Kbps in arbitration field, 2000 Kbps in data field, termination resistor is active if 0 == app.configure_canfd_baudrate(CH1, 500, 2000, TCANFDControllerType_fdtISOCANFD, TCANFDControllerType_fdtCAN, True): app.log_text("CAN FD controller on channel 1 has been configured", lvlOK)
1.19 configure_lin_baudrate
Prototype:
int configure_lin_baudrate(AIdxChn: int, ABaudrateKbps: float, AProtocol: int)Group: app
Description:
configure baud-rate settings of specific LIN channelParameters:
Name Const Type Description AIdxChn No s16 Channel index starting from 0 ABaudrateKbps No s32 Baud-rate in Kbps AProtocol No s16 true: listen only; false: normal mode Returns: int
Example:
if 0 == app.configure_lin_baudrate(CH1, 19.2, 0): app.log_text("LIN controller on channel 1 has been configured", lvlOK)
1.20 connect
Prototype:
int connect()Group: app
Description:
connect to specified application by establishing connections with each mapped channelParameters: (없음)
Returns: int
Example:
# connect the application using stored configuration if app.connect() == 0: app.log_text("Application has been connected", lvlOK)
1.21 create_system_var
Prototype:
int create_system_var(ACompleteName: str, AType: int, ADefaultValue: str, AComment: str)Group: app
Description:
create a user mode system variable, return OK if same type already existsParameters:
Name Const Type Description ACompleteName No u8 the complete name of system variable AType No s16 see TSystemVarType definition in TSMaster.h ADefaultValue No u8 default value encoded in string AComment No u8 the comment string for this variable Returns: int
Example:
if app.create_system_var("var1", TSystemVarType_svtInt32, "string default value", "this is a comment") == 0: app.log_text("created", lvlOK)
1.22 debug_log
Prototype:
int debug_log(AInstance: MpInstance, AFile: str, AFunc: str, ALine: int, AStr: str, ALevel: int)Group: app
Description:
log debug information including file name, function name and line numberParameters:
Name Const Type Description AInstance No pdouble This is an instance AFile No u8 debug file name AFunc No u8 debug function name ALine No u16 debug line number AStr No u8 string to be printed ALevel No s16 Log level, can be: lvlError = 1, lvlWarning = 2, lvlOK = 3, lvlHint = 4, lvlInfo = 5, lvlVerbose = 6 Returns: int
Example:
if app.debug_log(Instance, 'file1.c', 'func1', 1, 'this is a debug log', lvlOK) == 0: app.log_text("debug log", lvlOK)
1.23 del_application
Prototype:
int del_application(AAppName: str)Group: app
Description:
delete an application by name, after deletion, all the mappings of the specified application are goneParameters:
Name Const Type Description AAppName No u8 Application name Returns: int
Example:
# delete application "TSMaster" app.del_application("TSMaster")
1.24 del_mapping
Prototype:
int del_mapping(AAppName: str, AAppChannelType: int, AAppChannelIndex: int)Group: app
Description:
delete one application mapping, which is read from PLIBTSMapping pointer, the FAppName, FAppChannelIndex and FAppChannelType should be specified before calling this functionParameters:
Name Const Type Description AAppName No u8 Set application name AAppChannelType No s16 Set the application channel type AAppChannelIndex No s16 Set the application channel index Returns: int
Example:
# just set the following 3 fields to delete the mapping info if app.del_mapping( "TSMaster", # Application is TSMaster APP_CAN, # Application channel type can be APP_CAN or APP_LIN 0 # Channel 1 ) == 0: app.log_text("application CAN channel 1 mapping has been deleted", lvlOK)
1.25 delete_path_from_environment
Prototype:
int delete_path_from_environment(APath: str)Group: app
Description:
delete path to environment variable PATHParameters:
Name Const Type Description APath No u8 path string Returns: int
Example:
app.delete_path_from_environment("C:\LC_Ramdisk")
1.26 delete_symbol_mapping_item
Prototype:
int delete_symbol_mapping_item(ADestinationVarName: str)Group: app
Description:
to delete existing symbol mapping itemParameters:
Name Const Type Description ADestinationVarName No u8 the name of the destination system variable name Returns: int
Example:
if app.delete_symbol_mapping_item('map_can_simple') == 0: app.log_text("delete symbol mapping item", lvlOK)
1.27 delete_symbol_mapping_items
Prototype:
int delete_symbol_mapping_items()Group: app
Description:
clear all items in symbol mapping engineParameters: (없음)
Returns: int
Example:
if app.delete_symbol_mapping_items() == 0: app.log_text("delete symbol mapping items", lvlOK)
1.28 delete_system_constant
Prototype:
int delete_system_constant(AName: str)Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
1.29 delete_system_var
Prototype:
int delete_system_var(ACompleteName: str)Group: app
Description:
delete a user mode system variableParameters:
Name Const Type Description ACompleteName No u8 the complete name of system variable Returns: int
Example:
if app.delete_system_var("var1") == 0: app.log_text("deleted", lvlOK)
1.30 directory_exists
Prototype:
int directory_exists(ADir: str)Group: app
Description:
check if directory exists, return 0 means existsParameters:
Name Const Type Description ADir No u8 the directory to be checked Returns: int
Example:
if 0 == app.directory_exists("C:\\LC_Ramdisk\\dir1"): app.log_text("dir exists!", lvlOK)
1.31 disconnect
Prototype:
int disconnect()Group: app
Description:
disconnect from specified application by closing connections from each mapped channelParameters: (없음)
Returns: int
Example:
# disconnect the application if app.disconnect() == 0: app.log_text("Application has been disconnected", lvlOK)
1.32 enable_all_graphics
Prototype:
int enable_all_graphics(AEnable: bool, AExceptCaption: str)Group: app
Description:
enable or disable graphics windows, also specify an exception if existsParameters:
Name Const Type Description AEnable No u16 true: enable all graphics windows, false: disable all AExceptCaptions No u8 specify the captions separated by comma of specific window to be excluded, or pass null string Returns: int
Example:
# disable all graphics except "Graphics 1" and "Graphics 2" app.enable_all_graphics(False, "Graphics 1,Graphics 2") # doing something... # enable all graphics again app.enable_all_graphics(True, "")
1.33 enable_symbol_mapping_engine
Prototype:
int enable_symbol_mapping_engine(AEnable: bool)Group: app
Description:
enable or disable the symbol mapping engineParameters:
Name Const Type Description AEnable No u16 true: enable, false: disable Returns: int
Example:
if app.enable_symbol_mapping_engine(True) == 0: app.log_text("enable symbol mapping engine", lvlOK)
1.34 enable_symbol_mapping_item
Prototype:
int enable_symbol_mapping_item(ADestinationVarName: str, AEnable: bool)Group: app
Description:
enable or disable single symbol mapping itemParameters:
Name Const Type Description ASystemVarName No u8 system variable name AEnable No u16 true: enable, false: disable Returns: int
Example:
if app.enable_symbol_mapping_item('map_can_simple', True) == 0: app.log_text("enable symbol mapping item", lvlOK)
1.35 end_log
Prototype:
int end_log(AInstance: MpInstance)Group: app
Description:
ends a loggingParameters:
Name Const Type Description AInstance No pdouble This is an instance Returns: int
Example:
if app.end_log(Instance) == 0: app.log_text("has end log", lvlOK)
1.36 excel_get_cell_count
Prototype:
Tuple excel_get_cell_count(AObj: int, AIdxSheet: int)Group: app
Description:
to get cell count in horz. and vert. directionsParameters:
Name Const Type Description AObj No s16 excel file object AIdxSheet No s16 sheet index Returns: Tuple
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') app.log_text(app.excel_get_cell_count(o, 0), lvlOK)
1.37 excel_get_cell_value
Prototype:
Tuple excel_get_cell_value(AObj: int, AIdxSheet: int, AIdxRow: int, AIdxCol: int)Group: app
Description:
get value from a specific cell in a sheetParameters:
Name Const Type Description AObj No s16 excel file object AIdxSheet No s16 sheet index AIdxRow No s16 row index AIdxCol No s16 column index Returns: Tuple
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') app.log_text(app.excel_get_cell_value(o, 1, 21-1, 10-1), lvlOK)
1.38 excel_get_sheet_count
Prototype:
int excel_get_sheet_count(AObj: int)Group: app
Description:
get count of sheet in the work bookParameters:
Name Const Type Description AObj No s16 Excel file object Returns: int
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') if app.excel_get_sheet_count(o) == 2: app.log_text("sheet count: " + str(o), lvlOK)
1.39 excel_get_sheet_name
Prototype:
Tuple excel_get_sheet_name(AObj: int, AIdxSheet: int)Group: app
Description:
get the name of specific excel objectParameters:
Name Const Type Description AObj No s16 excel file object AIdxSheet No s16 the index of specific sheet Returns: Tuple
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') if app.excel_get_sheet_name(o, 0): app.log_text("app.excel_get_sheet_name(o, 0) == Sheet1", lvlOK)
1.40 excel_load
Prototype:
Tuple excel_load(AFileName: str)Group: app
Description:
load an excel file into memoryParameters:
Name Const Type Description AFileName No u8 file name to a excel file, if file not exists, it will be created Returns: Tuple
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') app.log_text("excel file loaded: test.xlsx", lvlOK)
1.41 excel_set_cell_count
Prototype:
int excel_set_cell_count(AObj: int, AIdxSheet: int, ARowCount: int, AColCount: int)Group: app
Description:
set row and column count of a specific sheetParameters:
Name Const Type Description AObj No s16 excel file object AIdxSheet No s16 sheet index ARowCount No s16 row count of specific sheet AColCount No s16 column count of specific sheet Returns: int
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') if o == 0: app.log_text(app.excel_set_cell_count(o, 1, 21-1, 10-1), lvlOK)
1.42 excel_set_cell_value
Prototype:
int excel_set_cell_value(AObj: int, AIdxSheet: int, AIdxRow: int, AIdxCol: int, AValue: str)Group: app
Description:
set value of a specific cell in a sheetParameters:
Name Const Type Description AObj No s16 excel file object AIdxSheet No s16 sheet index AIdxRow No s16 row index AIdxCol No s16 column index AValue No u8 value to be set Returns: int
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') if o == 0: app.log_text(app.excel_set_cell_value(o, 1, 21-1, 10-1, "AValue"), lvlOK)
1.43 excel_set_sheet_count
Prototype:
int excel_set_sheet_count(AObj: int, ACount: int)Group: app
Description:
set sheet count of an excel objectParameters:
Name Const Type Description AObj No s16 excel file object ACount No s32 sheet count of specific excel file object Returns: int
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') if app.excel_set_sheet_count(o, 2) == 0: app.log_text("sheet count has been set to 2") if app.excel_unload(o) == 0: app.log_text("excel file unloaded")
1.44 excel_set_sheet_name
Prototype:
int excel_set_sheet_name(AObj: int, AIdxSheet: int, AName: str)Group: app
Description:
get the name of specific excel objectParameters:
Name Const Type Description AObj No s16 excel file object AIdxSheet No s16 the index of specific sheet AName No u8 sheet name set value Returns: int
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') s = "Sheet 1" if app.excel_set_sheet_name(o, 0, s): app.log_text("the first sheet name set to %s" % s)
1.45 excel_unload
Prototype:
int excel_unload(AObj: int)Group: app
Description:
unload an excel file object from memoryParameters:
Name Const Type Description AObj No s16 excel file object Returns: int
Example:
o = app.excel_load(r'D\Demo\Excels\ExcelDemo.xlsx') app.excel_unload(o)
1.46 excel_unload_all
Prototype:
int excel_unload_all()Group: app
Description:
unload all excel file objects from memoryParameters: (없음)
Returns: int
Example:
app.excel_unload_all()
1.47 execute_app
Prototype:
int execute_app(AAppPath: str, AWorkingDir: str, AParameter: str, AWaitTimeMS: int)Group: app
Description:
set signal real-time value from CAN RBS using signal database addressParameters:
Name Const Type Description AAppPath No u8 absolute path of external application AWorkingDir No u8 working directory of external application AParameter No u8 parameter of external application AWaitTimeMS No s16 wait time in milliseconds for external application to stop, 0 means never wait, -1 means wait until app stops Returns: int
Example:
if app.execute_app('notepad.exe', '', '', 0) == 0: app.log_text("successfully execute app", lvlOK)
1.48 execute_python_script
Prototype:
Tuple execute_python_script(AFilePath: str, AArguments: str, AIsSync: bool, AIsX64: bool)Group: app
Description:
execute a python script file and get its execution resultParameters:
Name Const Type Description AFilePath No u8 Full path of python script file AArguments No u8 arguments passed to python ASync No u16 true: execute synchronously, false: execute asynchronously AIsX64 No u16 true: use x64 distribution, false: use x86 distribution, note: x64 distribution is not installed by default, you need to manually copy folder to bin\Data\Python\active_version\x64 Returns: Tuple
Example:
s = app.execute_python_script(r'D\Simulation\TempPythonScript.py', '', True, False) app.log_text("app.execute_python_script(r'Simulation\TempPythonScript.py', '', True, False) = " + str(s), lvlOK)
1.49 execute_python_string
Prototype:
Tuple execute_python_string(AString: str, AArguments: str, AIsSync: bool, AIsX64: bool)Group: app
Description:
execute a python code as stringParameters:
Name Const Type Description AString No u8 python code in string AArguments No u8 arguments passed to python ASync No u16 true: execute synchronously, false: execute asynchronously AIsX64 No u16 true: use x64 distribution, false: use x86 distribution, note: x64 distribution is not installed by default, you need to manually copy folder to bin\Data\Python\active_version\x64 Returns: Tuple
Example:
s = app.execute_python_string('print("hi")', '', True, False) app.log_text("app.execute_python_string('print(\"hi\")', '', True, False) = " + str(s), lvlOK)
1.50 force_directory
Prototype:
int force_directory(ADir: str)Group: app
Description:
force create the destination directory if it does not existsParameters:
Name Const Type Description ADir No u8 the full name of the destination directory Returns: int
Example:
app.force_directory('sub_logging')
1.51 get_application_list
Prototype:
Strings get_application_list()Group: app
Description:
get a list of existing application names on this computer, each application name is separated by ";"Parameters: (없음)
Returns: Strings
Example:
app.log_text('Application list: \r\n' + app.get_application_list().Text, lvlHint)
1.52 get_can_channel_count
Prototype:
int get_can_channel_count()Group: app
Description:
get total count of application CAN channelsParameters: (없음)
Returns: int
Example:
if app.get_can_channel_count() == 0: pass # CAN channel count is stored in variable ACount
1.53 get_configuration_file_name
Prototype:
str get_configuration_file_name()Group: app
Description:
retrieve configuration file nameParameters: (없음)
Returns: str
Example:
s = app.get_configuration_file_name() if s != None: app.log_text("file name is: %s" % s, lvlOK) else: app.log_text("configuration file not saved", lvlOK)
1.54 get_configuration_file_path
Prototype:
str get_configuration_file_path()Group: app
Description:
retrieve configuration file pathParameters: (없음)
Returns: str
Example:
s = app.get_configuration_file_path() if s != None: app.log_text('app.get_configuration_file_path() = ' + s, lvlOK)
1.55 get_constant_double
Prototype:
Tuple get_constant_double(AName: str)Group: app
Description:
get constant double valueParameters:
Name Const Type Description AName No u8 the name of a double constant Returns: Tuple
Example:
d = app.get_constant_double('CONST_CH1') app.log_text("app.get_constant_double('CONST_CH1') = " + str(d), lvlOK)
1.56 get_current_application
Prototype:
str get_current_application()Group: app
Description:
get the current application nameParameters:
Name Const Type Description AAppName No u8 the application name retrieved Returns: str
Example:
app.get_current_application() app.log_text("the current app name is " + 'new_app', lvlInfo)
1.57 get_custom_components_dir
Prototype:
str get_custom_components_dir()Group: app
Description:
get custom components dirParameters: (없음)
Returns: str
Example:
if app.get_custom_components_dir() != None: app.log_text(' Custom components dir = ' + app.get_custom_components_dir(), lvlHint)
1.58 get_doc_path
Prototype:
str get_doc_path()Group: app
Description:
retrieve document path of the current projectParameters: (없음)
Returns: str
Example:
s = app.get_doc_path() if s != '': app.log_text("app.get_doc_path() = " + s, lvlOK)
1.59 get_error_description
Prototype:
str get_error_description(ACode: int)Group: app
Description:
get the error description by error codeParameters:
Name Const Type Description ACode No s16 Error code Returns: str
Example:
# get error code of a function code = app.get_turbo_mode() app.get_error_description(code) app.log_text("error description of code" + str(code) + "is: ", lvlError)
1.60 get_flexray_channel_count
Prototype:
int get_flexray_channel_count()Group: app
Description:
to get flexray channel countParameters: (없음)
Returns: int
Example:
if 3 == app.get_flexray_channel_count(): app.log_text("flexray channel count = %d" % 3, lvlOK)
1.61 get_hardware_id_array
Prototype:
Tuple get_hardware_id_array()Group: app
Description:
get computer unique id into byte array (8 bytes in length), the retrieved string can be used for encryption and license controlParameters: (없음)
Returns: Tuple
Example:
a = app.get_hardware_id_array() app.log_text('app.get_hardware_id_array() = ' + ','.join(str(i) for i in a), lvlOK)
1.62 get_hardware_id_string
Prototype:
Tuple get_hardware_id_string()Group: app
Description:
get computer unique id string, the retrieved string can be used for encryption and license controlParameters: (없음)
Returns: Tuple
Example:
s = app.get_hardware_id_string() app.log_text('app.get_hardware_id_string() = ' + str(s), lvlOK)
1.63 get_host_app_path
Prototype:
str get_host_app_path()Group: app
Description:
get host application directory such as TSMaster.exe directoryParameters: (없음)
Returns: str
Example:
sTOSUNPng = app.get_host_app_path() + r'Data\Resources\TOSUN.png'
1.64 get_lin_channel_count
Prototype:
int get_lin_channel_count()Group: app
Description:
get total count of application LIN channelsParameters: (없음)
Returns: int
Example:
# get LIN channel count of current application if app.get_lin_channel_count() == 2: # LIN channel count is stored in variable ACount app.log_text("LIN channel count = "+ str(2), lvlOK)
1.65 get_main_window_handle
Prototype:
Tuple get_main_window_handle()Group: app
Description:
get main window handleParameters: (없음)
Returns: Tuple
Example:
i = app.get_main_window_handle() app.log_text('app.get_main_window_handle() = ' + str(i), lvlOK)
1.66 get_mapping
Prototype:
Tuple get_mapping(AAppName: str, AAppChannelType: int, AAppChannelIndex: int)Group: app
Description:
load one application mapping, which is stored into PLIBTSMapping pointer, the FAppName, FAppChannelIndex and FAppChannelType should be specified before calling this functionParameters:
Name Const Type Description AAppName No u8 Set application name AAppChannelType No s16 Set the application channel type AAppChannelIndex No s16 Set the application channel index Returns: Tuple
Example:
# just set the following 3 fields to retrieve mapping info: if app.get_mapping( 'TSMaster', # Application is TSMaster APP_CAN, # Application channel type can be APP_CAN or APP_LIN 0 ) == 0: app.log_text("application CAN channel 1 mapping has been retrieved: ", lvlInfo) app.log_text("FHWDeviceType = " + str(app.set_mapping.AHWType) + "FHWIndex = " + str(app.set_mapping.AHWIndex) + "FHWChannelIndex = " + str(app.set_mapping.AHWChannelIndex) + "FHWDeviceSubType = " + str(app.set_mapping.AHWSubType) + "FHWDeviceName = " + app.set_mapping.AHWName, lvlOK)
1.67 get_system_var_address
Prototype:
Tuple get_system_var_address(ACompleteName: str)Group: app
Description:
retrieve system variable internal data address for advanced usage purposeParameters:
Name Const Type Description ACompleteName No u8 the complete name of system variable Returns: Tuple
Example:
i = app.get_system_var_address('stim_var') app.log_text("app.get_system_var_address('stim_var') = " + str(i), lvlOK)
1.68 get_system_var_def_by_index
Prototype:
Tuple get_system_var_def_by_index(AIsUser: bool, AIndex: int)Group: app
Description:
get system var definition by indexParameters:
Name Const Type Description AIsUser No u16 True: user variable; False: internal variable AIndex No s16 index of system var list in user group or internal group Returns: Tuple
Example:
if app.get_system_var_def_by_index(True, 0) == 0: app.log_text("to get user variable definition at index: " + str(0), lvlOK)
1.69 get_system_var_def_by_name
Prototype:
Tuple get_system_var_def_by_name(AIsUser: bool, ACompleteName: str)Group: app
Description:
get system variable defintion by nameParameters:
Name Const Type Description AIsUser No u16 True: user variable; False: internal variable ACompleteName No u8 system var complete name: category.name Returns: Tuple
Example:
if app.get_system_var_def_by_name(True, "usr.sysVar1") == 0: app.log_text("to get user variable: "+ "usr.sysVar1" + "definition", lvlOK)
1.70 get_system_var_generic
Prototype:
Tuple get_system_var_generic(ACompleteName: str)Group: app
Description:
get system variable value into string formatParameters:
Name Const Type Description ACompleteName No u8 the complete name of the system variable Returns: Tuple
Example:
# get system variable value no matter what kind it is sValue = app.get_system_var_generic("var1") if sValue == 12: app.log_text("get system var generic is" + str(sValue), lvlInfo)
1.71 get_system_var_internal_count
Prototype:
int get_system_var_internal_count()Group: app
Description:
get system variable countParameters: (없음)
Returns: int
Example:
if app.get_system_var_internal_count() == 0: app.log_text("get system var internal count", lvlOK)
1.72 get_system_var_logging
Prototype:
Tuple get_system_var_logging(ACompleteName: str)Group: app
Description:
get logging flag of a specific system variableParameters:
Name Const Type Description ACompleteName No u8 the complete name of system variable Returns: Tuple
Example:
b = app.get_system_var_logging('stim_var') app.log_text("successfully get system var logging = " + str(b), lvlOK)
1.73 get_system_var_user_count
Prototype:
int get_system_var_user_count()Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
1.74 get_system_var_value
Prototype:
Tuple get_system_var_value(ACompleteName: str)Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: Tuple
Example: (예제 없음)
1.75 get_timestamp_us
Prototype:
int get_timestamp_us()Group: app
Description:
get the PC timestamp of the current measurementParameters: (없음)
Returns: int
Example:
i = app.get_timestamp_us() if i >= 0: app.log_text("app.get_timestamp_us >= 0: " + str(i), lvlOK)
1.76 get_tsmaster_version
Prototype:
Tuple get_tsmaster_version()Group: app
Description:
to retrieve TSMaster version date and builid numberParameters: (없음)
Returns: Tuple
Example:
y, m, d, num = app.get_tsmaster_version() if y != 0: app.log_text('TSMaster version is: ' + str(y) + '.' + str(m) + '.' + str(d) + '.' + str(num), lvlOK)
1.77 get_turbo_mode
Prototype:
bool get_turbo_mode()Group: app
Description:
get the turbo mode enable statusParameters: (없음)
Returns: bool
Example:
# get the turbo mode activation status of TSMaster if app.get_turbo_mode() == 0: app.log_text("Turbo mode status is enable", lvlOK)
1.78 ini_close
Prototype:
int ini_close(AHandle: int)Group: app
Description:
close the previously created ini object and write cached data on disk finallyParameters:
Name Const Type Description AHandle No s16 previously created ini object handle Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_close(h)
1.79 ini_create
Prototype:
Tuple ini_create(AFileName: str)Group: app
Description:
create an ini file object, this function should be called before any ini operationParameters:
Name Const Type Description AFileName No u8 the ini file name specified Returns: Tuple
Example:
r, h = app.ini_create("ini_file.ini") app.log_text("app.ini_create('ini_file.ini') = " + str(h), lvlOK)
1.80 ini_delete_key
Prototype:
int ini_delete_key(AHandle: int, ASection: str, AKey: str)Group: app
Description:
to delete a key in a section in ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name which contains the key AKey No u8 the key name to be deleted Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_delete_key(h, 'del_sec', 'bool')
1.81 ini_delete_section
Prototype:
int ini_delete_section(AHandle: int, ASection: str)Group: app
Description:
to delete a section in ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 the section name to be deleted Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_delete_section(h, 'del_sec')
1.82 ini_key_exists
Prototype:
int ini_key_exists(AHandle: int, ASection: str, AKey: str)Group: app
Description:
check if a key in a specific section exists in ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name which contains the key AKey No u8 key name to check Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_key_exists(h, 'test_values', 'bool')
1.83 ini_read_bool
Prototype:
Tuple ini_read_bool(AHandle: int, ASection: str, AKey: str, ADefault: bool)Group: app
Description:
read a boolean value from ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name ADefault No u16 if key not exists, use this default value as return value Returns: Tuple
Example:
r, h = app.ini_create("ini_file.ini") app.ini_read_bool(h, 'test_values', 'bool', False)
1.84 ini_read_float
Prototype:
Tuple ini_read_float(AHandle: int, ASection: str, AKey: str, ADefault: float)Group: app
Description:
read a float value from ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name ADefault No s32 if key not exists, use this default value as return value Returns: Tuple
Example:
r, h = app.ini_create("ini_file.ini") app.ini_read_float(h, 'test_values', 'float', 0)
1.85 ini_read_int32
Prototype:
Tuple ini_read_int32(AHandle: int, ASection: str, AKey: str, ADefault: int)Group: app
Description:
read a 32 bit integer from ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name ADefault No s16 if key not exists, use this default value as return value Returns: Tuple
Example:
r, h = app.ini_create("ini_file.ini") app.ini_read_int32(h, 'test_values', 'int32', 0)
1.86 ini_read_int64
Prototype:
Tuple ini_read_int64(AHandle: int, ASection: str, AKey: str, ADefault: int)Group: app
Description:
read a 64 bit integer from ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name ADefault No s16 if key not exists, use this default value as return value Returns: Tuple
Example:
r, h = app.ini_create("ini_file.ini") app.ini_read_int64(h, 'test_values', 'int64', 0)
1.87 ini_read_string
Prototype:
Tuple ini_read_string(AHandle: int, ASection: str, AKey: str, ADefault: str)Group: app
Description:
read a string from ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name ADefault No u8 if key not exists, use this default value as return value Returns: Tuple
Example:
r, h = app.ini_create("ini_file.ini") app.ini_read_string(h, 'test_values', 'string', '')
1.88 ini_section_exists
Prototype:
int ini_section_exists(AHandle: int, ASection: str)Group: app
Description:
check if a section in ini file existsParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name to check Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_section_exists(h, 'test_values')
1.89 ini_write_bool
Prototype:
int ini_write_bool(AHandle: int, ASection: str, AKey: str, AValue: bool)Group: app
Description:
write a boolean value into ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name AValue No u16 the integer value Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_write_bool(h, 'test_values', 'bool', True)
1.90 ini_write_float
Prototype:
int ini_write_float(AHandle: int, ASection: str, AKey: str, AValue: float)Group: app
Description:
write a double value into ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name AValue No s32 the integer value Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_write_float(h, 'test_values', 'float', 1.23456)
1.91 ini_write_int32
Prototype:
int ini_write_int32(AHandle: int, ASection: str, AKey: str, AValue: int)Group: app
Description:
write a 32 bit integer value into ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name AValue No s16 the integer value Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_write_int32(h, 'test_values', 'int32', 12345)
1.92 ini_write_int64
Prototype:
int ini_write_int64(AHandle: int, ASection: str, AKey: str, AValue: int)Group: app
Description:
write a 64 bit integer value into ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name AValue No s16 the integer value Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_write_int64(h, 'test_values', 'int64', 12345678901234567)
1.93 ini_write_string
Prototype:
int ini_write_string(AHandle: int, ASection: str, AKey: str, AValue: str)Group: app
Description:
write a string value into ini fileParameters:
Name Const Type Description AHandle No s16 the handle created by ini_create ASection No u8 section name AKey No u8 key name AValue No u8 the integer value Returns: int
Example:
r, h = app.ini_create("ini_file.ini") app.ini_write_string(h, 'test_values', 'string', 'str value')
1.94 is_connected
Prototype:
bool is_connected()Group: app
Description:
check if app is connectedParameters: (없음)
Returns: bool
Example:
if app.is_connected() == 0: app.log_text("application is connected", lvlInfo)
1.95 is_tsmaster_host
Prototype:
bool is_tsmaster_host()Group: app
Description:
estimate is tsmaster hostParameters: (없음)
Returns: bool
Example:
if app.is_tsmaster_host() == 0: app.log_text("is tsmaster host", lvlOK)
1.96 load_plugin
Prototype:
int load_plugin(APluginName: str)Group: app
Description:
load internal plugin by nameParameters:
Name Const Type Description APluginName No u8 the internal plugin name to be loaded Returns: int
Example:
if 0 == app.load_plugin("rtlUIUDSCodeGen.bpl"): app.log_text("plugin is now loaded into memory", lvlOK)
1.97 load_symbol_mapping_settings
Prototype:
int load_symbol_mapping_settings(AFileName: str)Group: app
Description:
to import symbol mapping settings from external fileParameters:
Name Const Type Description AFileName No u8 the path of symbol mapping settings file Returns: int
Example:
if app.load_symbol_mapping_settings('symbol_mapping.ini') == 0: app.log_text("load symbol mapping settings", lvlOK)
1.98 log_text
Prototype:
int log_text(AStr: str, ALevel: int)Group: app
Description:
log messages to write windowParameters:
Name Const Type Description AStr No u8 String to be printed TLevel No s16 Log level, can be: lvlError = 1, lvlWarning = 2, lvlOK = 3, lvlHint = 4, lvlInfo = 5, lvlVerbose = 6 Returns: int
Example:
# log error string: app.log_text('Testing App connect and disconnect...', lvlInfo)
1.99 make_toast
Prototype:
bool make_toast(AString: str, ALevel: int)Group: app
Description:
show toast information on screenParameters:
Name Const Type Description AString No u8 string you want to show ALevel No s16 Log level, can be: lvlError = 1, lvlWarning = 2, lvlOK = 3, lvlHint = 4, lvlInfo = 5, lvlVerbose = 6 Returns: bool
Example:
app.make_toast('this is a toast!', lvlOK)
1.100 mini_delay_cpu
Prototype:
int mini_delay_cpu()Group: app
Description:
delay a minimum time while keeping low CPU usageParameters: (없음)
Returns: int
Example:
# delay a very short time (~500us) app.mini_delay_cpu()
1.101 open_directory_and_select_file
Prototype:
int open_directory_and_select_file(AFileName: str)Group: app
Description:
open explorer window to select a fileParameters:
Name Const Type Description AFileName No u8 the destination file name to be shown Returns: int
Example:
if 0 == app.open_directory_and_select_file("C:\\LC_Ramdisk\\dir1\\a.txt"): app.log_text("the file is selected in a new popup window", lvlOK)
1.102 open_help_doc
Prototype:
int open_help_doc(AFileNameWoSuffix: str, AChapterTitle: str)Group: app
Description:
open help document and navigate to specified chapterParameters:
Name Const Type Description AFileNameWoSuffix No char* file name without suffix, i.e. TSMaster_um ATitle No char* title name for auto navigation Returns: int
Example:
# open chapter 1.19 in TSMaster user manual pdf file app.open_help_doc("TSMaster_um", "1.19 CAN Remaining Bus Simulation")
1.103 panel_get_bkgd_color
Prototype:
Tuple panel_get_bkgd_color(APanelName: str, AControlName: str)Group: app
Description:
to get background color of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Returns: Tuple
Example:
v = app.panel_get_bkgd_color('PanelTest', 'btn') app.log_text("panel get bkgd color = " + str(v), lvlOK)
1.104 panel_get_enable
Prototype:
Tuple panel_get_enable(APanelName: str, AControlName: str)Group: app
Description:
get enabled property of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name, if this name is null, the panel enabled property is returned instead Returns: Tuple
Example:
v = app.panel_get_enable('PanelTest', 'btn') app.log_text("app.panel_get_enable('PanelTest', 'btn') = " + str(v), lvlOK)
1.105 panel_get_opacity
Prototype:
Tuple panel_get_opacity(APanelName: str, AControlName: str)Group: app
Description:
get opacity of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Returns: Tuple
Example:
v = app.panel_get_opacity('PanelTest', 'btn') app.log_text("app.panel_get_opacity('PanelTest', 'btn') = " + str(v), lvlOK)
1.106 panel_get_position_xy
Prototype:
Tuple panel_get_position_xy(APanelName: str, AControlName: str)Group: app
Description:
get panel control position.x and position.y valueParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Returns: Tuple
Example:
r, x, y = app.panel_get_position_xy('PanelTest', 'btn') app.log_text(r"app.panel_get_position_xy('PanelTest', 'btn') = " + str(x) + ', ' + str(y), lvlOK)
1.107 panel_get_rotation_angle
Prototype:
Tuple panel_get_rotation_angle(APanelName: str, AControlName: str)Group: app
Description:
to get rotation angle of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Returns: Tuple
Example:
v = app.panel_get_rotation_angle('PanelTest', 'btn') app.log_text("app.panel_get_rotation_angle('PanelTest', 'btn') = " + str(v), lvlOK)
1.108 panel_get_rotation_center
Prototype:
Tuple panel_get_rotation_center(APanelName: str, AControlName: str)Group: app
Description:
to get rotation center point ratio x and ratio y of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Returns: Tuple
Example:
r, x, y = app.panel_get_rotation_center('PanelTest', 'btn') app.log_text("app.panel_get_rotation_center('PanelTest', 'btn') = " + str(x) + ', ' + str(y), lvlOK)
1.109 panel_get_scale_xy
Prototype:
Tuple panel_get_scale_xy(APanelName: str, AControlName: str)Group: app
Description:
to get scale of x and y of panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Returns: Tuple
Example:
r, x, y = app.panel_get_scale_xy('PanelTest', 'btn') app.log_text("app.panel_get_scale_xy('PanelTest', 'btn') = " + str(x) + ', ' + str(y), lvlOK)
1.110 panel_get_selector_items
Prototype:
Tuple panel_get_selector_items(APanelName: str, AControlName: str)Group: app
Description:
get item list of selector in panelParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Returns: Tuple
Example:
r, s = app.panel_get_selector_items('PanelTest', 'sel') app.log_text("app.panel_get_selector_items('PanelTest', 'sel') = " + s, lvlOK)
1.111 panel_get_width_height
Prototype:
Tuple panel_get_width_height(APanelName: str, AControlName: str)Group: app
Description:
to get width and height of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Returns: Tuple
Example:
r, x, y = app.panel_get_width_height('PanelTest', 'btn') app.log_text("app.panel_get_width_height('PanelTest', 'btn') = " + str(x) + ', ' + str(y), lvlOK)
1.112 panel_set_bkgd_color
Prototype:
int panel_set_bkgd_color(APanelName: str, AControlName: str, AAlphaColor: int)Group: app
Description:
set background color of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name AAlphaColor No s16 BGR color with alpha channel, for example, 0xAABBCCDD means alpha = 0xAA, red = 0xBB, green = 0xCC and blue = 0xDD Returns: int
Example:
if 0 == app.panel_set_bkgd_color("Panel1", "rect1", 0x5500FF00): pass # color set to green with opacity = 0x55/0xFF
1.113 panel_set_enable
Prototype:
int panel_set_enable(APanelName: str, AControlName: str, AEnable: bool)Group: app
Description:
enable or disable panel or panel controlsParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the name of the control to be enabled or disabled, if set to null, the panel will be enabled or disabled instead AEnable No u16 true: enable, false: disable Returns: int
Example:
if app.panel_set_enable('PanelTest', 'btn', True) == 0: pass # button 1 is now disabled
1.114 panel_set_height
Prototype:
int panel_set_height(APanelName: str, AControlName: str, AHeight: float)Group: app
Description:
to set the height of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name AHeight No s32 the height to be set Returns: int
Example:
if 0 == app.panel_set_height("Panel1", "Button1", 100): pass # set success
1.115 panel_set_opacity
Prototype:
int panel_set_opacity(APanelName: str, AControlName: str, AOpacity: float)Group: app
Description:
to set opacity of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name AOpacity No s32 the opacity to be set, in range [0..1], 0 means fully invisible, 1 means fully visible Returns: int
Example:
app.panel_set_opacity('PanelTest', 'btn', 0.8)
1.116 panel_set_position_x
Prototype:
int panel_set_position_x(APanelName: str, AControlName: str, AX: float)Group: app
Description:
to set position.x of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Ax No s32 position.x of the panel control Returns: int
Example:
if app.panel_set_position_x('PanelTest', 'btn', 50) == 0: pass #move
1.117 panel_set_position_xy
Prototype:
int panel_set_position_xy(APanelName: str, AControlName: str, AX: float, AY: float)Group: app
Description:
to set position.x and position.y of a panel control at the same timeParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Ax No s32 the x position to be set Ay No s32 the y position to be set Returns: int
Example:
if app.panel_set_position_xy('PanelTest', 'btn', 100, 100) == 0: pass #move
1.118 panel_set_position_y
Prototype:
int panel_set_position_y(APanelName: str, AControlName: str, AY: float)Group: app
Description:
to set position.y of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name Ay No s32 the y position to be set Returns: int
Example:
if app.panel_set_position_y('PanelTest', 'btn', 50) == 0: pass #move
1.119 panel_set_rotation_angle
Prototype:
int panel_set_rotation_angle(APanelName: str, AControlName: str, AAngleDegree: float)Group: app
Description:
set rotation angle of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name AAngleDegree No s32 the rotation angle in degree Returns: int
Example:
# to rotate button 1 by 45 degree if 0 == app.panel_set_rotation_angle("Panel1", "Button1", 45): pass # rotated
1.120 panel_set_rotation_center
Prototype:
int panel_set_rotation_center(APanelName: str, AControlName: str, ARatioX: float, ARatioY: float)Group: app
Description:
to set rotation center point of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name ARatioX No s32 the rotation center point x ratio from 0~1 ARatioY No s32 the rotation center point y ratio from 0~1 Returns: int
Example:
# to rotate button 1 by 45 degree if 0 == app.panel_set_rotation_center('PanelTest', 'btn', 0, 0): pass # rotated
1.121 panel_set_scale_x
Prototype:
int panel_set_scale_x(APanelName: str, AControlName: str, AScaleX: float)Group: app
Description:
scale x direction of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name AScale No s32 the scale ratio to be set, 1.0 is default scale Returns: int
Example:
# enlarge the button 1 x direction by 2x times if 0 == app.panel_set_scale_x("Panel1", "Button1", 2.0): pass # scaled
1.122 panel_set_scale_y
Prototype:
int panel_set_scale_y(APanelName: str, AControlName: str, AScaleY: float)Group: app
Description:
scale x direction of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name AScale No s32 the scale ratio to be set, 1.0 is default scale Returns: int
Example:
# enlarge the button 1 y direction by 2y times if 0 == app.panel_set_scale_y("Panel1", "Button1", 2.0): pass # scaled
1.123 panel_set_selector_items
Prototype:
int panel_set_selector_items(APanelName: str, AControlName: str, AItemsList: str)Group: app
Description:
set selector item list in panelParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name AItemList No u8 item list separated with comma Returns: int
Example:
# enlarge the button 1 y direction by 2x times if 0 == app.panel_set_selector_items('PanelTest', 'sel', 'item1=1,item2=2,item3=3'): pass # item list updated
1.124 panel_set_width
Prototype:
int panel_set_width(APanelName: str, AControlName: str, AWidth: float)Group: app
Description:
to set the width of a panel controlParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name AWidth No s32 the width to be set Returns: int
Example:
if 0 == app.panel_set_width("Panel1", "Button1", 100): pass # set success
1.125 panel_set_width_height
Prototype:
int panel_set_width_height(APanelName: str, AControlName: str, AWidth: float, AHeight: float)Group: app
Description:
to set the width and height properties of a panel control at the same timeParameters:
Name Const Type Description APanelName No u8 the panel window name AControlName No u8 the panel control name AWidth No s32 the width to be set AHeight No s32 the height to be set Returns: int
Example:
if 0 == app.panel_set_width_height('PanelTest', 'btn', 200, 100): pass # set success
1.126 pause
Prototype:
int pause()Group: app
Description:
pause the current test by poping up a dialog for user to control, this is usually helpful in script debuggingParameters: (없음)
Returns: int
Example:
# doing some operation... app.pause() # performing next operation...
1.127 play_sound
Prototype:
int play_sound(AIsSync: bool, AWaveFileName: str)Group: app
Description:
play waveform file from diskParameters:
Name Const Type Description AIsSync No u16 true: sync. play; false: async. play AWaveformFile No u8 path to waveform file, relative to your project path, or use full file name Returns: int
Example:
# play snd1.wav in your project dir app.play_sound(True, ".\\res\\snd1.wav") # do something after this waveform is played
1.128 print_delta_time
Prototype:
int print_delta_time(AInfo: str)Group: app
Description:
to print delta time between specific operationsParameters:
Name Const Type Description ACompleteName No u8 info will be display before delta time Returns: int
Example:
app.print_delta_time("") # -> this will reset timer # do work that costs some time app.print_delta_time("operation1")
1.129 print_system_var_value
Prototype:
int print_system_var_value(ACompleteName: str)Group: app
Description:
log system variable value into log fileParameters:
Name Const Type Description ACompleteName No u8 the complete name of the system variable Returns: int
Example:
if app.print_system_var_value('usr.sysVar1') == 0: app.log_text("successfully print system var value", lvlOK)
1.130 prompt_user_input_string
Prototype:
Tuple prompt_user_input_string(APrompt: str)Group: app
Description:
this is prompt user input stringParameters:
Name Const Type Description APrompt No u8 text displayed for user Returns: Tuple
Example:
s = app.prompt_user_input_string('input a string value') app.log_text("app.prompt_user_input_string('input a string value') = " + s, lvlOK)
1.131 prompt_user_input_value
Prototype:
Tuple prompt_user_input_value(APrompt: str)Group: app
Description:
popup a dialog for user to input a double valueParameters:
Name Const Type Description APrompt No u8 text displayed for user Returns: Tuple
Example:
d = app.prompt_user_input_value('input a double value') app.log_text("app.prompt_user_input_value('input a double value') = " + str(d), lvlOK)
1.132 read_mat_file_end
Prototype:
int read_mat_file_end(AHandle: int)Group: app
Description:
stop reading and close the mat fileParameters:
Name Const Type Description AHandle No s16 the mat file object for reading Returns: int
Example:
h = app.write_mat_file_start('mat_file.mat') app.read_mat_file_end(h)
1.133 read_mat_file_start
Prototype:
Tuple read_mat_file_start(AFileName: str)Group: app
Description:
start to read a mat fileParameters:
Name Const Type Description AFileName No u8 the mat file to be read Returns: Tuple
Example:
app.read_mat_file_start('mat_file.mat')
1.134 read_mat_file_variable_count
Prototype:
Tuple read_mat_file_variable_count(AHandle: int, AVarName: str)Group: app
Description:
get the array count of a variableParameters:
Name Const Type Description AHandle No s16 the mat file object for reading AVarName No u8 the name of the specified variable Returns: Tuple
Example:
r, h = app.write_mat_file_start('mat_file.mat') app.read_mat_file_variable_count(h, "var4")
1.135 read_mat_file_variable_double
Prototype:
Tuple read_mat_file_variable_double(AHandle: int, AVarName: str, AStartIdx: int, ACount: int)Group: app
Description:
read double variable from a mat fileParameters:
Name Const Type Description AHandle No s16 the mat file object for reading AVarName No u8 the name of the specified variable AStartIdx No s16 the read start index of double array in mat file ACount No s16 the double count to read Returns: Tuple
Example:
r, h = app.write_mat_file_start('mat_file.mat') app.read_mat_file_variable_double(h, 'var_double', 0, 1)
1.136 read_mat_file_variable_string
Prototype:
Tuple read_mat_file_variable_string(AHandle: int, AVarName: str)Group: app
Description:
read a string variable from mat fileParameters:
Name Const Type Description AHandle No s16 the mat file object for reading AVarName No u8 the name of the specified variable Returns: Tuple
Example:
r, h = app.write_mat_file_start('mat_file.mat') app.read_mat_file_variable_string(h, "var4")
1.137 read_text_file_end
Prototype:
int read_text_file_end(AHandle: int)Group: app
Description:
stops reading of the text file and close the file readerParameters:
Name Const Type Description AHandle No s16 the handle of the previously created text file reader Returns: int
Example:
r, h = app.read_text_file_start('csv_file.csv') app.read_text_file_end(h)
1.138 read_text_file_line
Prototype:
Tuple read_text_file_line(AHandle: int)Group: app
Description:
read one line from text file reader previously createdParameters:
Name Const Type Description AHandle No s16 the handle of the previously created text file reader Returns: Tuple
Example:
r, h = app.read_text_file_start('csv_file.csv') app.read_text_file_line(h)
1.139 read_text_file_start
Prototype:
Tuple read_text_file_start(AFileName: str)Group: app
Description:
create a text file reader and begins to read a text fileParameters:
Name Const Type Description AFileName No u8 the file to be read Returns: Tuple
Example:
r, h = app.read_text_file_start('csv_file.csv') app.log_text("app.read_text_file_start('csv_file.csv') = " + str(h), lvlOK)
1.140 run_form
Prototype:
int run_form(AFormCaption: str)Group: app
Description:
start measurement of specified formParameters:
Name Const Type Description AFormCaption No u8 the caption of the specified form Returns: int
Example:
app.run_form('CANTx')
1.141 run_python_script
Prototype:
bool run_python_script(AScript: str)Group: app
Description:
run python scriptParameters:
Name Const Type Description AScript No u8 python script Returns: bool
Example:
app.run_python_script('print("python code is executed in string.")
1.142 save_screenshot
Prototype:
int save_screenshot(AFormCaption: str, AFilePath: str)Group: app
Description:
save screenshot image of a formParameters:
Name Const Type Description ACaption No u8 the caption of the form to be captured AFilePath No u8 the destination file path, can be .png or .jpg extension Returns: int
Example:
if app.save_screenshot('SysGraphics', 'SysGraphics.png') == 0: app.log_text("successfully save screenshot", lvlOK)
1.143 save_symbol_mapping_settings
Prototype:
int save_symbol_mapping_settings(AFileName: str)Group: app
Description:
to export symbol mapping settings to an external fileParameters:
Name Const Type Description AFileName No u8 the path of symbol mapping settings file Returns: int
Example:
if app.save_symbol_mapping_settings('symbol_mapping.ini') == 0: app.log_text("save symbol mapping settings", lvlOK)
1.144 set_analysis_time_range
Prototype:
int set_analysis_time_range(ATimeStartUs: int, ATimeEndUs: int)Group: app
Description:
set all UI to display the specified time range onlyParameters:
Name Const Type Description ATimeStartUs No s16 the start time in us ATimeEndUs No s16 the end time in us Returns: int
Example:
app.set_analysis_time_range(0, 10 * 1000000)
1.145 set_can_channel_count
Prototype:
int set_can_channel_count(ACount: int)Group: app
Description:
set total count of application CAN channelsParameters:
Name Const Type Description ACount No s16 CAN channel count to be set Returns: int
Example:
# set CAN channel count to 2 in current application app.set_can_channel_count(2)
1.146 set_check_failed_terminate
Prototype:
int set_check_failed_terminate(AInstance: MpInstance, AToTerminate: bool)Group: app
Description:
set whether terminate the current program if check function returns falseParameters:
Name Const Type Description AInstance No pdouble This is an instance bool No u16 true: to terminate, false: not to terminate Returns: int
Example:
app.set_check_failed_terminate(Instance, True) # this script will NOT terminate the program: app.check(0) # this script will terminate the program: app.check(1)
1.147 set_current_application
Prototype:
int set_current_application(AAppName: str)Group: app
Description:
设置当前应用程序名称,不同的应用程序拥有不同的资源映射Parameters:
Name Const Type Description AAppName No u8 넋埼츰냔 Returns: int
Example:
app.get_current_application('new_app') app.log_text("the current app name is " + 'new_app', lvlInfo)
1.148 set_default_output_dir
Prototype:
int set_default_output_dir(APath: str)Group: app
Description:
set API functions default output directoryParameters:
Name Const Type Description ADir No u8 the default directory to be set Returns: int
Example:
# direct all output files to a specific directory app.set_default_output_dir("C:\\Ramdisk\\")
1.149 set_flexray_channel_count
Prototype:
int set_flexray_channel_count(ACount: int)Group: app
Description:
to set flexray channel countParameters:
Name Const Type Description ACount No s16 flexray channel count to be set Returns: int
Example:
# to set flexray channel count to 2 if 0 == app.set_flexray_channel_count(2): pass # set success
1.150 set_lin_channel_count
Prototype:
int set_lin_channel_count(ACount: int)Group: app
Description:
set total count of application LIN channelsParameters:
Name Const Type Description ACount No s16 LIN channel count to be set Returns: int
Example:
# set LIN channel count to 2 in current application app.set_lin_channel_count(2)
1.151 set_mapping
Prototype:
int set_mapping(AAppName: str, AAppChannelType: int, AAppChannelIndex: int, AHWName: str, AHWType: int, AHWSubType: int, AHWIndex: int, AHWChannelIndex: int, AEnabled: bool)Group: app
Description:
save one application mapping, which is read from PLIBTSMapping pointerParameters:
Name Const Type Description AAppName No u8 Set application name AAppChannelType No s16 Set the application channel type AAppChannelIndex No s16 Set the application channel index AHWName No u8 Set hardware name AHWType No s16 Set hardware type AHWSubType No s16 Set hardware sub-device type AHWIndex No s16 Set hardware index AHWChannelIndex No s16 Set hardware channel index AEnabled No u16 Set whether the mapping is enabled Returns: int
Example:
if app.set_mapping( "TSMaster", # Application is TSMaster APP_CAN, # Application channel type can be APP_CAN or APP_LIN 0, # Channel 1 "TSCANMini", # set device name TDeviceType_TS_TCP_DEVICE, # TLIBBusToolDeviceType can be TS_USB_DEVICE, XL_USB_DEVICE or TS_TCP_DEVICE 3, # 3 means TS.CAN Mini 0, 0, # The first hardware connected to computer True # The first CAN channel of the hardware ) == 0: app.log_text("channel mapping on application CAN channel 1 has been set", lvlOK)
1.152 set_system_var_double
Prototype:
int set_system_var_double(ACompleteName: str, AValue: float)Group: app
Description:
set double typed system var valueParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No s32 double value of system var Returns: int
Example:
if app.set_system_var_double('v_double', 123.4567) == 0: app.log_text("set system var double", lvlOK)
1.153 set_system_var_double_array
Prototype:
int set_system_var_double_array(ACompleteName: str, AValue: typing.List[float])Group: app
Description:
set double array typed system var valueParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No ps32 destination address of variable Returns: int
Example:
app.set_system_var_double_array('v_double_array', [1.23,2.34,3.45,4.56])
1.154 set_system_var_double_array_async
Prototype:
int set_system_var_double_array_async(ACompleteName: str, AValue: typing.List[float])Group: app
Description:
set double array typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No pu32 destination address variable Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_double_array_async('v_double_array', [1.23,2.34,3.45,4.56])
1.155 set_system_var_double_async
Prototype:
int set_system_var_double_async(ACompleteName: str, AValue: float)Group: app
Description:
set double typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No s32 double value of system var Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_double_async('v_double', 123.456)
1.156 set_system_var_generic
Prototype:
int set_system_var_generic(ACompleteName: str, AValue: str)Group: app
Description:
set system variable value by string representationParameters:
Name Const Type Description ACompleteName No u8 the complete name of the system variable AValue No u8 the value in string Returns: int
Example:
# set system variable value no matter what kind it is app.set_system_var_generic('usr.sysVar1', '1234') app.log_text("Successfully created system var generic", lvlInfo)
1.157 set_system_var_generic_async
Prototype:
int set_system_var_generic_async(ACompleteName: str, AValue: str)Group: app
Description:
get system variable value into string formatParameters:
Name Const Type Description ACompleteName No u8 the complete name of the system variable AValue No u8 the value in string Returns: int
Example:
# set system variable value app.set_system_var_generic_async('usr.sysVar1', '2345') app.log_text("Successfully created system var generic async", lvlInfo)
1.158 set_system_var_int32
Prototype:
int set_system_var_int32(ACompleteName: str, AValue: int)Group: app
Description:
set int32 typed system var valueParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No s32 double value of system var Returns: int
Example:
app.set_system_var_int32('v_int32', 1234)
1.159 set_system_var_int32_array
Prototype:
int set_system_var_int32_array(ACompleteName: str, AValue: typing.List[int])Group: app
Description:
set int32 array typed system var valueParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No ps32 destination address of variable Returns: int
Example:
app.set_system_var_int32_array('v_int32_array', [1111,2222,3333,4444])
1.160 set_system_var_int32_array_async
Prototype:
int set_system_var_int32_array_async(ACompleteName: str, AValue: typing.List[int])Group: app
Description:
set int32 array typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No ps32 local available var count of array Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_int32_array_async('v_int32_array', [1111,2222,3333,4444])
1.161 set_system_var_int32_async
Prototype:
int set_system_var_int32_async(ACompleteName: str, AValue: int)Group: app
Description:
set int32 typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No s16 int32 value of system var Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_int32_async('v_int32', 1234)
1.162 set_system_var_int64_array_from_string
Prototype:
int set_system_var_int64_array_from_string(ACompleteName: str, AValue: typing.List[str])Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
1.163 set_system_var_int64_array_from_string_async
Prototype:
int set_system_var_int64_array_from_string_async(ACompleteName: str, AValue: typing.List[str])Group: app
Description:
set int64 array typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No ps32 destination address variable Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_int64_array_from_string_async('v_int64_array', ['1111','2222','3333','4444'])
1.164 set_system_var_int64_from_string
Prototype:
int set_system_var_int64_from_string(ACompleteName: str, AValue: str)Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
1.165 set_system_var_int64_from_string_async
Prototype:
int set_system_var_int64_from_string_async(ACompleteName: str, AValue: str)Group: app
Description:
set int64 typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No s32 int64 value of system var Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_int64_from_string_async('v_int64', '12345671234567')
1.166 set_system_var_logging
Prototype:
int set_system_var_logging(ACompleteName: str, AIsLogging: bool)Group: app
Description:
set logging flag of a specific system variableParameters:
Name Const Type Description ACompleteName No u8 the complete name of system variable ALogging No u16 logging flag of this system variable Returns: int
Example:
if app.set_system_var_logging('stim_var', True) == 0: app.log_text("succcessfully set system var logging", lvlOK)
1.167 set_system_var_string
Prototype:
int set_system_var_string(ACompleteName: str, AString: str)Group: app
Description:
set string typed system var valueParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AString No u8 pointer of destination string Returns: int
Example:
app.set_system_var_string('v_string', 'str value')
1.168 set_system_var_string_async
Prototype:
int set_system_var_string_async(ACompleteName: str, AString: str)Group: app
Description:
set string typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AString No pu16 pointer of destination string Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_string_async('v_string', 'str value')
1.169 set_system_var_uint32
Prototype:
int set_system_var_uint32(ACompleteName: str, AValue: int)Group: app
Description:
set uint32 typed system var valueParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No s32 double value of system var Returns: int
Example:
app.set_system_var_uint32('v_uint32', 123456)
1.170 set_system_var_uint32_async
Prototype:
int set_system_var_uint32_async(ACompleteName: str, AValue: int)Group: app
Description:
set uint32 typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No s32 uint32 value of system var Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_uint32_async('v_uint32', 123456)
1.171 set_system_var_uint64_from_string
Prototype:
int set_system_var_uint64_from_string(ACompleteName: str, AValue: str)Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
1.172 set_system_var_uint64_from_string_async
Prototype:
int set_system_var_uint64_from_string_async(ACompleteName: str, AValue: str)Group: app
Description:
set uint64 typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No s32 uint64 value of system var Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_uint64_from_string_async('v_uint64', '123456712345678')
1.173 set_system_var_uint8_array
Prototype:
int set_system_var_uint8_array(ACompleteName: str, AValue: typing.List[int])Group: app
Description:
set uint8 array typed system var valueParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No ps32 destination address of variable Returns: int
Example:
app.set_system_var_uint8_array('v_uint8_array', [1,2,3,4])
1.174 set_system_var_uint8_array_async
Prototype:
int set_system_var_uint8_array_async(ACompleteName: str, AValue: typing.List[int])Group: app
Description:
set uint8 array typed system var value without events, used for automation with higher performance requirementsParameters:
Name Const Type Description ACompleteName No u8 complete name of system var: category.name AValue No ps32 destination address of variable Returns: int
Example:
# Note: no "OnChange" events will be fired in async mode! app.set_system_var_uint8_array_async('v_uint8_array', [1,2,3,4])
1.175 set_system_var_unit
Prototype:
int set_system_var_unit(ACompleteName: str, AUnit: str)Group: app
Description:
set unit of a specific system variableParameters:
Name Const Type Description ACompleteName No u8 the complete name of a system variable AUnit No u8 unit in string Returns: int
Example:
if 0 == app.set_system_var_unit("c.var1", "km/h"): app.log_text("unit is set", lvlOK)
1.176 set_system_var_value_table
Prototype:
int set_system_var_value_table(ACompleteName: str, ATable: str)Group: app
Description:
set value table of a specific system variabeParameters:
Name Const Type Description ACompleteName No u8 the complete name of a system variable ATable No u8 value table pairs separated by "," Returns: int
Example:
if 0 == app.set_system_var_value_table("c.var1", "0=off,1=on"): app.lvlOK("value table is set", lvlOK)
1.177 set_thread_priority
Prototype:
int set_thread_priority(AInstance: MpInstance, APriority: int)Group: app
Description:
set the current mini program priorityParameters:
Name Const Type Description AInstance No pdouble This is an instance APriority No s16 0=Idle, 1=Lowest, 2=Lower, 3=Normal, 4=Higher, 5=Highest, 6=Time Critical Returns: int
Example:
# set the current thread priority to highest app.set_thread_priority(Instance, 5)
1.178 set_turbo_mode
Prototype:
int set_turbo_mode(AEnable: bool)Group: app
Description:
enable or disable turbo mode, in turbo mode the latency of communication can be minimized, however power consumption is increasedParameters:
Name Const Type Description AEnable No u16 true: turbo mode is active; false: turbo mode is not active Returns: int
Example:
# set turbo mode active on TSMaster if app.set_turbo_mode(True) == 0: app.log_text("Turbo mode has been activated", lvlOK)
1.179 show_confirm_dialog
Prototype:
int show_confirm_dialog(ATitle: str, APrompt: str, AImage: str, ATimeoutMs: int, ADefaultOK: bool)Group: app
Description:
popup a dialog for user to select Yes nor NoParameters:
Name Const Type Description ATitle No u8 title of the dialog APrompt No u8 prompt text in the dialog AImage No u8 image path if required ATimeoutMs No s16 timeout for user to confirm in ms ADefaultOK No u16 if timeout, the system will choose defult value Returns: int
Example:
if app.show_confirm_dialog('this is a confirm dialog title', 'please wait 5s for OK button to become enabled and make a decision within 3s', r'Data\Resources\TOSUN.png', 3000, True) == 0: # user confirmed app.log_text("user confirmed") else: # user refused app.log_text("user refused")
1.180 show_window_system_messages
Prototype:
Form show_window_system_messages()Group: app
Description:
show window system messagesParameters: (없음)
Returns: Form
Example:
if None != app.show_window_system_messages(): app.log_text("show window system messages", lvlOK)
1.181 start_log
Prototype:
int start_log(AInstance: MpInstance)Group: app
Description:
start logging of bus eventsParameters:
Name Const Type Description AInstance No pdouble This is an instance Returns: int
Example:
if app.start_log(Instance) == 0: app.log_text("has start log", lvlOK)
1.182 stim_get_signal_status
Prototype:
Tuple stim_get_signal_status(ASTIMName: str, AUserLabel: str)Group: app
Description:
get stimulation signal status in STIM windowParameters:
Name Const Type Description ASTIMName No u8 the STIM window name ASignalLabel No u8 the signal label renamed by user Returns: Tuple
Example:
i = app.stim_get_signal_status('STIMTest', 'stim_var') app.log_text("stim get signal status = " + str(i), lvlOK)
1.183 stim_set_signal_status
Prototype:
int stim_set_signal_status(ASTIMName: str, AUserLabel: str, AStatus: int)Group: app
Description:
Set stimulation signal status in STIM windowParameters:
Name Const Type Description ASTIMName No u8 the STIM window name ASignalLabel No u8 the signal label renamed by user AStatus No s16 the status to be set, see TSMaster header for description Returns: int
Example:
# run sgn1 stimulation if 0 == app.stim_set_signal_status("STIM1", "sgn1", STIM_STOPPED): pass # get success
1.184 stop_form
Prototype:
int stop_form(AFormCaption: str)Group: app
Description:
stop measurement of specified formParameters:
Name Const Type Description AFormCaption No u8 the caption of the specified form Returns: int
Example:
app.stop_form('CANTx')
1.185 terminate_app_by_name
Prototype:
int terminate_app_by_name(AImageName: str)Group: app
Description:
terminate an application by its image nameParameters:
Name Const Type Description AImageName No u8 Image name to be terminated Returns: int
Example:
# to terminate notepad.exe app.terminate_app_by_name("notepad.exe")
1.186 terminate_application
Prototype:
int terminate_application(AInstance: MpInstance)Group: app
Description:
terminate the execution of the current mini programParameters:
Name Const Type Description AInstance No pdouble This is an instance Returns: int
Example:
# stop the execution of current mini program if app.terminate_application(Instance) == 0: app.log_text("The program has been terminated", lvlOK)
1.187 tsdb_get_can_db_count
Prototype:
Tuple tsdb_get_can_db_count()Group: app
Description:
to get all loaded CAN database countParameters: (없음)
Returns: Tuple
Example:
if app.tsdb_get_can_db_count() == 0: app.log_text("loaded database count = " + str(1), lvlInfo)
1.188 tsdb_get_can_db_properties_by_address
Prototype:
Tuple tsdb_get_can_db_properties_by_address(AAddr: str)Group: app
Description:
to get properties of specified CAN database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
db = app.tsdb_get_can_db_properties_by_address('0/CAN_FD_Powertrain') app.log_text("can db properties: DB index = " + str(db.DBIndex) + ', Signal count = ' + str(db.SignalCount) + ', Frame count = ' + str(db.FrameCount) + ', ECU count = ' + str(db.ECUCount) + ', Channel Mask = ' + hex(db.SupportedChannelMask) + ', Name = ' + db.Name + ', Comment = ' + db.Comment, lvlOK)
1.189 tsdb_get_can_db_properties_by_index
Prototype:
Tuple tsdb_get_can_db_properties_by_index(ADBIndex: int)Group: app
Description:
to get properties of specified CAN database by indexParameters:
Name Const Type Description AValue No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex property Returns: Tuple
Example:
db = app.tsdb_get_can_db_properties_by_index(0) app.log_text("can db properties: Signal count = " + str(db.SignalCount) + ', Frame count = ' + str(db.FrameCount) + ', ECU count = ' + str(db.ECUCount) + ', Channel Mask = ' + hex(db.SupportedChannelMask) + ', Name = ' + db.Name + ', Comment = ' + db.Comment, lvlOK)
1.190 tsdb_get_can_ecu_properties_by_address
Prototype:
Tuple tsdb_get_can_ecu_properties_by_address(AAddr: str)Group: app
Description:
to get ECU properties of specified CAN database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
ecu = app.tsdb_get_can_ecu_properties_by_address('0/CAN_FD_Powertrain/Engine') app.log_text("can ecu properties: DB Index = " + str(ecu.DBIndex) + ', ECU Index = ' + str(ecu.ECUIndex) + ', Tx frame count = ' + str(ecu.TxFrameCount) + ', Rx frame count = ' + str(ecu.RxFrameCount) + ', Name = ' + ecu.Name + ', Comment = ' + ecu.Comment, lvlOK)
1.191 tsdb_get_can_ecu_properties_by_index
Prototype:
Tuple tsdb_get_can_ecu_properties_by_index(ADBIndex: int, AECUIndex: int)Group: app
Description:
to get ECU properties of specified CAN database by indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex properties AECUIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex properties Returns: Tuple
Example:
ecu = app.tsdb_get_can_ecu_properties_by_index(0, 0) app.log_text("can ecu properties: Tx frame count = " + str(ecu.TxFrameCount) + ', Rx frame count = ' + str(ecu.RxFrameCount) + ', Name = ' + ecu.Name + ', Comment = ' + ecu.Comment, lvlOK)
1.192 tsdb_get_can_frame_properties_by_address
Prototype:
Tuple tsdb_get_can_frame_properties_by_address(AAddr: str)Group: app
Description:
to get frame properties of specified CAN database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
app.tsdb_get_can_frame_properties_by_address('0/CAN_FD_Powertrain/Engine/EngineData')
1.193 tsdb_get_can_frame_properties_by_db_index
Prototype:
Tuple tsdb_get_can_frame_properties_by_db_index(ADBIndex: int, AIndex: int)Group: app
Description:
to get CAN frame definition by index specified in database frame listParameters:
Name Const Type Description ADBIndex No u16 the index of database AFrameIndex No u16 the index from database frame list Returns: Tuple
Example:
fme = app.tsdb_get_can_frame_properties_by_db_index(0, 0) app.log_text("can frame properties: " + 'Identifier = ' + hex(fme.Identifier) + ', Signal count = ' + str(fme.SignalCount) + ', DLC = ' + str(fme.DLC) + ', Name = ' + fme.Name + ', Comment = ' + fme.Comment, lvlOK)
1.194 tsdb_get_can_frame_properties_by_index
Prototype:
Tuple tsdb_get_can_frame_properties_by_index(ADBIndex: int, AECUIndex: int, AFrameIndex: int, AIsTx: bool)Group: app
Description:
to get frame properties of specified CAN database by indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AECUIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AFrameIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AIsTx No u16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties Returns: Tuple
Example:
fme = app.tsdb_get_can_frame_properties_by_index(0, 0, 0, True) app.log_text("can frame properties: " + 'Identifier = ' + hex(fme.Identifier) + ', Signal count = ' + str(fme.SignalCount) + ', DLC = ' + str(fme.DLC) + ', Name = ' + fme.Name + ', Comment = ' + fme.Comment, lvlOK)
1.195 tsdb_get_can_signal_properties_by_address
Prototype:
Tuple tsdb_get_can_signal_properties_by_address(AAddr: str)Group: app
Description:
to get signal properties of specified CAN database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
sgn = app.tsdb_get_can_signal_properties_by_address('0/CAN_FD_Powertrain/Engine/EngineData/EngSpeed') app.log_text("can signal properties: " + 'DB Index = ' + str(sgn.DBIndex) + ', ECU Index = ' + str(sgn.ECUIndex) + ', Frame Index = ' + str(sgn.FrameIndex) + ', Signal Index = ' + str(sgn.SignalIndex) + ', Is Tx = ' + str(sgn.IsTx) + ', Signal Type = ' + str(sgn.CANSgnType) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.196 tsdb_get_can_signal_properties_by_db_index
Prototype:
Tuple tsdb_get_can_signal_properties_by_db_index(ADBIndex: int, AIndex: int)Group: app
Description:
to get CAN signal definition by index specified in database signal listParameters:
Name Const Type Description ADBIndex No u16 the index of database ASignalIndex No u16 the index fo signal Returns: Tuple
Example:
sgn = app.tsdb_get_can_signal_properties_by_db_index(0, 0) app.log_text("can signal properties: " + 'Signal Type = ' + str(sgn.CANSgnType) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.197 tsdb_get_can_signal_properties_by_frame_index
Prototype:
Tuple tsdb_get_can_signal_properties_by_frame_index(ADBIndex: int, AIdxFrame: int, ASgnIndexInFrame: int)Group: app
Description:
to get can signal properties by frame indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AIdxFrame No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties ASgnIndexInFrame No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties Returns: Tuple
Example:
sgn = app.tsdb_get_can_signal_properties_by_frame_index(0, 0, 0) app.log_text("app.tsdb_get_can_signal_properties_by_frame_index(0, 0, 0): " + 'Signal Type = ' + str(sgn.CANSgnType) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.198 tsdb_get_can_signal_properties_by_index
Prototype:
Tuple tsdb_get_can_signal_properties_by_index(ADBIndex: int, AECUIndex: int, AFrameIndex: int, ASignalIndex: int, AIsTx: bool)Group: app
Description:
to get signal properties of specified CAN database by indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties AECUIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties AFrameIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties ASignalIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties AIsTx No u16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties Returns: Tuple
Example:
sgn = app.tsdb_get_can_signal_properties_by_index(0, 0, 0, 0, True) app.log_text("can signal properties: " + 'Signal Type = ' + str(sgn.CANSgnType) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.199 tsdb_get_flexray_db_count
Prototype:
Tuple tsdb_get_flexray_db_count()Group: app
Description:
to get all loaded FlexRay database countParameters: (없음)
Returns: Tuple
Example:
cnt = app.tsdb_get_flexray_db_count() app.log_text("get flexray database count: " + str(cnt), lvlOK)
1.200 tsdb_get_flexray_db_properties_by_address
Prototype:
Tuple tsdb_get_flexray_db_properties_by_address(AAddr: str)Group: app
Description:
to get properties of specified FlexRay database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
db = app.tsdb_get_flexray_db_properties_by_address('0/PowerTrain') app.log_text('flexray db properties: DB index = ' + str(db.DBIndex) + ', Signal count = ' + str(db.SignalCount) + ', Frame count = ' + str(db.FrameCount) + ', ECU count = ' + str(db.ECUCount) + ', Channel Mask = ' + hex(db.SupportedChannelMask) + ', Name = ' + db.Name + ', Comment = ' + db.Comment, lvlOK)
1.201 tsdb_get_flexray_db_properties_by_index
Prototype:
Tuple tsdb_get_flexray_db_properties_by_index(ADBIndex: int)Group: app
Description:
to get properties of specified FlexRay database by indexParameters:
Name Const Type Description AValue No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex property Returns: Tuple
Example:
db = app.tsdb_get_flexray_db_properties_by_index(0) app.log_text("flexray db properties: Signal count = " + str(db.SignalCount) + ', Frame count = ' + str(db.FrameCount) + ', ECU count = ' + str(db.ECUCount) + ', Channel Mask = ' + hex(db.SupportedChannelMask) + ', Name = ' + db.Name + ', Comment = ' + db.Comment, lvlOK)
1.202 tsdb_get_flexray_ecu_properties_by_address
Prototype:
Tuple tsdb_get_flexray_ecu_properties_by_address(AAddr: str)Group: app
Description:
to get ECU properties of specified FlexRay database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
ecu = app.tsdb_get_flexray_ecu_properties_by_address('0/PowerTrain/BLU') app.log_text("flexray ecu properties: DB Index = " + str(ecu.DBIndex) + ', ECU Index = ' + str(ecu.ECUIndex) + ', Tx frame count = ' + str(ecu.TxFrameCount) + ', Rx frame count = ' + str(ecu.RxFrameCount) + ', Name = ' + ecu.Name + ', Comment = ' + ecu.Comment, lvlOK)
1.203 tsdb_get_flexray_ecu_properties_by_index
Prototype:
Tuple tsdb_get_flexray_ecu_properties_by_index(ADBIndex: int, AECUIndex: int)Group: app
Description:
to get ECU properties of specified FlexRay database by indexParameters:
Name Const Type Description AECUIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex properties ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex properties Returns: Tuple
Example:
ecu = app.tsdb_get_flexray_ecu_properties_by_index(0, 0) app.log_text("flexray ecu properties: Tx frame count = " + str(ecu.TxFrameCount) + ', Rx frame count = ' + str(ecu.RxFrameCount) + ', Name = ' + ecu.Name + ', Comment = ' + ecu.Comment, lvlOK)
1.204 tsdb_get_flexray_frame_properties_by_address
Prototype:
Tuple tsdb_get_flexray_frame_properties_by_address(AAddr: str)Group: app
Description:
to get frame properties of specified FlexRay database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
fme = app.tsdb_get_flexray_frame_properties_by_address('0/PowerTrain/BLU/BackLightInfo') app.log_text("flexray frame properties: " + 'DB Index = ' + str(fme.DBIndex) + ', ECU Index = ' + str(fme.ECUIndex) + ', Frame Index = ' + str(fme.FrameIndex) + ', Is Tx = ' + str(fme.IsTx) + ', Channel Mask = ' + hex(fme.ChannelMask) + ', Base Cycle = ' + str(fme.BaseCycle) + ', Cycle Repetition = ' + str(fme.CycleRepetition) + ', Is Startup = ' + str(fme.IsStartupFrame) + ', Slot Id = ' + str(fme.SlotId) + ', Cycle Mask = ' + hex(fme.CycleMask) + ', Signal count = ' + str(fme.SignalCount) + ', DLC = ' + str(fme.DLC) + ', Name = ' + fme.Name + ', Comment = ' + fme.Comment, lvlOK)
1.205 tsdb_get_flexray_frame_properties_by_db_index
Prototype:
Tuple tsdb_get_flexray_frame_properties_by_db_index(ADBIndex: int, AIndex: int)Group: app
Description:
to get FlexRay frame definition by index specified in database frame listParameters:
Name Const Type Description ADBIndex No u16 the index of database AFrameIndex No u16 the index from database frame list Returns: Tuple
Example:
fme = app.tsdb_get_flexray_frame_properties_by_db_index(0, 0) app.log_text("flexray frame properties: " + 'Channel Mask = ' + hex(fme.ChannelMask) + ', Base Cycle = ' + str(fme.BaseCycle) + ', Cycle Repetition = ' + str(fme.CycleRepetition) + ', Is Startup = ' + str(fme.IsStartupFrame) + ', Slot Id = ' + str(fme.SlotId) + ', Cycle Mask = ' + hex(fme.CycleMask) + ', Signal count = ' + str(fme.SignalCount) + ', DLC = ' + str(fme.DLC) + ', Name = ' + fme.Name + ', Comment = ' + fme.Comment, lvlOK)
1.206 tsdb_get_flexray_frame_properties_by_index
Prototype:
Tuple tsdb_get_flexray_frame_properties_by_index(ADBIndex: int, AECUIndex: int, AFrameIndex: int, AIsTx: bool)Group: app
Description:
to get frame properties of specified FlexRay database by indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AECUIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AFrameIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AIsTx No u16 true: this message is transmitted by node, false: this message is received by node Returns: Tuple
Example:
fme = app.tsdb_get_flexray_frame_properties_by_index(0, 0, 0, False) app.log_text(" flexray frame properties is: " + 'Channel Mask = ' + hex(fme.ChannelMask) + ', Base Cycle = ' + str(fme.BaseCycle) + ', Cycle Repetition = ' + str(fme.CycleRepetition) + ', Is Startup = ' + str(fme.IsStartupFrame) + ', Slot Id = ' + str(fme.SlotId) + ', Cycle Mask = ' + hex(fme.CycleMask) + ', Signal count = ' + str(fme.SignalCount) + ', DLC = ' + str(fme.DLC) + ', Name = ' + fme.Name + ', Comment = ' + fme.Comment, lvlOK)
1.207 tsdb_get_flexray_signal_properties_by_address
Prototype:
Tuple tsdb_get_flexray_signal_properties_by_address(AAddr: str)Group: app
Description:
to get signal properties of specified FlexRay database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
sgn = app.tsdb_get_flexray_signal_properties_by_address('0/PowerTrain/BLU/BackLightInfo/BrakeLight') app.log_text("flexray signal properties: " + 'DB Index = ' + str(sgn.DBIndex) + ', ECU Index = ' + str(sgn.ECUIndex) + ', Frame Index = ' + str(sgn.FrameIndex) + ', Signal Index = ' + str(sgn.SignalIndex) + ', Is Tx = ' + str(sgn.IsTx) + ', Signal Type = ' + str(sgn.FRSgnType) + ', Compu Method = ' + str(sgn.CompuMethod) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Update bit = ' + str(sgn.UpdateBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.208 tsdb_get_flexray_signal_properties_by_db_index
Prototype:
Tuple tsdb_get_flexray_signal_properties_by_db_index(ADBIndex: int, AIndex: int)Group: app
Description:
to get FlexRay signal definition by index specified in database signal listParameters:
Name Const Type Description ADBIndex No u16 the index of database ASignalIndex No u16 the index fo signal Returns: Tuple
Example:
sgn = app.tsdb_get_flexray_signal_properties_by_db_index(0, 0) app.log_text("flexray signal properties: " + 'Signal Type = ' + str(sgn.FRSgnType) + ', Compu Method = ' + str(sgn.CompuMethod) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Update bit = ' + str(sgn.UpdateBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.209 tsdb_get_flexray_signal_properties_by_frame_index
Prototype:
Tuple tsdb_get_flexray_signal_properties_by_frame_index(ADBIndex: int, AIdxFrame: int, ASgnIndexInFrame: int)Group: app
Description:
to get flexray signal properties by frame indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AIdxFrame No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties ASgnIndexInFrame No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties Returns: Tuple
Example:
sgn = app.tsdb_get_flexray_signal_properties_by_frame_index(0, 0, 0) app.log_text("app.tsdb_get_flexray_signal_properties_by_frame_index(0, 0, 0): " + 'Signal Type = ' + str(sgn.FRSgnType) + ', Compu Method = ' + str(sgn.CompuMethod) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Update bit = ' + str(sgn.UpdateBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.210 tsdb_get_flexray_signal_properties_by_index
Prototype:
Tuple tsdb_get_flexray_signal_properties_by_index(ADBIndex: int, AECUIndex: int, AFrameIndex: int, ASignalIndex: int, AIsTx: bool)Group: app
Description:
to get signal properties of specified FlexRay database by indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AECUIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AFrameIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AIsTx No u16 true: this message is transmitted by node, false: this message is received by node ASignalIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties Returns: Tuple
Example:
sgn = app.tsdb_get_flexray_signal_properties_by_index(0, 0, 0, 0, False) app.log_text("flexray signal properties: " + 'Signal Type = ' + str(sgn.FRSgnType) + ', Compu Method = ' + str(sgn.CompuMethod) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Update bit = ' + str(sgn.UpdateBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.211 tsdb_get_lin_db_count
Prototype:
Tuple tsdb_get_lin_db_count()Group: app
Description:
to get all loaded LIN database countParameters: (없음)
Returns: Tuple
Example:
if app.tsdb_get_lin_db_count() == 1: app.log_text("loaded database count = " + str(1), lvlInfo)
1.212 tsdb_get_lin_db_properties_by_address
Prototype:
Tuple tsdb_get_lin_db_properties_by_address(AAddr: str)Group: app
Description:
to get properties of specified LIN database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
db = app.tsdb_get_lin_db_properties_by_address('0/LINDemo') app.log_text("lin db properties: DB index = " + str(db.DBIndex) + ', Signal count = ' + str(db.SignalCount) + ', Frame count = ' + str(db.FrameCount) + ', ECU count = ' + str(db.ECUCount) + ', Channel Mask = ' + hex(db.SupportedChannelMask) + ', Name = ' + db.Name + ', Comment = ' + db.Comment, lvlOK)
1.213 tsdb_get_lin_db_properties_by_index
Prototype:
Tuple tsdb_get_lin_db_properties_by_index(ADBIndex: int)Group: app
Description:
to get properties of specified LIN database by indexParameters:
Name Const Type Description AValue No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex property Returns: Tuple
Example:
db = app.tsdb_get_lin_db_properties_by_index(0) app.log_text("lin db properties: Signal count = " + str(db.SignalCount) + ', Frame count = ' + str(db.FrameCount) + ', ECU count = ' + str(db.ECUCount) + ', Channel Mask = ' + hex(db.SupportedChannelMask) + ', Name = ' + db.Name + ', Comment = ' + db.Comment, lvlOK)
1.214 tsdb_get_lin_ecu_properties_by_address
Prototype:
Tuple tsdb_get_lin_ecu_properties_by_address(AAddr: str)Group: app
Description:
to get ECU properties of specified LIN database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
ecu = app.tsdb_get_lin_ecu_properties_by_address('0/LINDemo/MasterNode') app.log_text("lin ecu properties: DB Index = " + str(ecu.DBIndex) + ', ECU Index = ' + str(ecu.ECUIndex) + ', Tx frame count = ' + str(ecu.TxFrameCount) + ', Rx frame count = ' + str(ecu.RxFrameCount) + ', Name = ' + ecu.Name + ', Comment = ' + ecu.Comment, lvlOK)
1.215 tsdb_get_lin_ecu_properties_by_index
Prototype:
Tuple tsdb_get_lin_ecu_properties_by_index(ADBIndex: int, AECUIndex: int)Group: app
Description:
to get ECU properties of specified LIN database by indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex properties AECUIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex properties Returns: Tuple
Example:
ecu = app.tsdb_get_lin_ecu_properties_by_index(0, 0) app.log_text("lin ecu properties: Tx frame count = " + str(ecu.TxFrameCount) + ', Rx frame count = ' + str(ecu.RxFrameCount) + ', Name = ' + ecu.Name + ', Comment = ' + ecu.Comment, lvlOK)
1.216 tsdb_get_lin_frame_properties_by_address
Prototype:
Tuple tsdb_get_lin_frame_properties_by_address(AAddr: str)Group: app
Description:
to get frame properties of specified LIN database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
fme = app.tsdb_get_lin_frame_properties_by_address('0/LINDemo/MasterNode/SteeringLampStates') app.log_text("lin frame properties: " + 'DB Index = ' + str(fme.DBIndex) + ', ECU Index = ' + str(fme.ECUIndex) + ', Frame Index = ' + str(fme.FrameIndex) + ', Is Tx = ' + str(fme.IsTx) + ', Identifier = ' + hex(fme.Identifier) + ', Signal count = ' + str(fme.SignalCount) + ', DLC = ' + str(fme.DLC) + ', Name = ' + fme.Name + ', Comment = ' + fme.Comment, lvlOK)
1.217 tsdb_get_lin_frame_properties_by_db_index
Prototype:
Tuple tsdb_get_lin_frame_properties_by_db_index(ADBIndex: int, AIndex: int)Group: app
Description:
to get LIN frame definition by index specified in database frame listParameters:
Name Const Type Description ADBIndex No u16 the index of database AFrameIndex No u16 the index from database frame list Returns: Tuple
Example:
fme = app.tsdb_get_lin_frame_properties_by_db_index(0, 0) app.log_text("lin frame properties: " + 'Identifier = ' + hex(fme.Identifier) + ', Signal count = ' + str(fme.SignalCount) + ', DLC = ' + str(fme.DLC) + ', Name = ' + fme.Name + ', Comment = ' + fme.Comment, lvlOK)
1.218 tsdb_get_lin_frame_properties_by_index
Prototype:
Tuple tsdb_get_lin_frame_properties_by_index(ADBIndex: int, AECUIndex: int, AFrameIndex: int, AIsTx: bool)Group: app
Description:
to get frame properties of specified LIN database by indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AECUIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AFrameIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AIsTx No u16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties Returns: Tuple
Example:
fme = app.tsdb_get_lin_frame_properties_by_index(0, 0, 0, True) app.log_text("lin frame properties: " + 'Identifier = ' + hex(fme.Identifier) + ', Signal count = ' + str(fme.SignalCount) + ', DLC = ' + str(fme.DLC) + ', Name = ' + fme.Name + ', Comment = ' + fme.Comment, lvlOK)
1.219 tsdb_get_lin_signal_properties_by_address
Prototype:
Tuple tsdb_get_lin_signal_properties_by_address(AAddr: str)Group: app
Description:
to get signal properties of specified LIN database by addressParameters:
Name Const Type Description AAddr No u8 the database address, can be copied in database viewer Returns: Tuple
Example:
sgn = app.tsdb_get_lin_signal_properties_by_address('0/LINDemo/MasterNode/SteeringLampStates/SteeringLampState') app.log_text("lin signal properties: " + 'DB Index = ' + str(sgn.DBIndex) + ', ECU Index = ' + str(sgn.ECUIndex) + ', Frame Index = ' + str(sgn.FrameIndex) + ', Signal Index = ' + str(sgn.SignalIndex) + ', Is Tx = ' + str(sgn.IsTx) + ', Signal Type = ' + str(sgn.LINSgnType) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.220 tsdb_get_lin_signal_properties_by_db_index
Prototype:
Tuple tsdb_get_lin_signal_properties_by_db_index(ADBIndex: int, AIndex: int)Group: app
Description:
to get LIN signal definition by index specified in database signal listParameters:
Name Const Type Description ADBIndex No u16 the index of database ASignalIndex No u16 the index fo signal Returns: Tuple
Example:
sgn = app.tsdb_get_lin_signal_properties_by_db_index(0, 0) app.log_text("lin signal properties: " + 'Signal Type = ' + str(sgn.LINSgnType) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.221 tsdb_get_lin_signal_properties_by_frame_index
Prototype:
Tuple tsdb_get_lin_signal_properties_by_frame_index(ADBIndex: int, AIdxFrame: int, ASgnIndexInFrame: int)Group: app
Description:
to get lin signal properties by frame indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties AIdxFrame No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties ASgnIndexInFrame No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex properties Returns: Tuple
Example:
sgn = app.tsdb_get_lin_signal_properties_by_index(0, 0, 0, 0, True) app.log_text("lin signa properties: " + 'Signal Type = ' + str(sgn.LINSgnType) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment, lvlOK)
1.222 tsdb_get_lin_signal_properties_by_index
Prototype:
Tuple tsdb_get_lin_signal_properties_by_index(ADBIndex: int, AECUIndex: int, AFrameIndex: int, ASignalIndex: int, AIsTx: bool)Group: app
Description:
to get signal properties of specified LIN database by indexParameters:
Name Const Type Description ADBIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties AECUIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties AFrameIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties ASignalIndex No s16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties AIsTx No u16 the returned properties data struct, please find definition in TSMaster header, please first specify its FDBIndex, FECUIndex, FFrameIndex, FSignalIndex properties Returns: Tuple
Example:
sgn = app.tsdb_get_lin_signal_properties_by_index(0, 0, 0, 0, True) app.log_text("lin signa properties: " + 'Signal Type = ' + str(sgn.LINSgnType) + ', Is Intel = ' + str(sgn.IsIntel) + ', Start bit = ' + str(sgn.StartBit) + ', Length = ' + str(sgn.Length) + ', Factor = ' + str(sgn.Factor) + ', Offset = ' + str(sgn.Offset) + ', Init Value = ' + str(sgn.InitValue) + ', Name = ' + sgn.Name + ', Comment = ' + sgn.Comment)
1.223 tsdb_load_can_db
Prototype:
int tsdb_load_can_db(AFileName: str, ASupportedChannels: str)Group: app
Description:
load databaseParameters:
Name Const Type Description AFileName No u8 The file name to be loaded ASupportedChannels No u8 Supported Channels Returns: int
Example:
r, vCANDBId1 = app.tsdb_load_can_db(r'.\Data\Demo\Databases\CAN_FD_Powertrain.dbc', '0,1') if r == 0: app.log_text(".\Data\Demo\Databases\CAN_FD_Powertrain.dbc = " + str(vCANDBId1), lvlOK)
1.224 tsdb_load_flexray_db
Prototype:
int tsdb_load_flexray_db(AFileName: str, ASupportedChannels: str)Group: app
Description:
load databaseParameters:
Name Const Type Description AFileName No u8 The file name to be loaded ASupportedChannels No u8 Supported Channels Returns: int
Example:
r, vFlexRayDBId = app.tsdb_load_flexray_db(r'.\Data\Demo\Databases\PowerTrain_v2.xml', '0,1') if r == 0: app.log_text(".\Data\Demo\Databases\PowerTrain_v2.xml' = " + str(vFlexRayDBId), lvlOK)
1.225 tsdb_load_lin_db
Prototype:
int tsdb_load_lin_db(AFileName: str, ASupportedChannels: str)Group: app
Description:
load databaseParameters:
Name Const Type Description AFileName No u8 The file name to be loaded ASupportedChannels No u8 Supported Channels Returns: int
Example:
r, vLINDBId = app.tsdb_load_lin_db(r'.\Data\Demo\Databases\LINDemo.ldf', '0,1') if r == 0: app.log_text(".\Data\Demo\Databases\LINDemo.ldf') = " + str(vLINDBId), lvlOK)
1.226 tsdb_unload_can_db
Prototype:
int tsdb_unload_can_db(AId: int)Group: app
Description:
unload can dbParameters:
Name Const Type Description AId No s16 database id Returns: int
Example:
if app.tsdb_unload_can_db(0) == 0: app.log_text("successfully unload can db", lvlOK)
1.227 tsdb_unload_can_dbs
Prototype:
int tsdb_unload_can_dbs()Group: app
Description:
unload can dbsParameters: (없음)
Returns: int
Example:
if app.tsdb_unload_can_dbs() == 0: app.log_text("successfully unload can dbs", lvlOK)
1.228 tsdb_unload_flexray_db
Prototype:
int tsdb_unload_flexray_db(AId: int)Group: app
Description:
unload flexray dbParameters:
Name Const Type Description AId No s16 database id Returns: int
Example:
if app.tsdb_unload_flexray_db(0) == 0: app.log_text("successfully unload flexray db", lvlOK)
1.229 tsdb_unload_flexray_dbs
Prototype:
int tsdb_unload_flexray_dbs()Group: app
Description:
unload flexray dbsParameters: (없음)
Returns: int
Example:
if app.tsdb_unload_flexray_dbs() == 0: app.log_text("successfully unload flexray dbs", lvlOK)
1.230 tsdb_unload_lin_db
Prototype:
int tsdb_unload_lin_db(AId: int)Group: app
Description:
unload lin dbParameters:
Name Const Type Description AId No s16 database id Returns: int
Example:
if app.tsdb_unload_lin_db(0) == 0: app.log_text("successfully unload lin db", lvlOK)
1.231 tsdb_unload_lin_dbs
Prototype:
int tsdb_unload_lin_dbs()Group: app
Description:
unload lin dbsParameters: (없음)
Returns: int
Example:
if app.tsdb_unload_lin_dbs() == 0: app.log_text("successfully unload lin dbs", lvlOK)
1.232 ui_get_component
Prototype:
Component ui_get_component(AWindowCaption: str, AComponentName: str)Group: app
Description:
get component by specifying form caption and component name inside the formParameters:
Name Const Type Description AWindowCaption No char* window caption or unique id, which can be retrieved by clicking on the window property popup menu on top right corner of the form AComponentName No char* the name of the component, such as Button1 Returns: Component
Example:
# your init code starts here... def onclk(sender): o = app.ui_get_component('3061885218246623877', 'frmSystemMsgs') if o != None: o.Caption = 'haha' self.Button1.OnClick = onclk
1.233 ui_get_form_unique_id
Prototype:
int ui_get_form_unique_id(AClassName: str, AFormIdx: int)Group: app
Description:
삿혤묏鱗깊顆寧깃街륜Parameters:
Name Const Type Description AClassName No char* 通过单击每个窗体右上角菜单项上的窗体属性按钮,可以复制窗体类名,如TfrmCANFDTrace AFormIdx No s32 닒0역迦돨뜩茄절묏鱗깊돨乞多 Returns: int
Example:
if 0 == app.ui_get_form_unique_id("TfrmSystemMsgs", 0): # unique id retrieved pass
1.234 ui_kill_form
Prototype:
int ui_kill_form(AFormCaption: str)Group: app
Description:
destroy a form and release its memoryParameters:
Name Const Type Description AFormCaption No char* caption of a form, or guid of a form Returns: int
Example:
app.ui_kill_form("12345")
1.235 ui_panel_clear_control
Prototype:
int ui_panel_clear_control(APanelName: str, AControlName: str)Group: app
Description:
clear content of a panel controlParameters:
Name Const Type Description APanelName No char* the panel window name AControlName No char* the panel control name Returns: int
Example:
app.ui_panel_clear_control("Panel1", "Gauge1")
1.236 ui_place_form
Prototype:
int ui_place_form(AFormCaption: str, ALeft: int, ATop: int, AWidth: int, AHeight: int)Group: app
Description:
place a form on specific positionParameters:
Name Const Type Description AFormCaption No char* caption of a form, or guid of a form ALeft No s32 left position, -1 means do not modify ATop No s32 top position, -1 means do not moify AWidth No s32 width of a form, -1 means do not modify AHeight No s32 height of a form, -1 means do not modify Returns: int
Example:
# place a form with guid = 12345 to top left corner (10, 20), with width = 800 and height = 600 app.ui_place_form("12345", 10, 20, 800, 600)
1.237 ui_set_form_unique_id
Prototype:
int ui_set_form_unique_id(AOldId: int, ANewId: int)Group: app
Description:
replace form unique idParameters:
Name Const Type Description AOldId No s64 old id of a form ANewId No s64 new id of a form Returns: int
Example:
# replace old id of a form to 123 id=app.ui_get_form_unique_id("TfrmSystemMsgs", 0) app.ui_set_form_unique_id(id, 123)
1.238 ui_show_form
Prototype:
int ui_show_form(AFormCaption: str, AShow: bool)Group: app
Description:
show form by its caption or unique idParameters:
Name Const Type Description AFormCaption No char* caption of a form, or guid of a form AShow No boolean true: show it; false: hide it Returns: int
Example:
# display a form with guid = 12345 app.ui_show_form("12345", true) # hide a form with caption = "tx form" app.ui_show_form("tx form", false)
1.239 ui_show_open_file_dialog
Prototype:
int ui_show_open_file_dialog(ATitle: str, AFileTypeDesc: str, AFilter: str, ASuggestFileName: str)Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
1.240 ui_show_page_by_index
Prototype:
int ui_show_page_by_index(AIndex: int)Group: app
Description:
show the specified page by index in user interfaceParameters:
Name Const Type Description AIndex No s16 the index from 0 to page count - 1 Returns: int
Example:
# navigate to the second page app.ui_show_page_by_index(1)
1.241 ui_show_page_by_name
Prototype:
int ui_show_page_by_name(AName: str)Group: app
Description:
show the specified page by name in user interfaceParameters:
Name Const Type Description AName No u8 the name of the page Returns: int
Example:
# navigate to page "New1" app.ui_show_page_by_name("New1")
1.242 ui_show_save_file_dialog
Prototype:
int ui_show_save_file_dialog(ATitle: str, AFileTypeDesc: str, AFilter: str, ASuggestFileName: str)Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
1.243 ui_show_select_directory_dialog
Prototype:
int ui_show_select_directory_dialog()Group: app
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
1.244 ui_toggle_mdi_form
Prototype:
int ui_toggle_mdi_form(AFormCaption: str, AIsMDI: bool)Group: app
Description:
toggle a form between MDI and normal formParameters:
Name Const Type Description AFormCaption No char* caption of a form, or guid of a form AIsMDI No boolean true: MDI form, false: normal form Returns: int
Example:
# set form to normal form app.ui_toggle_mdi_form("12345", false)
1.245 unload_plugin
Prototype:
int unload_plugin(APluginName: str)Group: app
Description:
unload an internal plugin by nameParameters:
Name Const Type Description APluginName No u8 the plugin name to be unloaded Returns: int
Example:
if 0 == app.unload_plugin("rtlUIUDSCodeGen.bpl"): app.log_text("plugin is now unloaded from memory", lvlOK)
1.246 wait
Prototype:
int wait(AInstance: MpInstance, ATimeMs: int, AMsg: str)Group: app
Description:
wait for a specific time period in ms before executing the next statementsParameters:
Name Const Type Description AInstance No pdouble This is an instance ATimeMs No s16 Wait time in milliseconds AMsg No u8 message for waiting Returns: int
Example:
app.wait(Instance, 333, "wait CANTx to perform")
1.247 wait_system_var
Prototype:
int wait_system_var(ACompleteName: str, AValue: str, ATimeOutMs: int)Group: app
Description:
wait system variable value reaches desiredParameters:
Name Const Type Description ACompleteName No u8 the complete name of system variable AValue No u8 value representation in string ATimeoutMs No s16 timeout in milliseconds Returns: int
Example:
if 0 == app.wait_system_var("a", "1", 1000) == 0: app.log_text("a reaches 1 within 1s", lvlOK)
1.248 wait_system_var_disappear
Prototype:
int wait_system_var_disappear(ACompleteName: str, ATimeOutMs: int)Group: app
Description:
wait until specific system variable existsParameters:
Name Const Type Description ACompleteName No u8 the complete name of system variable ATimeoutMs No s16 timeout time in milliseconds Returns: int
Example:
if 0 == app.wait_system_var_disappear('non_existing', 1): app.log_text("var1 disappears", lvlOK) else: app.log_text("var1 still exists after 1000ms", lvlOK)
1.249 wait_system_var_existance
Prototype:
int wait_system_var_existance(ACompleteName: str, ATimeOutMs: int)Group: app
Description:
wait until specific system variable existsParameters:
Name Const Type Description ACompleteName No u8 the complete name of system variable ATimeoutMs No s16 timeout time in milliseconds Returns: int
Example:
if app.wait_system_var_existance('Application.Connected', 1) == 0: app.log_text("var1 appears", lvlOK) else: app.log_text("var1 not exists within 1000ms", lvlOK)
1.250 write_mat_file_end
Prototype:
int write_mat_file_end(AHandle: int)Group: app
Description:
stop writing and close the mat fileParameters:
Name Const Type Description AHandle No s16 the mat file object for writing Returns: int
Example:
r, h = app.write_mat_file_start('mat_file.mat') app.write_mat_file_end(h)
1.251 write_mat_file_start
Prototype:
Tuple write_mat_file_start(AFileName: str)Group: app
Description:
start to write a mat fileParameters:
Name Const Type Description AFileName No u8 the destination file name specified Returns: Tuple
Example:
r, h = app.write_mat_file_start('mat_file.mat') app.log_text("app.write_mat_file_start('mat_file.mat') = " + str(h), lvlOK)
1.252 write_mat_file_variable_double
Prototype:
int write_mat_file_variable_double(AHandle: int, AVarName: str, AValue: float)Group: app
Description:
write a single double signal into mat fileParameters:
Name Const Type Description AHandle No s16 the mat file object for writing AVarName No u8 the variable name AValue No s32 the variable value Returns: int
Example:
r, h = app.write_mat_file_start('mat_file.mat') app.write_mat_file_variable_double(h, 'var_double', 1.234)
1.253 write_mat_file_variable_double_array
Prototype:
int write_mat_file_variable_double_array(AHandle: int, AVarName: str, AArray: typing.List[float])Group: app
Description:
write an array of double into mat fileParameters:
Name Const Type Description AHandle No s16 the mat file object for writing AVarName No u8 the variable name of the double array AArray No pu32 the first address of the double array Returns: int
Example:
r, h = app.write_mat_file_start('mat_file.mat') app.write_mat_file_variable_double_array(h, 'var_double_array', [1.23, 2.34, 3.45])
1.254 write_mat_file_variable_string
Prototype:
int write_mat_file_variable_string(AHandle: int, AVarName: str, AValue: str)Group: app
Description:
write a string variable into mat fileParameters:
Name Const Type Description AHandle No s16 the mat file object for writing AVarName No u8 the name of the string variable AValue No u8 the value of the string variable Returns: int
Example:
r, h = app.write_mat_file_start('mat_file.mat') app.write_mat_file_variable_string(h, 'var_string', 'this is a string variable')
1.255 write_realtime_comment
Prototype:
int write_realtime_comment(AInstance: MpInstance, AName: str)Group: app
Description:
add realtime comment into system measurement environmentParameters:
Name Const Type Description AInstance No pdouble This is an instance AName No u8 comment string Returns: int
Example:
app.write_realtime_comment(Instance, 'this is a real-time comment')
1.256 write_text_file_end
Prototype:
int write_text_file_end(AHandle: int)Group: app
Description:
close the previously opened text fileParameters:
Name Const Type Description AHandle No s16 the handle created by write_text_file_start function Returns: int
Example:
r, h = app.write_text_file_start('csv_file.csv') app.write_text_file_end(h)
1.257 write_text_file_line
Prototype:
int write_text_file_line(AHandle: int, ALine: str)Group: app
Description:
write a line of the text fileParameters:
Name Const Type Description AHandle No s16 the handle created by write_text_file_start function ALine No u8 the line to be added into the test file Returns: int
Example:
r, h = app.write_text_file_start('csv_file.csv') app.write_text_file_line(h, 'this is a line of text file')
1.258 write_text_file_line_double_array
Prototype:
int write_text_file_line_double_array(AHandle: int, AArray: typing.List[float])Group: app
Description:
write a double array into the previously created text fileParameters:
Name Const Type Description AHandle No s16 the handle created by write_text_file_start function AArray No pu32 the first address of the double array Returns: int
Example:
r, h = app.write_text_file_start('csv_file.csv') app.write_text_file_line_double_array(h, [11.1,22.2,33.3])
1.259 write_text_file_line_string_array
Prototype:
int write_text_file_line_string_array(AHandle: int, AArray: typing.List[str])Group: app
Description:
write a string array into the previously created text fileParameters:
Name Const Type Description AHandle No s16 the handle created by write_text_file_start function AArray No pu32 the first address of the double array Returns: int
Example:
r, h = app.write_text_file_start('csv_file.csv') app.write_text_file_line_string_array(h, ['string 1', 'string 2', 'string 3'])
1.260 write_text_file_start
Prototype:
Tuple write_text_file_start(AFileName: str)Group: app
Description:
create a text file for writingParameters:
Name Const Type Description AFileName No u8 the file name of the text file Returns: Tuple
Example:
r, h = app.write_text_file_start('csv_file.csv') app.log_text("app.write_text_file_start('csv_file.csv') = " + str(h), lvlOK)
2. com
2.1 add_cyclic_message_can
Prototype:
int add_cyclic_message_can(ACAN: RawCAN, APeriodMS: float)Group: com
Description:
send specific CAN messages periodically, or update already scheduled CAN messageParameters:
Name Const Type Description ACAN No u32 the CAN message to be scheduled or updated APeriodMS No s32 period in milliseconds Returns: int
Example:
can = RawCAN(0x123, 8, CH1, 0, [1,2,3,4,5,6,7,8]) com.add_cyclic_message_can(can, 100)
2.2 block_current_pretx
Prototype:
int block_current_pretx(AInstance: MpInstance)Group: com
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
2.3 can_pdu_container_get_cycle_by_index
Prototype:
Tuple can_pdu_container_get_cycle_by_index(AIdxChn: int, AMsgId: int, AIdxCycle: int)Group: com
Description:
to get which PDUs are to be packed in certain cycle of specific CAN FD PDU containersParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AMsgId No s16 the CAN FD message identifier AIdxCycle No s16 cycle index starting from 0 Returns: Tuple
Example:
# to get PDU list in the first cycle of CAN FD message 0x7A a = com.can_pdu_container_get_cycle_by_index(CH1, 0x7A, 0) if a == 0: app.log_text("PDU list is: %s" % str(a), lvlOK)
2.4 can_pdu_container_get_cycle_count
Prototype:
Tuple can_pdu_container_get_cycle_count(AIdxChn: int, AMsgId: int)Group: com
Description:
get total PDU container cycle count of specific CAN FD messageParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AMsgId No s16 the CAN FD message identifier Returns: Tuple
Example:
# get 0x7A's PDU cycle count if 0 == com.can_pdu_container_get_cycle_count(CH1, 0x7A): pass # ok
2.5 can_pdu_container_refresh
Prototype:
int can_pdu_container_refresh(AIdxChn: int, AMsgId: int)Group: com
Description:
to refresh all cycles of specific CAN FD message for settings to take effectParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AMsgId No s16 the CAN FD message identifier Returns: int
Example:
# refresh CAN FD message 0x7A if 0 == com.can_pdu_container_refresh(CH1, 0x7A): pass # ok
2.6 can_pdu_container_set_cycle_by_index
Prototype:
int can_pdu_container_set_cycle_by_index(AIdxChn: int, AMsgId: int, AIdxCycle: int, ASignalGroupIdList: str)Group: com
Description:
set which PDUs are to be packed in certain cycle of specific CAN FD PDU containersParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AMsgId No s16 the CAN FD message identifier AIdxCycle No s16 cycle index starting from 0 APDUIdList No u8 PDU id list separated by comma Returns: int
Example:
# to set PDU1(Id = 12345) and PDU2(Id = 12346) in the first cycle of CAN FD message 0x7A if 0 == com.can_pdu_container_set_cycle_by_index(CH1, 0x7A, 0, "12345,12346"): pass # ok
2.7 can_pdu_container_set_cycle_count
Prototype:
int can_pdu_container_set_cycle_count(AIdxChn: int, AMsgId: int, ACount: int)Group: com
Description:
set cycle count of PDU containers in specific CAN FD messageParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AMsgId No s16 the CAN FD message identifier ACount No s16 total count of cycle to be set Returns: int
Example:
# set 0x7A's PDU cycle count = 3 if 0 == com.can_pdu_container_set_cycle_count(CH1, 0x7A, 3): pass # ok
2.8 can_rbs_activate_all_networks
Prototype:
int can_rbs_activate_all_networks(AEnable: bool, AIncludingChildren: bool)Group: com
Description:
set activate or deactivate all networksParameters:
Name Const Type Description AEnable No u16 whether all networks are activated AIncludingChildren No u16 whether all nodes and messages are also activated Returns: int
Example:
if com.can_rbs_activate_all_networks(True, True) == 0: app.log_text("can rbs succesfully activate all networks", lvlOK)
2.9 can_rbs_activate_message_by_name
Prototype:
int can_rbs_activate_message_by_name(AIdxChn: int, AEnable: bool, ANetworkName: str, ANodeName: str, AMsgName: str)Group: com
Description:
activate or deactivate a message or notParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AEnable No u16 whether activate the specified message ANetworkName No u8 network name containing this node with message ANodeName No u8 node name containing this message AMessageName No u8 message name to be activated or not Returns: int
Example:
if com.can_rbs_activate_message_by_name(CH2, False, 'CAN_FD_Powertrain', 'Engine', 'EngineData') == 0: app.log_text("can rbs succesfully activate message", lvlOK)
2.10 can_rbs_activate_network_by_name
Prototype:
int can_rbs_activate_network_by_name(AIdxChn: int, AEnable: bool, ANetworkName: str, AIncludingChildren: bool)Group: com
Description:
activate or deactivate a network or notParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AEnable No u16 whether activate the specified network ANetworkName No u8 network name to be activated or deactivated AIncludingChildren No u16 whether all nodes and messages are also activated Returns: int
Example:
if com.can_rbs_activate_network_by_name(CH2, False, 'CAN_FD_Powertrain', False) == 0: app.log_text("can rbs succesfully activate network", lvlOK)
2.11 can_rbs_activate_node_by_name
Prototype:
int can_rbs_activate_node_by_name(AIdxChn: int, AEnable: bool, ANetworkName: str, ANodeName: str, AIncludingChildren: bool)Group: com
Description:
activate or deactivate a node or notParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AEnable No u16 whether activate the specified node ANetworkName No u8 network name containing this node ANodeName No u8 node name to be activated or deactivated AIncludingChildren No u16 whether all messages are also activated Returns: int
Example:
if com.can_rbs_activate_node_by_name(CH2, False, 'CAN_FD_Powertrain', 'Engine', False) == 0: app.log_text("can rbs succesfully activate node", lvlOK)
2.12 can_rbs_batch_set_end
Prototype:
int can_rbs_batch_set_end()Group: com
Description:
stop signal batch set operation, after this call, all cached signals are updated, this ensures only one frame is triggered when multiple signals inside it are setParameters: (없음)
Returns: int
Example:
com.can_rbs_batch_set_start() # message will not be triggered before can_rbs_batch_set_end com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn1", 1.2) com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn2", 3.4) # ... com.can_rbs_batch_set_end() # message "frame1" will be triggered
2.13 can_rbs_batch_set_signal
Prototype:
int can_rbs_batch_set_signal(ASymbolAddress: str, AValue: float)Group: com
Description:
set signal in CAN RBS in batch modeParameters:
Name Const Type Description ASymbolAddress No u8 the database signal address AValue No s32 the value of signal to be set Returns: int
Example:
com.can_rbs_batch_set_start() # message will not be triggered before can_rbs_batch_set_end com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn1", 1.2) com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn2", 3.4) # ... com.can_rbs_batch_set_end() # message "frame1" will be triggered
2.14 can_rbs_batch_set_start
Prototype:
int can_rbs_batch_set_start()Group: com
Description:
start signal batch set operation, after this call, all signal settings are cached until can_rbs_batch_set_end is called, this ensures only one frame is triggered when multiple signals inside it are setParameters: (없음)
Returns: int
Example:
com.can_rbs_batch_set_start() # message will not be triggered before can_rbs_batch_set_end com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn1", 1.2) com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn2", 3.4) # ... com.can_rbs_batch_set_end() # message "frame1" will be triggered
2.15 can_rbs_configure
Prototype:
int can_rbs_configure(AAutoStart: bool, AAutoSendOnModification: bool, AActivateNodeSimulation: bool, AInitValueOptions: int)Group: com
Description:
configure CAN RBS engineParameters:
Name Const Type Description AAutoStart No u16 whether RBS is auto started when application is connected AAutoSendOnModification No u16 whether auto send modified message if its signal is modified, only valid for non-cyclic messages AActivateNodeSimulation No u16 whether activate node behaviors simulation AInitValueOptions No u8 TLIBRBSInitValueOptions type Returns: int
Example:
if com.can_rbs_configure(False, True, True, 0) == 0: app.log_text("can rbs succesfully configure", lvlOK)
2.16 can_rbs_enable
Prototype:
int can_rbs_enable(AEnable: bool)Group: com
Description:
temporary enable or disable CAN RBS engine, this function is used to post configure RBS engine before after it is startedParameters:
Name Const Type Description AEnable No u16 true: enable RBS functionality; false: disable RBS Tx Returns: int
Example:
# Disable message transmission after rbs_start com.can_rbs_enable(False) com.can_rbs_start() com.can_rbs_set_signal_value_by_address("xxxxx", 1.234) com.can_rbs_enable(True) # messages are transmitted after enabling RBS
2.17 can_rbs_fault_inject_clear
Prototype:
int can_rbs_fault_inject_clear()Group: com
Description:
disable CAN rbs fault injection engineParameters: (없음)
Returns: int
Example:
# to disable rbs fault injection engine com.can_rbs_fault_inject_clear()
2.18 can_rbs_fault_inject_message_lost
Prototype:
int can_rbs_fault_inject_message_lost(AEnable: bool, AIdxChn: int, AIdentifier: int)Group: com
Description:
to disable certain message transmissionParameters:
Name Const Type Description AEnable No u16 true: enable message lost, false: disable this injection AIdxChn No s16 the channel index starting from 0 AIdentifier No s16 the message identifier for message lost Returns: int
Example:
# disable transmission of 0x123 on CH2 if com.can_rbs_fault_inject_message_lost(True, CH2, 0x123) == 0: app.log_text("can rbs fault inject message lost", lvlOK)
2.19 can_rbs_fault_inject_signal_alter
Prototype:
int can_rbs_fault_inject_signal_alter(AEnable: bool, ASymbolAddress: str, AAlterValue: float)Group: com
Description:
to freeze specific signal value to a certain valueParameters:
Name Const Type Description AEnable No u16 true: to freeze signal value, false: to disable this injection ASymbolAddress No u8 the signal symbol address from CAN rbs engine AAlteredValue No s32 the altered value for signla freezing Returns: int
Example:
# to freeze signal "Gear" to 2 if com.can_rbs_fault_inject_signal_alter(True, "0/CAN_FD_Powertrain/Engine/EngineData/Gear", 2) == 0: app.log_text("can rbs fault inject signal alter", lvlOK)
2.20 can_rbs_get_signal_value_by_address
Prototype:
Tuple can_rbs_get_signal_value_by_address(ASymbolAddress: str)Group: com
Description:
get signal real-time value from CAN RBS using signal database addressParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in CAN database selector, by double clicking on the statusbar of selected symbol Returns: Tuple
Example:
r, v = com.can_rbs_get_signal_value_by_address('0/CAN_FD_Powertrain/Engine/EngineData/EngSpeed') if r and v == 1234: app.log_text("can rbs successfully get signal value", lvlOK)
2.21 can_rbs_get_signal_value_by_element
Prototype:
Tuple can_rbs_get_signal_value_by_element(AIdxChn: int, ANetworkName: str, ANodeName: str, AMsgName: str, ASignalName: str)Group: com
Description:
get signal real-time value from CAN RBS using element nameParameters:
Name Const Type Description AIdxChn No s16 CAN logical channel ANetworkName No u8 network name containing this signal ANodeName No u8 node name containing this signal AMsgName No u8 message name containing this signal ASignalName No u8 signal name to get value Returns: Tuple
Example:
r, v = com.can_rbs_get_signal_value_by_element(CH1, 'CAN_FD_Powertrain', 'Engine', 'EngineData', 'EngSpeed') if r and v == 2345: app.log_text("can rbs successfully get signal value", lvlOK)
2.22 can_rbs_is_running
Prototype:
bool can_rbs_is_running()Group: com
Description:
check if CAN RBS is runningParameters: (없음)
Returns: bool
Example:
com.can_rbs_is_running()
2.23 can_rbs_set_crc_signal
Prototype:
int can_rbs_set_crc_signal(ASymbolAddress: str, AAlgorithmName: str, AIdxByteStart: int, AByteCount: int)Group: com
Description:
set signal as CRC signalParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in CAN database selector, by double clicking on the statusbar of selected symbol AAlgorithmName No u8 Algorithm function name in mini program library, such as crc.crc8 AIdxByteStart No s16 Byte offset for CRC protection in data segment AByteCount No s16 Byte count for CRC protection Returns: int
Example:
# you can copy symbol address in CAN RBS window or database window if com.can_rbs_set_crc_signal("0/CAN_FD_Powertrain/Engine/EngineData/Gear", "crc.crc8", 0, 7) == 0: app.log_text("can rbs successfully set crc signal", lvlOK)
2.24 can_rbs_set_message_cycle_by_name
Prototype:
int can_rbs_set_message_cycle_by_name(AIdxChn: int, AIntervalMs: int, ANetworkName: str, ANodeName: str, AMsgName: str)Group: com
Description:
set message interval in msParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AIntervalMs No s16 message cycle in milli-seconds ANetworkName No u8 network name containing this node with message ANodeName No u8 node name containing this message AMessageName No u8 message name to be activated or not Returns: int
Example:
if com.can_rbs_set_message_cycle_by_name(CH1, 10, 'CAN_FD_Powertrain', 'Engine', 'EngineData') == 0: app.log_text("can rbs succesfully set message cycle", lvlOK)
2.25 can_rbs_set_message_direction
Prototype:
int can_rbs_set_message_direction(AIdxChn: int, AIsTx: bool, ANetworkName: str, ANodeName: str, AMsgName: str)Group: com
Description:
set a node's message as tx or rx messageParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AIsTx No u16 true: this message is transmitted by node, false: this message is received by node ANetworkName No u8 network name containing this node with message ANodeName No u8 node name containing this message AMessageName No u8 message name, if left blank, all messages of this node will be modified Returns: int
Example:
# to set all messages of Node1 as transmit message com.can_rbs_set_message_direction(CH1, True, "Network1", "Node1", "") # to set a specific message as transmit message com.can_rbs_set_message_direction(CH1, True, "Network1", "Node1", "Message1")
2.26 can_rbs_set_normal_signal
Prototype:
int can_rbs_set_normal_signal(ASymbolAddress: str)Group: com
Description:
set signal as normal signalParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in CAN database selector, by double clicking on the statusbar of selected symbol Returns: int
Example:
# you can copy symbol address in CAN RBS window or database window if com.can_rbs_set_normal_signal("0/CAN_FD_Powertrain/Engine/EngineData/Gear") == 0: app.log_text("can rbs successfully set normal signal", lvlOK)
2.27 can_rbs_set_rc_signal
Prototype:
int can_rbs_set_rc_signal(ASymbolAddress: str)Group: com
Description:
set signal as rolling counter signalParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in CAN database selector, by double clicking on the statusbar of selected symbol Returns: int
Example:
# you can copy symbol address in CAN RBS window or database window if com.can_rbs_set_rc_signal("0/CAN_FD_Powertrain/Engine/EngineData/Gear") == 0: app.log_text("can rbs successfully set rc signal", lvlOK)
2.28 can_rbs_set_rc_signal_with_limit
Prototype:
int can_rbs_set_rc_signal_with_limit(ASymbolAddress: str, ALowerLimit: int, AUpperLimit: int)Group: com
Description:
set signal as rolling counter signalParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in CAN database selector, by double clicking on the statusbar of selected symbol ALowerLimit No s16 rolling counter min value AUpperLimit No s16 rolling counter max value Returns: int
Example:
# you can copy symbol address in CAN RBS window or database window if com.can_rbs_set_rc_signal_with_limit("0/CAN_FD_Powertrain/Engine/EngineData/Gear", 0, 15) == 0: app.log_text("can rbs successfully set rc signal", lvlOK)
2.29 can_rbs_set_signal_value_by_address
Prototype:
int can_rbs_set_signal_value_by_address(ASymbolAddress: str, AValue: float)Group: com
Description:
set signal real-time value from CAN RBS using signal database addressParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in CAN database selector, by double clicking on the statusbar of selected symbol AValue No s32 Signal real-time physical value retrieved Returns: int
Example:
com.can_rbs_set_signal_value_by_address('0/CAN_FD_Powertrain/Engine/EngineData/EngSpeed', 1234)
2.30 can_rbs_set_signal_value_by_element
Prototype:
int can_rbs_set_signal_value_by_element(AIdxChn: int, ANetworkName: str, ANodeName: str, AMsgName: str, ASignalName: str, AValue: float)Group: com
Description:
set signal real-time value from CAN RBS using element nameParameters:
Name Const Type Description AIdxChn No s16 CAN logical channel ANetworkName No u8 network name containing this signal ANodeName No u8 node name containing this signal AMsgName No u8 message name containing this signal ASignalName No u8 signal name to get value AValue No s32 the physical value of this signal in real time Returns: int
Example:
com.can_rbs_set_signal_value_by_element(CH1, 'CAN_FD_Powertrain', 'Engine', 'EngineData', 'EngSpeed', 2345)
2.31 can_rbs_start
Prototype:
int can_rbs_start()Group: com
Description:
start CAN RBS engineParameters: (없음)
Returns: int
Example:
com.can_rbs_start()
2.32 can_rbs_stop
Prototype:
int can_rbs_stop()Group: com
Description:
Stop CAN RBS engineParameters: (없음)
Returns: int
Example:
com.can_rbs_stop()
2.33 clear_bus_statistics
Prototype:
int clear_bus_statistics()Group: com
Description:
clear bus statistics dataParameters: (없음)
Returns: int
Example:
# clear all statistics data com.clear_bus_statistics()
2.34 del_cyclic_message_can
Prototype:
int del_cyclic_message_can(ACAN: RawCAN)Group: com
Description:
remove already scheduled periodic CAN transmissionParameters:
Name Const Type Description ACAN No PCAN the message to be deleted, the channel index and identifier should be initialized Returns: int
Example:
can = RawCAN(0x123, 8, CH1, 0, [1,2,3,4,5,6,7,8]) if 0 == com.del_cyclic_message_can(can): pass # this message is deleted
2.35 del_cyclic_messages
Prototype:
int del_cyclic_messages()Group: com
Description:
remove all scheduled periodic CAN, CAN FD messages transmissionParameters: (없음)
Returns: int
Example:
# stop sending any periodic messages com.del_cyclic_messages()
2.36 enable_bus_statistics
Prototype:
int enable_bus_statistics(AEnable: bool)Group: com
Description:
enable bus statistics timer to calculate bus statisticsParameters:
Name Const Type Description AEnable No u16 true: enable bus statistics timer; false: disable bus statistics timer Returns: int
Example:
# enable bus statistics timer com.enable_bus_statistics(True)
2.37 flexray_rbs_activate_all_clusters
Prototype:
int flexray_rbs_activate_all_clusters(AEnable: bool, AIncludingChildren: bool)Group: com
Description:
set activate or deactivate all clustersParameters:
Name Const Type Description AEnable No u16 whether all clusters are activated AIncludingChildren No u16 whether all ECUs and frames are also activated Returns: int
Example:
if com.flexray_rbs_activate_all_clusters(True, True) == 0: app.log_text("flexray rbs successfully activate all clusters", lvlOK)
2.38 flexray_rbs_activate_cluster_by_name
Prototype:
int flexray_rbs_activate_cluster_by_name(AIdxChn: int, AEnable: bool, AClusterName: str, AIncludingChildren: bool)Group: com
Description:
activate or deactivate a cluster or notParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AEnable No u16 whether activate the specified cluster AClusterName No u8 cluster name to be activated or deactivated AIncludingChildren No u16 whether all ECUs and frames are also activated Returns: int
Example:
if com.flexray_rbs_activate_cluster_by_name(CH1, True, 'PowerTrain', True) == 0: app.log_text("flexray rbs successfully activate cluster", lvlOK)
2.39 flexray_rbs_activate_ecu_by_name
Prototype:
int flexray_rbs_activate_ecu_by_name(AIdxChn: int, AEnable: bool, AClusterName: str, AECUName: str, AIncludingChildren: bool)Group: com
Description:
activate or deactivate a ECU or notParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AEnable No u16 whether activate the specified ECU AClusterName No u8 cluster name containing this ECU AECUName No u8 ECU name to be activated or deactivated AIncludingChildren No u16 whether all frames are also activated Returns: int
Example:
if com.flexray_rbs_activate_ecu_by_name(CH1, False, 'PowerTrain', 'Engine', False) == 0: app.log_text("flexray rbs successfully activate ecu", lvlOK)
2.40 flexray_rbs_activate_frame_by_name
Prototype:
int flexray_rbs_activate_frame_by_name(AIdxChn: int, AEnable: bool, AClusterName: str, AECUName: str, AFrameName: str)Group: com
Description:
activate or deactivate a frame or notParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AEnable No u16 whether activate the specified frame AClusterName No u8 cluster name containing this ECU with frame AECUName No u8 ECU name containing this frame AFrameName No u8 frame name to be activated or not Returns: int
Example:
if com.flexray_rbs_activate_frame_by_name(CH1, False, 'PowerTrain', 'Engine', 'EngineData') == 0: app.log_text("flexray rbs successfully activate frame", lvlOK)
2.41 flexray_rbs_batch_set_end
Prototype:
int flexray_rbs_batch_set_end()Group: com
Description:
stop signal batch set operation, after this call, all cached signals are updated, this ensures only one frame is triggered when multiple signals inside it are setParameters: (없음)
Returns: int
Example:
com.flexray_rbs_batch_set_start() # message will not be triggered before can_rbs_batch_set_end com.flexray_rbs_batch_set_signal("0/cluster1/ecu1/frame1/sgn1", 1.2) com.flexray_rbs_batch_set_signal("0/cluster1/ecu1/frame1/sgn2", 3.4) # ... com.flexray_rbs_batch_set_end() # message "frame1" will be triggered
2.42 flexray_rbs_batch_set_signal
Prototype:
int flexray_rbs_batch_set_signal(ASymbolAddress: str, AValue: float)Group: com
Description:
set signal in FlexRay RBS in batch modeParameters:
Name Const Type Description ASymbolAddress No u8 the database signal address AValue No s32 the value of signal to be set Returns: int
Example:
com.flexray_rbs_batch_set_start() # message will not be triggered before can_rbs_batch_set_end com.flexray_rbs_batch_set_signal("0/cluster1/ecu1/frame1/sgn1", 1.2) com.flexray_rbs_batch_set_signal("0/cluster1/ecu1/frame1/sgn2", 3.4) # ... com.flexray_rbs_batch_set_end() # message "frame1" will be triggered
2.43 flexray_rbs_batch_set_start
Prototype:
int flexray_rbs_batch_set_start()Group: com
Description:
start signal batch set operation, after this call, all signal settings are cached until can_rbs_batch_set_end is called, this ensures only one frame is triggered when multiple signals inside it are setParameters: (없음)
Returns: int
Example:
com.flexray_rbs_batch_set_start() # message will not be triggered before can_rbs_batch_set_end com.flexray_rbs_batch_set_signal("0/cluster1/ecu1/frame1/sgn1", 1.2) com.flexray_rbs_batch_set_signal("0/cluster1/ecu1/frame1/sgn2", 3.4) # ... com.flexray_rbs_batch_set_end() # message "frame1" will be triggered
2.44 flexray_rbs_configure
Prototype:
int flexray_rbs_configure(AAutoStart: bool, AAutoSendOnModification: bool, AActivateECUSimulation: bool, AInitValueOptions: int)Group: com
Description:
configure FlexRay RBS engineParameters:
Name Const Type Description AAutoStart No u16 whether RBS is auto started when application is connected AAutoSendOnModification No u16 whether auto send modified frame if its signal is modified AActivateECUSimulation No u16 whether activate ECU behaviors simulation AInitValueOptions No s16 TLIBRBSInitValueOptions type Returns: int
Example:
if com.flexray_rbs_configure(False, True, True, 0) == 0: app.log_text("flexray rbs successfully configure", lvlOK)
2.45 flexray_rbs_enable
Prototype:
int flexray_rbs_enable(AEnable: bool)Group: com
Description:
temporary enable or disable FlexRay RBS engine, this function is used to post configure RBS engine before after it is startedParameters:
Name Const Type Description AEnable No u16 true: enable RBS functionality; false: disable RBS Tx Returns: int
Example:
# Disable message transmission after rbs_start com.flexray_rbs_enable(False) com.flexray_rbs_start() com.flexray_rbs_set_signal_value_by_address("0/PowerTrain/Engine/EngineData/EngForce", 1.234) com.flexray_rbs_enable(True) # messages are transmitted after enabling RBS
2.46 flexray_rbs_get_signal_value_by_address
Prototype:
Tuple flexray_rbs_get_signal_value_by_address(ASymbolAddress: str)Group: com
Description:
get signal real-time value from FlexRay RBS using signal database addressParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in FlexRay database selector, by double clicking on the statusbar of selected symbol Returns: Tuple
Example:
r, v = com.flexray_rbs_get_signal_value_by_address('0/PowerTrain/Engine/EngineData/EngSpeed') if r and v == 1234: app.log_text("flexray rbs successfully get signal value", lvlOK)
2.47 flexray_rbs_get_signal_value_by_element
Prototype:
Tuple flexray_rbs_get_signal_value_by_element(AIdxChn: int, AClusterName: str, AECUName: str, AFrameName: str, ASignalName: str)Group: com
Description:
get signal real-time value from FlexRay RBS using element nameParameters:
Name Const Type Description AIdxChn No s16 FlexRay logical channel AClusterName No u8 cluster name containing this signal AECUName No u8 ecu name containing this signal AFrameName No u8 frame name containing this signal ASignalName No u8 signal name to get value Returns: Tuple
Example:
r, v = com.flexray_rbs_get_signal_value_by_element(CH1, 'PowerTrain', 'Engine', 'EngineData', 'EngSpeed') if r and v == 2345: app.log_text("flexray rbs successfully get signal", lvlOK)
2.48 flexray_rbs_is_running
Prototype:
bool flexray_rbs_is_running()Group: com
Description:
check if FlexRay RBS is runningParameters: (없음)
Returns: bool
Example:
com.flexray_rbs_is_running()
2.49 flexray_rbs_set_crc_signal
Prototype:
int flexray_rbs_set_crc_signal(ASymbolAddress: str, AAlgorithmName: str, AIdxByteStart: int, AByteCount: int)Group: com
Description:
set signal as CRC signalParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in FlexRay database selector, by double clicking on the statusbar of selected symbol AAlgorithmName No u8 Algorithm function name in mini program library, such as crc.crc8 AIdxByteStart No s16 Byte offset for CRC protection in data segment AByteCount No s16 Byte count for CRC protection Returns: int
Example:
if com.flexray_rbs_set_crc_signal('0/PowerTrain/Engine/EngineData/EngForce', "crc.crc8", 0, 7) == 0: app.log_text("flexray rbs set Crc signal", lvlOK)
2.50 flexray_rbs_set_frame_direction
Prototype:
int flexray_rbs_set_frame_direction(AIdxChn: int, AIsTx: bool, AClusterName: str, AECUName: str, AFrameName: str)Group: com
Description:
set a ECU's frame as tx or rx frameParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AIsTx No u16 true: this frame is transmitted by ECU, false: this frame is received by ECU AClusterName No u8 Cluster name containing this ECU with frame AECUName No u8 ECU name containing this frame AFrameName No u8 frame name, if left blank, all frames of this ECU will be modified Returns: int
Example:
if com.flexray_rbs_set_frame_direction(CH1, False, 'PowerTrain', 'Engine', 'EngineStatus') == 0: app.log_text("flexray rbs set frame direction", lvlOK)
2.51 flexray_rbs_set_normal_signal
Prototype:
int flexray_rbs_set_normal_signal(ASymbolAddress: str)Group: com
Description:
set signal as normal signalParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in FlexRay database selector, by double clicking on the statusbar of selected symbol Returns: int
Example:
if com.flexray_rbs_set_normal_signal('0/PowerTrain/Engine/EngineData/EngForce') == 0: app.log_text("flexray rbs set normal signal", lvlOK)
2.52 flexray_rbs_set_rc_signal
Prototype:
int flexray_rbs_set_rc_signal(ASymbolAddress: str)Group: com
Description:
set signal as rolling counter signalParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in FlexRay database selector, by double clicking on the statusbar of selected symbol Returns: int
Example:
if com.flexray_rbs_set_rc_signal('0/PowerTrain/Engine/EngineData/EngForce') == 0: app.log_text("flexray rbs set rc signal", lvlOK)
2.53 flexray_rbs_set_rc_signal_with_limit
Prototype:
int flexray_rbs_set_rc_signal_with_limit(ASymbolAddress: str, ALowerLimit: int, AUpperLimit: int)Group: com
Description:
set signal as rolling counter signalParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in FlexRay database selector, by double clicking on the statusbar of selected symbol ALowerLimit No s16 rolling counter min value AUpperLimit No s16 rolling counter max value Returns: int
Example:
if com.flexray_rbs_set_rc_signal_with_limit('0/PowerTrain/Engine/EngineData/EngForce', 3, 16) == 0: app.log_text("flexray rbs set rc signal", lvlOK)
2.54 flexray_rbs_set_signal_value_by_address
Prototype:
int flexray_rbs_set_signal_value_by_address(ASymbolAddress: str, AValue: float)Group: com
Description:
set signal real-time value from FlexRay RBS using signal database addressParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in FlexRay database selector, by double clicking on the statusbar of selected symbol AValue No s32 Signal real-time physical value retrieved Returns: int
Example:
if com.flexray_rbs_set_signal_value_by_address('0/PowerTrain/Engine/EngineData/EngSpeed', 1234) == 0: app.log_text("flexray rbs successfully set signal value", lvlOK)
2.55 flexray_rbs_set_signal_value_by_element
Prototype:
int flexray_rbs_set_signal_value_by_element(AIdxChn: int, AClusterName: str, AECUName: str, AFrameName: str, ASignalName: str, AValue: float)Group: com
Description:
set signal real-time value from FlexRay RBS using element nameParameters:
Name Const Type Description AIdxChn No s16 FlexRay logical channel AClusterName No u8 Cluster name containing this signal AECUName No u8 ECU name containing this signal AFrameName No u8 Frame name containing this signal ASignalName No u8 signal name to get value AValue No s32 the physical value of this signal in real time Returns: int
Example:
if com.flexray_rbs_set_signal_value_by_element(CH1, 'PowerTrain', 'Engine', 'EngineData', 'EngSpeed', 2345) == 0: app.log_text("flexray rbs successfully set signal value", lvlOK)
2.56 flexray_rbs_start
Prototype:
int flexray_rbs_start()Group: com
Description:
start FlexRay RBS engineParameters: (없음)
Returns: int
Example:
com.flexray_rbs_start()
2.57 flexray_rbs_stop
Prototype:
int flexray_rbs_stop()Group: com
Description:
Stop FlexRay RBS engineParameters: (없음)
Returns: int
Example:
com.flexray_rbs_stop()
2.58 flexray_rbs_update_frame_by_header
Prototype:
int flexray_rbs_update_frame_by_header(AIdxChn: int, AFrameHash: int)Group: com
Description: (상세 정보 없음)
Parameters: (정보 없음)
Returns: int
Example: (예제 없음)
2.59 get_bus_statistics
Prototype:
Tuple get_bus_statistics(ABusType: int, AIdxChn: int, AIdxStat: int)Group: com
Description:
get bus statistics valueParameters:
Name Const Type Description ABusType No s16 application channel type AIdxChn No s16 channel index starting from 0 AIdxStat No s16 bus statistics value index, see descriptions below: Returns: Tuple
Example:
v = com.get_bus_statistics(APP_CAN, CH1, CAN_STAT_BUS_LOAD) app.log_text('com.get_bus_statistics(APP_CAN, CH1, CAN_STAT_BUS_LOAD) = ' + str(v), lvlOK)
2.60 get_can_signal_value
Prototype:
float get_can_signal_value(ACANSignal: CANSignal, AData: List)Group: com
Description:
get physical CAN signal value from message data, return value is doubleParameters:
Name Const Type Description ASignal No ps8 CAN signal definition AData No pfloat message data Returns: float
Example:
s = CANSignal(0, 1, 0, 8, 2, 6) d = [1, 2, 3, 4, 5, 6, 7, 8] data = com.get_can_signal_value(s, d) if data == 0: app.log_text("successfully get can signal value", lvlOK)
2.61 get_flexray_signal_value
Prototype:
float get_flexray_signal_value(AFlexRaySignal: FlexRaySignal, AData: List)Group: com
Description:
to get flexray signal phys. value from raw data bytes from frame, this function return value is doubleParameters:
Name Const Type Description ASignal No ps16 the pointer to flexray signal definition AData No pfloat start address of frame data bytes Returns: float
Example:
# signal get set s = FlexRaySignal(0, 1, 1, 0, 20, 8, 2, 6) d = [1, 2, 3, 4, 5, 6, 7, 8] d = com.set_flexray_signal_value(s, d, 88) data = com.get_flexray_signal_value(s, d) if data == 0: app.log_text("successfully get flexray signal value", lvlOK)
2.62 get_fps_can
Prototype:
Tuple get_fps_can(AIdxChn: int, AIdentifier: int)Group: com
Description:
get frames per second of specific identifier, note: this feature requires bus statistics to be enabledParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AIdentifier No s16 identifier of specific can message Returns: Tuple
Example:
fps = com.get_fps_can(CH1, 0x123) app.log_text('com.get_fps_can(CH1, 0x123) = ' + str(fps), lvlOK)
2.63 get_fps_canfd
Prototype:
Tuple get_fps_canfd(AIdxChn: int, AIdentifier: int)Group: com
Description:
get frames per second of specific identifier, note: this feature requires bus statistics to be enabledParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AIdentifier No s16 identifier of specific can fd message Returns: Tuple
Example:
fps = com.get_fps_canfd(CH1, 0x64) app.log_text('com.get_fps_canfd(CH1, 0x64) = ' + str(fps), lvlOK)
2.64 get_fps_lin
Prototype:
Tuple get_fps_lin(AIdxChn: int, AIdentifier: int)Group: com
Description:
get frames per second of specific identifier, note: this feature requires bus statistics to be enabledParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AIdentifier No s16 identifier of specific can fd message Returns: Tuple
Example:
fps = com.get_fps_lin(CH1, 0x12) app.log_text('com.get_fps_lin(CH1, 0x12) = ' + str(fps), lvlOK)
2.65 get_lin_signal_value
Prototype:
float get_lin_signal_value(ALINSignal: LINSignal, AData: List)Group: com
Description:
get physical CAN signal value from message data, return value is doubleParameters:
Name Const Type Description ASignal No pu8 CAN signal definition AData No pfloat message data Returns: float
Example:
s = LINSignal(0, 1, 0, 8, 2, 6) d = [1, 2, 3, 4, 5, 6, 7, 8] data = com.get_lin_signal_value(s, d) if data == 0: app.log_text("successfully get lin signal value", lvlOK)
2.66 inject_can_message
Prototype:
int inject_can_message(ACAN: RawCAN)Group: com
Description:
inject a CAN message as transmitted or received frame into system, so as to display this message with signals in trace, graphics, panels and also automate them in mini programParameters:
Name Const Type Description ACANFD No u32 the CAN message pointer, can be classical message or FD message depending on its internal properties Returns: int
Example:
can = RawCAN(0x123, 8, CH1, 0, [1,2,3,4,5,6,7,8]) com.inject_can_message(can)
2.67 inject_flexray_frame
Prototype:
int inject_flexray_frame(AFlexRay: RawFlexRay)Group: com
Description:
to inject flexray frame into system measurement environmentParameters:
Name Const Type Description AFlexRay No double pointer to a raw flexray frame Returns: int
Example:
flexray = RawFlexRay(0, 32, CH1, 1, 1, 0, 0, [1,2,3,4,5,6,7,8]) if 0 == com.inject_flexray_frame(flexray): app.log_text("injected", lvlOK)
2.68 inject_lin_message
Prototype:
int inject_lin_message(ALIN: RawLIN)Group: com
Description:
inject a LIN message as transmitted or received frame into system, so as to display this message with signals in trace, graphics, panels and also automate them in mini programParameters:
Name Const Type Description ALIN No float LIN frame pointer Returns: int
Example:
lin = RawLIN(0x12, 8, CH1, 0, [1,2,3,4,5,6,7,8]) com.inject_lin_message(lin)
2.69 ioip_connect_tcp_server
Prototype:
int ioip_connect_tcp_server(AInstance: MpInstance, AHandle: int, AIpAddress: str, APort: int)Group: com
Description:
use TCP client to connect external TCP serverParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function AIpAddress No u8 the IP address of the external server, such as 127.0.0.1 APort No s16 the port of the external server, such as 12345 Returns: int
Example:
r, h = com.ioip_create(Instance, 12345, 23456) if com.ioip_connect_tcp_server(Instance, h, '127.0.0.1', 12345) == 0: app.log_text("tcp server successfully connect", lvlOK)
2.70 ioip_connect_udp_server
Prototype:
int ioip_connect_udp_server(AInstance: MpInstance, AHandle: int, AIpAddress: str, APort: int)Group: com
Description:
set external UDP server address and port for internal UDP clientParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function AIpAddress No u8 the IP address of the external server, such as 127.0.0.1 APort No s16 the port of the external server, such as 12345 Returns: int
Example:
r, h = com.ioip_create(Instance, 12345, 23456) if com.ioip_connect_udp_server(Instance, h, '127.0.0.1', 12345) == 0: app.log_text("udp server successfully connect", lvlOK)
2.71 ioip_create
Prototype:
Tuple ioip_create(AInstance: MpInstance, APortTCP: int, APortUDP: int)Group: com
Description:
create an IP communication object, which has one TCP server, one TCP client, one UDP Server and one UDP client, you can use this object for ip arbitrary data transmission using tcp ip protocolParameters:
Name Const Type Description AInstance No pdouble This is an instance APortTCP No s16 TCP server port APortUDP No s16 UDP server port Returns: Tuple
Example:
r, h = com.ioip_create(Instance, 12345, 23456) com.ioip_delete(Instance, h) app.log_text("ioip successfully delete", lvlOK)
2.72 ioip_delete
Prototype:
int ioip_delete(AInstance: MpInstance, AHandle: int)Group: com
Description:
delete the previously created IP communication objectParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function Returns: int
Example:
r, h = com.ioip_create(Instance, 12345, 23456) com.ioip_delete(Instance, h) app.log_text("ioip successfully delete", lvlOK)
2.73 ioip_disconnect_tcp_server
Prototype:
int ioip_disconnect_tcp_server(AInstance: MpInstance, AHandle: int)Group: com
Description:
set the internal TCP client to disconnect the connection to external TCP serverParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function Returns: int
Example:
r, h = com.ioip_create(Instance, 12345, 23456) com.ioip_disconnect_tcp_server(Instance, h)
2.74 ioip_enable_tcp_server
Prototype:
int ioip_enable_tcp_server(AInstance: MpInstance, AHandle: int, AEnable: bool)Group: com
Description:
enable the TCP server in the IP communication objectParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function AEnable No u16 enable or disable the TCP server Returns: int
Example:
r, h = com.ioip_create(Instance, 12345, 23456) com.ioip_enable_tcp_server(Instance, h, True) app.log_text("enable udp server", lvlOK)
2.75 ioip_enable_udp_server
Prototype:
int ioip_enable_udp_server(AInstance: MpInstance, AHandle: int, AEnable: bool)Group: com
Description:
enable the UDP server in the IP communication objectParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function AEnable No u16 enable or disable the UDP server Returns: int
Example:
r, h = com.ioip_create(Instance, 12345, 23456) com.ioip_enable_udp_server(Instance, h, True) app.log_text("enable udp server", lvlOK)
2.76 ioip_receive_tcp_client_response
Prototype:
Tuple ioip_receive_tcp_client_response(AInstance: MpInstance, AHandle: int, ATimeOutMs: int)Group: com
Description:
receive tcp server response that is delivered to tcp clientParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function ATimeoutMs No s16 receive timeout in milliseconds Returns: Tuple
Example:
Instance = MpInstance('PyAPIs') r, h = com.ioip_create(Instance, 12345, 23456) r, a = com.ioip_receive_tcp_client_response(Instance, h, 1000) app.log_text('receive tcp client response = ' + ','.join(str(x) for x in a), lvlOK)
2.77 ioip_receive_udp_client_response
Prototype:
Tuple ioip_receive_udp_client_response(AInstance: MpInstance, AHandle: int, ATimeOutMs: int)Group: com
Description:
receive udp server response that is delivered to udp clientParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function ATimeoutMs No s16 receive timeout in milliseconds Returns: Tuple
Example:
Instance = MpInstance('PyAPIs') r, h = com.ioip_create(Instance, 12345, 23456) r, a = com.ioip_receive_udp_client_response(Instance, h, 1000) app.log_text('receive udp client response = ' + ','.join(str(x) for x in a), lvlOK)
2.78 ioip_send_buffer_tcp
Prototype:
int ioip_send_buffer_tcp(AInstance: MpInstance, AHandle: int, ABuffer: typing.List[int])Group: com
Description:
send a buffer to external TCP server by internal TCP client, the connection should first be established by calling ioip_connect_tcp_serverParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function ABuffer No ps32 the starting address of the data buffer Returns: int
Example:
Instance = MpInstance('PyAPIs') r, h = com.ioip_create(Instance, 12345, 23456) if com.ioip_send_buffer_tcp(Instance, h, [1,2,3]) == 0: app.log_text("successfully send buffer tcp", lvlOK)
2.79 ioip_send_buffer_udp
Prototype:
int ioip_send_buffer_udp(AInstance: MpInstance, AHandle: int, ABuffer: typing.List[int])Group: com
Description:
send a buffer to external UDP server by internal UDP clientParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function ABuffer No ps32 the starting address of the data buffer Returns: int
Example:
Instance = MpInstance('PyAPIs') r, h = com.ioip_create(Instance, 12345, 23456) if com.ioip_send_buffer_udp(Instance, h, [1,2,3]) == 0: app.log_text("successfully send buffer udp", lvlOK)
2.80 ioip_send_tcp_server_response
Prototype:
int ioip_send_tcp_server_response(AInstance: MpInstance, AHandle: int, ABuffer: typing.List[int])Group: com
Description:
send response data by tcp server in client data event, note: this function should be used in data event!Parameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function ABuffer No ps32 the content in the buffer will be read out and transmitted to client Returns: int
Example:
Instance = MpInstance('PyAPIs') r, h = com.ioip_create(Instance, 12345, 23456) com.ioip_send_tcp_server_response(Instance, h, [11,22,33,44,55]) app.log_text("send tcp server response", lvlOK)
2.81 ioip_send_udp_broadcast
Prototype:
int ioip_send_udp_broadcast(AInstance: MpInstance, AHandle: int, APort: int, ABuffer: typing.List[int])Group: com
Description:
send a UDP broadcast messageParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function APort No s16 the port to send broadcast on ABuffer No ps32 the content in the buffer will be read out and transmitted Returns: int
Example:
Instance = MpInstance('PyAPIs') r, h = com.ioip_create(Instance, 12345, 23456) com.ioip_send_udp_broadcast(Instance, h, 23456, [3,4,5])
2.82 ioip_send_udp_server_response
Prototype:
int ioip_send_udp_server_response(AInstance: MpInstance, AHandle: int, ABuffer: typing.List[int])Group: com
Description:
send response data by udp server in client data event, note: this function should be used in data event!Parameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function ABuffer No ps32 the content in the buffer will be read out and transmitted to client Returns: int
Example:
Instance = MpInstance('PyAPIs') r, h = com.ioip_create(Instance, 12345, 23456) com.ioip_send_udp_server_response(Instance, h, [22,33,44,55,66])
2.83 ioip_set_udp_server_buffer_size
Prototype:
int ioip_set_udp_server_buffer_size(AInstance: MpInstance, AHandle: int, ASize: int)Group: com
Description:
set maximum packet size for udp serverParameters:
Name Const Type Description AInstance No pdouble This is an instance AHandle No s16 the handle returned by ioip_create function ASize No s16 Buffer size in byte, default is 8K Returns: int
Example:
Instance = MpInstance('PyAPIs') r, h = com.ioip_create(Instance, 12345, 23456) com.ioip_set_udp_server_buffer_size(Instance, h, 8192)
2.84 j1939_extract_id
Prototype:
Tuple j1939_extract_id(AIdentifier: int)Group: com
Description:
extract J1939 protocol properties from identifierParameters:
Name Const Type Description AIdentifier No s16 CAN identifier Returns: Tuple
Example:
pgn = 0xEC00 src = 0x01 dst = 0xFF prio = 6 id = 0x18ECFF01 pgn, src, dst, prio = com.j1939_extract_id(id) app.log_text('com.j1939_extract_id(id): pgn=' + hex(pgn) + ', src=' + hex(src) + ', dst=' + hex(dst) + ', prio=' + str(prio), lvlOK)
2.85 j1939_get_destination
Prototype:
int j1939_get_destination(AIdentifier: int)Group: com
Description:
extract destination address from J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 CAN identifier Returns: int
Example:
id = 0x18ECFF01 com.j1939_get_destination(id) app.log_text("id = %x" % id, lvlOK)
2.86 j1939_get_dp
Prototype:
int j1939_get_dp(AIdentifier: int)Group: com
Description:
extract dp bit from J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 CAN identifier Returns: int
Example:
id = 0x18ECFF01 com.j1939_get_dp(id) app.log_text("id = %x" % id, lvlOK)
2.87 j1939_get_edp
Prototype:
int j1939_get_edp(AIdentifier: int)Group: com
Description:
extract edp bit from J1939 identifierParameters:
Name Const Type Description AIdentifier No u16 CAN identifier Returns: int
Example:
id = 0x18ECFF01 com.j1939_get_edp(id) app.log_text("id = %x" % id, lvlOK)
2.88 j1939_get_last_pdu
Prototype:
Tuple j1939_get_last_pdu(AIdxChn: int, AIdentifier: int, AIsTx: bool)Group: com
Description:
get last PDU data by J1939 identifierParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AIdentifier No s16 CAN identifier AIsTx No u16 true: transmit PDU, false: receive PDU Returns: Tuple
Example:
id = 0x18ECFF01 r, d, t = com.j1939_get_last_pdu(CH1, id, True) app.log_text('j1939 get last pdu = ' + ','.join(str(x) for x in d) + ' @' + str(t / 1000000.0), lvlOK)
2.89 j1939_get_last_pdu_as_string
Prototype:
Tuple j1939_get_last_pdu_as_string(AIdxChn: int, AIdentifier: int, AIsTx: bool)Group: com
Description:
get last PDU data by J1939 identifier in string formatParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 AIdentifier No s16 CAN identifier AIsTx No u16 true: Transmit PDU, false: receive PDU Returns: Tuple
Example:
id = 0x18ECFF01 r, s, t = com.j1939_get_last_pdu_as_string(CH1, id, True) app.log_text('j1939 get last pdu as string = ' + s + ' @' + str(t / 1000000.0), lvlOK)
2.90 j1939_get_pgn
Prototype:
int j1939_get_pgn(AIdentifier: int)Group: com
Description:
extract PGN from J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 CAN identifier Returns: int
Example:
id = 0x18ECFF01 com.j1939_get_pgn(id) app.log_text("id = %x" % id, lvlOK)
2.91 j1939_get_priority
Prototype:
int j1939_get_priority(AIdentifier: int)Group: com
Description:
extract priority from J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 CAN identifier Returns: int
Example:
id = 0x18ECFF01 com.j1939_get_priority(id) app.log_text("id = %x" % id, lvlOK)
2.92 j1939_get_r
Prototype:
int j1939_get_r(AIdentifier: int)Group: com
Description:
extract R bit from J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 CAN identifier Returns: int
Example:
id = 0x18ECFF01 com.j1939_get_r(id) app.log_text("id = %x" % id, lvlOK)
2.93 j1939_get_source
Prototype:
int j1939_get_source(AIdentifier: int)Group: com
Description:
extract source from J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 CAN identifier Returns: int
Example:
id = 0x18ECFF01 com.j1939_get_source(id) app.log_text("id = %x" % id, lvlOK)
2.94 j1939_make_id
Prototype:
int j1939_make_id(APGN: int, ASource: int, ADestination: int, APriority: int)Group: com
Description:
generate J1939 CAN identifier by specific protocol propertiesParameters:
Name Const Type Description APGN No s16 J1939 PGN ASource No s16 J1939 source address ADestination No s16 J1939 destination address APriority No s16 J1939 priority Returns: int
Example:
pgn = 0xEC00 src = 0x01 dst = 0xFF prio = 6 com.j1939_make_id(pgn, src, dst, prio)
2.95 j1939_set_destination
Prototype:
int j1939_set_destination(pAIdentifier: int, ADestination: int)Group: com
Description:
set destination in J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 CAN identifier ADestination No s16 J1939 destination address Returns: int
Example:
id = 0x18ECFF01 com.j1939_set_destination(id, 0xFF) app.log_text("id after destination set = %x" % id, lvlOK)
2.96 j1939_set_dp
Prototype:
int j1939_set_dp(pAIdentifier: int, ADP: int)Group: com
Description:
set DP bit in J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 J1939 CAN identifier ADP No s16 RFAgYml0 Returns: int
Example:
id = 0x18ECFF01 com.j1939_set_dp(id, 0) app.log_text("id after DP bit set = %x" % id, lvlOK)
2.97 j1939_set_edp
Prototype:
int j1939_set_edp(pAIdentifier: int, AEDP: int)Group: com
Description:
set EDP bit in J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 J1939 CAN identifier AEDP No s16 EDP bit Returns: int
Example:
id = 0x18ECFF01 com.j1939_set_edp(id, 0) app.log_text("id after EDP bit set = %x" % id, lvlOK)
2.98 j1939_set_pgn
Prototype:
int j1939_set_pgn(pAIdentifier: int, APGN: int)Group: com
Description:
set PGN in J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 CAN identifier APGN No s16 J1939 PGN Returns: int
Example:
id = 0x18ECFF01 com.j1939_set_pgn(id, 0xEC00) app.log_text("id after PGN set = %x" % id, lvlOK)
2.99 j1939_set_priority
Prototype:
int j1939_set_priority(pAIdentifier: int, APriority: int)Group: com
Description:
set priority in J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 J1939 CAN id APriority No s16 J1939 priority Returns: int
Example:
id = 0x18ECFF01 com.j1939_set_priority(id, 1) app.log_text("id after priority set = %x" % id, lvlOK)
2.100 j1939_set_r
Prototype:
int j1939_set_r(pAIdentifier: int, AR: int)Group: com
Description:
set R bit in J1939 identiierParameters:
Name Const Type Description AIdentifier No s16 J1939 CAN id AR No s16 J1939 R bit Returns: int
Example:
id = 0x18ECFF01 com.j1939_set_r(id, 0) app.log_text("id after R bit set = %x" % id, lvlOK)
2.101 j1939_set_source
Prototype:
int j1939_set_source(pAIdentifier: int, ASource: int)Group: com
Description:
set source in J1939 identifierParameters:
Name Const Type Description AIdentifier No s16 J1939 CAN id ASource No s16 J1939 source address Returns: int
Example:
id = 0x18ECFF01 com.j1939_set_source(id, 0x01) app.log_text("id after source set = %x" % id, lvlOK)
2.102 j1939_transmit_pdu_as_string_async
Prototype:
int j1939_transmit_pdu_as_string_async(AIdxChn: int, APGN: int, APriority: int, ASource: int, ADestination: int, APDUData: str)Group: com
Description:
Transmit J1939 PDU asynchronously, the data bytes are provided as string separated by commaParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 APGN No s16 J1939 PGN APriority No s16 J1939 priority ASource No s16 J1939 source address ADestination No s16 J1939 destination address APDUData No u8 PDU data in string separated by comma Returns: int
Example:
pgn = 0xEC00 src = 0x01 dst = 0xFF prio = 6 if 0 == com.j1939_transmit_pdu_as_string_async(CH1, pgn, prio, src, dst, '1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77'): app.log_text("transmit async success", lvlOK)
2.103 j1939_transmit_pdu_as_string_sync
Prototype:
int j1939_transmit_pdu_as_string_sync(AIdxChn: int, APGN: int, APriority: int, ASource: int, ADestination: int, APDUData: str, ATimeOutMs: int)Group: com
Description:
Transmit J1939 PDU synchronously, the data bytes are provided as string separated by commaParameters:
Name Const Type Description AIdxChn No u8 channel index starting from 0 APGN No u16 J1939 PGN APriority No u8 J1939 priority ASource No u8 J1939 source address ADestination No u8 J1939 destination address APDUData No u8 PDU data in string separated by comma ATimeoutMs No u16 Timeout in milliseconds Returns: int
Example:
pgn = 0xEC00 src = 0x01 dst = 0xFF prio = 6 if 0 == com.j1939_transmit_pdu_as_string_sync(CH1, pgn, prio, src, dst, '1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77', 500): app.log_text("transmit async success", lvlOK)
2.104 j1939_transmit_pdu_async
Prototype:
int j1939_transmit_pdu_async(AIdxChn: int, APGN: int, APriority: int, ASource: int, ADestination: int, APDUData: typing.List[int])Group: com
Description:
Transmit J1939 PDU asynchronouslyParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 APGN No s16 J1939 PGN APriority No s16 J1939 priority ASource No s16 J1939 source address ADestination No s16 J1939 destination address APDUData No ps32 J1939 PDU buffer address Returns: int
Example:
pgn = 0xEC00 src = 0x01 dst = 0xFF prio = 6 if 0 == com.j1939_transmit_pdu_async(CH1, pgn, prio, src, dst, [1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77,88,99]): app.log_text("transmit async success", lvlOK)
2.105 j1939_transmit_pdu_sync
Prototype:
int j1939_transmit_pdu_sync(AIdxChn: int, APGN: int, APriority: int, ASource: int, ADestination: int, APDUData: typing.List[int], ATimeOutMs: int)Group: com
Description:
Transmit J1939 PDU synchronouslyParameters:
Name Const Type Description AIdxChn No s16 channel index starting from 0 APGN No u16 J1939 PGN APriority No s16 J1939 priority ASource No s16 J1939 source address ADestination No s16 J1939 destination address APDUData No ps32 J1939 PDU buffer address ATimeoutMs No s16 Timeout in milliseconds Returns: int
Example:
pgn = 0xEC00 src = 0x01 dst = 0xFF prio = 6 if 0 == com.j1939_transmit_pdu_sync(CH1, pgn, prio, src, dst, [1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77,88,99], 500): app.log_text("transmit sync success", lvlOK)
2.106 lin_rbs_activate_all_networks
Prototype:
int lin_rbs_activate_all_networks(AEnable: bool, AIncludingChildren: bool)Group: com
Description:
set activate or deactivate all networksParameters:
Name Const Type Description AEnable No u16 whether all networks are activated AIncludingChildren No u16 whether all nodes and messages are also activated Returns: int
Example:
if com.can_rbs_activate_all_networks(True, True) == 0: app.log_text("can rbs succesfully activate all networks", lvlOK)
2.107 lin_rbs_activate_message_by_name
Prototype:
int lin_rbs_activate_message_by_name(AIdxChn: int, AEnable: bool, ANetworkName: str, ANodeName: str, AMsgName: str)Group: com
Description:
activate or deactivate a message or notParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AEnable No u16 whether activate the specified message ANetworkName No u8 network name containing this node with message ANodeName No u8 node name containing this message AMessageName No u8 message name to be activated or not Returns: int
Example:
if com.can_rbs_activate_message_by_name(CH2, False, 'CAN_FD_Powertrain', 'Engine', 'EngineData') == 0: app.log_text("can rbs succesfully activate message", lvlOK)
2.108 lin_rbs_activate_network_by_name
Prototype:
int lin_rbs_activate_network_by_name(AIdxChn: int, AEnable: bool, ANetworkName: str, AIncludingChildren: bool)Group: com
Description:
activate or deactivate a network or notParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AEnable No u16 whether activate the specified network ANetworkName No u8 network name to be activated or deactivated AIncludingChildren No u16 whether all nodes and messages are also activated Returns: int
Example:
if com.can_rbs_activate_network_by_name(CH2, False, 'CAN_FD_Powertrain', False) == 0: app.log_text("can rbs succesfully activate network", lvlOK)
2.109 lin_rbs_activate_node_by_name
Prototype:
int lin_rbs_activate_node_by_name(AIdxChn: int, AEnable: bool, ANetworkName: str, ANodeName: str, AIncludingChildren: bool)Group: com
Description:
activate or deactivate a node or notParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AEnable No u16 whether activate the specified node ANetworkName No u8 network name containing this node ANodeName No u8 node name to be activated or deactivated AIncludingChildren No u16 whether all messages are also activated Returns: int
Example:
if com.can_rbs_activate_node_by_name(CH2, False, 'CAN_FD_Powertrain', 'Engine', False) == 0: app.log_text("can rbs succesfully activate node", lvlOK)
2.110 lin_rbs_batch_set_end
Prototype:
int lin_rbs_batch_set_end()Group: com
Description:
stop signal batch set operation, after this call, all cached signals are updated, this ensures only one frame is triggered when multiple signals inside it are setParameters: (없음)
Returns: int
Example:
com.can_rbs_batch_set_start() # message will not be triggered before can_rbs_batch_set_end com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn1", 1.2) com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn2", 3.4) # ... com.can_rbs_batch_set_end() # message "frame1" will be triggered
2.111 lin_rbs_batch_set_signal
Prototype:
int lin_rbs_batch_set_signal(ASymbolAddress: str, AValue: float)Group: com
Description:
set signal in CAN RBS in batch modeParameters:
Name Const Type Description ASymbolAddress No u8 the database signal address AValue No s32 the value of signal to be set Returns: int
Example:
com.can_rbs_batch_set_start() # message will not be triggered before can_rbs_batch_set_end com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn1", 1.2) com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn2", 3.4) # ... com.can_rbs_batch_set_end() # message "frame1" will be triggered
2.112 lin_rbs_batch_set_start
Prototype:
int lin_rbs_batch_set_start()Group: com
Description:
start signal batch set operation, after this call, all signal settings are cached until can_rbs_batch_set_end is called, this ensures only one frame is triggered when multiple signals inside it are setParameters: (없음)
Returns: int
Example:
com.can_rbs_batch_set_start() # message will not be triggered before can_rbs_batch_set_end com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn1", 1.2) com.can_rbs_batch_set_signal("0/net1/node1/frame1/sgn2", 3.4) # ... com.can_rbs_batch_set_end() # message "frame1" will be triggered
2.113 lin_rbs_configure
Prototype:
int lin_rbs_configure(AAutoStart: bool, AAutoSendOnModification: bool, AActivateNodeSimulation: bool, AInitValueOptions: int)Group: com
Description:
configure CAN RBS engineParameters:
Name Const Type Description AAutoStart No u16 whether RBS is auto started when application is connected AAutoSendOnModification No u16 whether auto send modified message if its signal is modified, only valid for non-cyclic messages AActivateNodeSimulation No u16 whether activate node behaviors simulation AInitValueOptions No u8 TLIBRBSInitValueOptions type Returns: int
Example:
if com.can_rbs_configure(False, True, True, 0) == 0: app.log_text("can rbs succesfully configure", lvlOK)
2.114 lin_rbs_enable
Prototype:
int lin_rbs_enable(AEnable: bool)Group: com
Description:
temporary enable or disable CAN RBS engine, this function is used to post configure RBS engine before after it is startedParameters:
Name Const Type Description AEnable No u16 true: enable RBS functionality; false: disable RBS Tx Returns: int
Example:
# Disable message transmission after rbs_start com.can_rbs_enable(False) com.can_rbs_start() com.can_rbs_set_signal_value_by_address("xxxxx", 1.234) com.can_rbs_enable(True) # messages are transmitted after enabling RBS
2.115 lin_rbs_get_signal_value_by_address
Prototype:
Tuple lin_rbs_get_signal_value_by_address(ASymbolAddress: str)Group: com
Description:
get signal real-time value from CAN RBS using signal database addressParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in CAN database selector, by double clicking on the statusbar of selected symbol Returns: Tuple
Example:
r, v = com.can_rbs_get_signal_value_by_address('0/CAN_FD_Powertrain/Engine/EngineData/EngSpeed') if r and v == 1234: app.log_text("can rbs successfully get signal value", lvlOK)
2.116 lin_rbs_get_signal_value_by_element
Prototype:
Tuple lin_rbs_get_signal_value_by_element(AIdxChn: int, ANetworkName: str, ANodeName: str, AMsgName: str, ASignalName: str)Group: com
Description:
get signal real-time value from CAN RBS using element nameParameters:
Name Const Type Description AIdxChn No s16 CAN logical channel ANetworkName No u8 network name containing this signal ANodeName No u8 node name containing this signal AMsgName No u8 message name containing this signal ASignalName No u8 signal name to get value Returns: Tuple
Example:
r, v = com.can_rbs_get_signal_value_by_element(CH1, 'CAN_FD_Powertrain', 'Engine', 'EngineData', 'EngSpeed') if r and v == 2345: app.log_text("can rbs successfully get signal value", lvlOK)
2.117 lin_rbs_is_running
Prototype:
bool lin_rbs_is_running()Group: com
Description:
check if CAN RBS is runningParameters: (없음)
Returns: bool
Example:
com.can_rbs_is_running()
2.118 lin_rbs_set_message_delay_time_by_name
Prototype:
int lin_rbs_set_message_delay_time_by_name(AIdxChn: int, AIntervalMs: int, ANetworkName: str, ANodeName: str, AMsgName: str)Group: com
Description:
set message interval in msParameters:
Name Const Type Description AIdxChn No s16 channel number starting from 0 AIntervalMs No s16 message cycle in milli-seconds ANetworkName No u8 network name containing this node with message ANodeName No u8 node name containing this message AMessageName No u8 message name to be activated or not Returns: int
Example:
if com.can_rbs_set_message_cycle_by_name(CH1, 10, 'CAN_FD_Powertrain', 'Engine', 'EngineData') == 0: app.log_text("can rbs succesfully set message cycle", lvlOK)
2.119 lin_rbs_set_signal_value_by_address
Prototype:
int lin_rbs_set_signal_value_by_address(ASymbolAddress: str, AValue: float)Group: com
Description:
set signal real-time value from CAN RBS using signal database addressParameters:
Name Const Type Description ASymbolAddress No u8 Symbol address, can be copied in CAN database selector, by double clicking on the statusbar of selected symbol AValue No s32 Signal real-time physical value retrieved Returns: int
Example:
com.can_rbs_set_signal_value_by_address('0/CAN_FD_Powertrain/Engine/EngineData/EngSpeed', 1234)
2.120 lin_rbs_set_signal_value_by_element
Prototype:
int lin_rbs_set_signal_value_by_element(AIdxChn: int, ANetworkName: str, ANodeName: str, AMsgName: str, ASignalName: str, AValue: float)Group: com
Description:
set signal real-time value from CAN RBS using element nameParameters:
Name Const Type Description AIdxChn No s16 CAN logical channel ANetworkName No u8 network name containing this signal ANodeName No u8 node name containing this signal AMsgName No u8 message name containing this signal ASignalName No u8 signal name to get value AValue No s32 the physical value of this signal in real time Returns: int
Example:
com.can_rbs_set_signal_value_by_element(CH1, 'CAN_FD_Powertrain', 'Engine', 'EngineData', 'EngSpeed', 2345)
2.121 lin_rbs_start
Prototype:
int lin_rbs_start()Group: com
Description:
start CAN RBS engineParameters: (없음)
Returns: int
Example:
com.can_rbs_start()
2.122 lin_rbs_stop
Prototype:
int lin_rbs_stop()Group: com
Description:
Stop CAN RBS engineParameters: (없음)
Returns: int
Example:
com.can_rbs_stop()
2.123 set_can_signal_value
Prototype:
void set_can_signal_value(ACANSignal: CANSignal, AData: List, AValue: float)Group: com
Description:
set message data bytes with physical valueParameters:
Name Const Type Description ASignal No ps8 CAN signal definition AData No pfloat message data byte address AValue No s32 the physical value to be set Returns: void
Example:
s = CANSignal(0, 1, 0, 8, 2, 6) d = [1, 2, 3, 4, 5, 6, 7, 8] data = com.get_can_signal_value(s, d) if data == 0: app.log_text("successfully get can signal value", lvlOK)
2.124 set_flexray_signal_value
Prototype:
void set_flexray_signal_value(AFlexRaySignal: FlexRaySignal, AData: List, AValue: float)Group: com
Description:
set flexray signal phys. value into raw data bytes, this function does not have return valueParameters:
Name Const Type Description AFlexRaySignal No ps16 the flexray database signal definition pointer AData No pfloat address of raw data bytes AValue No s32 the phys. value Returns: void
Example:
# signal get set s = FlexRaySignal(0, 1, 1, 0, 20, 8, 2, 6) d = [1, 2, 3, 4, 5, 6, 7, 8] d = com.set_flexray_signal_value(s, d, 88) data = com.get_flexray_signal_value(s, d) if data == 0: app.log_text("successfully get flexray signal value", lvlOK)
2.125 set_lin_signal_value
Prototype:
void set_lin_signal_value(ALINSignal: LINSignal, AData: List, AValue: float)Group: com
Description:
set message data bytes with physical valueParameters:
Name Const Type Description ASignal No pu8 CAN signal definition AData No pfloat message data byte address AValue No s32 the physical value to be set Returns: void
Example:
s = LINSignal(0, 1, 0, 8, 2, 6) d = [1, 2, 3, 4, 5, 6, 7, 8] data = com.get_lin_signal_value(s, d) if data == 0: app.log_text("successfully get lin signal value", lvlOK)
2.126 sgnsrv_get_can_signal_phy_value_in_msg
Prototype:
Tuple sgnsrv_get_can_signal_phy_value_in_msg(AIdxChn: int, AClientId: int, ACAN: RawCAN)Group: com
Description:
get can physical value in specific message, return 0 if signal exists in this messageParameters:
Name Const Type Description AIdxChn No s16 application channel index starting from 0 AClientId No s16 client id retrieved by register functions ACAN No u32 message pointer, if specified as NULL, then latest value is retrieved Returns: Tuple
Example:
r, id = com.sgnsrv_register_can_signal_by_msg_identifier(CH1, 0x64, 'EngSpeed') r, v, t = com.sgnsrv_get_can_signal_phy_value_latest(CH1, id) can = RawCAN(0x64, 15, CH1, 123456, [11,22,33,44,55,66,77,88,99,00,11], 6) can.is_edl = True com.sgnsrv_get_can_signal_phy_value_in_msg(CH1, id, can)
2.127 sgnsrv_get_can_signal_phy_value_latest
Prototype:
Tuple sgnsrv_get_can_signal_phy_value_latest(AIdxChn: int, AClientId: int)Group: com
Description:
get latest can physical value in signal serverParameters:
Name Const Type Description AIdxChn No s16 application channel index starting from 0 AClientId No s16 client id retrieved by register functions Returns: Tuple
Example:
r, id = com.sgnsrv_register_can_signal_by_msg_identifier(CH1, 0x64, 'EngSpeed') com.sgnsrv_get_can_signal_phy_value_latest(CH1, id)
2.128 sgnsrv_get_flexray_signal_phy_value_in_frame
Prototype:
Tuple sgnsrv_get_flexray_signal_phy_value_in_frame(AIdxChn: int, AClientId: int, AFlexRay: RawFlexRay)Group: com
Description:
get flexray signal physical value in frame with the help of signal serverParameters:
Name Const Type Description AIdxChn No s16 the logical channel AClientId No s16 client id returned from signal server registration AFlexRay No double the pointer to flexray raw frame Returns: Tuple
Example:
r, id = com.sgnsrv_register_can_signal_by_msg_identifier(CH1, 0x64, 'EngSpeed') flexray = RawFlexRay(25, 8, CH1, 1, 1, 0, 123456, [11,22,33,44,55,66,77,88,99,00,11], 0, 2) r, v, t = com.sgnsrv_get_flexray_signal_phy_value_in_frame(CH1, id, flexray) app.log_text('sgnsrv get flexray signal phy value in frame = ' + str(v) + ' @' + str(t / 1000000.0), lvlOK)
2.129 sgnsrv_get_flexray_signal_phy_value_latest
Prototype:
Tuple sgnsrv_get_flexray_signal_phy_value_latest(AIdxChn: int, AClientId: int)Group: com
Description:
get flexray signal latest physical value in frame with the help of signal serverParameters:
Name Const Type Description AIdxChn No s16 the logical channel AClientId No s16 client id returned from signal server registration Returns: Tuple
Example:
v, t = com.sgnsrv_get_flexray_signal_phy_value_latest(CH1, id) app.log_text('sgnsrv get flexray signal phy value latest = ' + str(v) + ' @' + str(t / 1000000.0), lvlOK)
2.130 sgnsrv_get_lin_signal_phy_value_in_msg
Prototype:
Tuple sgnsrv_get_lin_signal_phy_value_in_msg(AIdxChn: int, AClientId: int, ALIN: RawLIN)Group: com
Description:
get lin physical value in specific message, return 0 if signal exists in this messageParameters:
Name Const Type Description AIdxChn No s16 application channel index starting from 0 AClientId No s16 client id retrieved by register functions ALIN No float message pointer, if specified as NULL, then latest value is retrieved Returns: Tuple
Example:
r, id = com.sgnsrv_register_can_signal_by_msg_identifier(CH1, 0x64, 'EngSpeed') lin = RawLIN(21, 8, CH1, 123456, [11,22,33,44,55,66,77,88], 0) r, v, t = com.sgnsrv_get_lin_signal_phy_value_in_msg(CH1, id, lin) app.log_text('com.sgnsrv_get_lin_signal_phy_value_in_msg(CH1, id) = ' + str(v) + ' @' + str(t / 1000000.0), lvlOK)
2.131 sgnsrv_get_lin_signal_phy_value_latest
Prototype:
Tuple sgnsrv_get_lin_signal_phy_value_latest(AIdxChn: int, AClientId: int)Group: com
Description:
get latest lin physical value in signal serverParameters:
Name Const Type Description AIdxChn No s16 application channel index starting from 0 AClientId No s16 client id retrieved by register functions Returns: Tuple
Example:
r, id = com.sgnsrv_register_can_signal_by_msg_identifier(CH1, 0x64, 'EngSpeed') r, v, t = com.sgnsrv_get_lin_signal_phy_value_latest(CH1, id) app.log_text('sgnsrv get lin signal phy value latest = ' + str(v) + ' @' + str(t / 1000000.0), lvlOK)
2.132 sgnsrv_register_can_signal_by_msg_identifier
Prototype:
Tuple sgnsrv_register_can_signal_by_msg_identifier(AIdxChn: int, AMsgId: int, ASgnName: str)Group: com
Description:
register a CAN signal in signal server by specifying message identifier, after that you can always get signal physical value by the returned client idParameters:
Name Const Type Description AIdxChn No s16 application channel index starting from 0 AMsgId No s16 message identifier ASgnName No u8 the signal name Returns: Tuple
Example:
id = com.sgnsrv_register_can_signal_by_msg_identifier(CH1, 0x64, 'EngSpeed') app.log_text("sgnsrv register can signal by msg identifier = " + str(id), lvlOK)
2.133 sgnsrv_register_can_signal_by_msg_name
Prototype:
Tuple sgnsrv_register_can_signal_by_msg_name(AIdxChn: int, ANetworkName: str, AMsgName: str, ASgnName: str)Group: com
Description:
register a CAN signal in signal server by specifying message name, after that you can always get signal physical value by the returned client idParameters:
Name Const Type Description AIdxChn No s16 application channel index starting from 0 ANetworkName No u8 the network name AMsgName No u8 the message name ASgnName No u8 the signal name Returns: Tuple
Example:
id = com.sgnsrv_register_can_signal_by_msg_name(CH1, 'CAN_FD_Powertrain', 'EngineData', 'EngTemp') app.log_text("sgnsrv register can signal by msg name = " + str(id), lvlOK)
2.134 sgnsrv_register_flexray_signal_by_frame
Prototype:
Tuple sgnsrv_register_flexray_signal_by_frame(AIdxChn: int, AChnMask: int, ACycleNumber: int, ASlotId: int, ASgnName: str)Group: com
Description:
register flexray signal client in signal server, to later get real-time value from serverParameters:
Name Const Type Description AIdxChn No s16 logical channel starting from 0 AChnMask No s16 channel mask, 1-A, 2-B, 3-AB ACycleNumber No s16 base cycle number ASlotId No s16 slot id ASgnName No u8 signal name Returns: Tuple
Example:
id = com.sgnsrv_register_flexray_signal_by_frame(CH1, 1, 0, 25, 'EngSpeed') app.log_text("registration success", lvlOK)
2.135 sgnsrv_register_flexray_signal_by_frame_name
Prototype:
Tuple sgnsrv_register_flexray_signal_by_frame_name(AIdxChn: int, ANetworkName: str, AFrameName: str, ASgnName: str)Group: com
Description:
register flexray signal client in signal server, to later get real-time value from serverParameters:
Name Const Type Description AIdxChn No s16 the logical channel starting from 0 AClusterName No u8 flexray cluster name AFrameName No u8 flexray frame name ASgnName No u8 flexray signal name Returns: Tuple
Example:
id = com.sgnsrv_register_flexray_signal_by_frame_name(CH1, 'PowerTrain', 'EngineData', 'EngPower') app.log_text("registration success", lvlOK)
2.136 sgnsrv_register_lin_signal_by_msg_identifier
Prototype:
Tuple sgnsrv_register_lin_signal_by_msg_identifier(AIdxChn: int, AMsgId: int, ASgnName: str)Group: com
Description:
register a LIN signal in signal server by specifying message identifier, after that you can always get signal physical value by the returned client idParameters:
Name Const Type Description AIdxChn No s16 application channel index starting from 0 AMsgId No s16 the LIN frame identifier ASgnName No u8 the signal name Returns: Tuple
Example:
id = com.sgnsrv_register_lin_signal_by_msg_identifier(CH1, 21, 'SteeringLampControl') app.log_text("sgnsrv register lin signal by msg identifier = " + str(id), lvlOK)
2.137 sgnsrv_register_lin_signal_by_msg_name
Prototype:
Tuple sgnsrv_register_lin_signal_by_msg_name(AIdxChn: int, ANetworkName: str, AMsgName: str, ASgnName: str)Group: com
Description:
register a LIN signal in signal server by specifying message name, after that you can always get signal physical value by the returned client idParameters:
Name Const Type Description AIdxChn No s16 application channel index starting from 0 ANetworkName No u8 the network name AMsgName No u8 the message name ASgnName No u8 the signal name Returns: Tuple
Example:
id = com.sgnsrv_register_lin_signal_by_msg_name(CH1, 'LINDemo', 'SlavesControls', 'HeadLampControl') app.log_text("sgnsrv register lin signal by msg name = " + str(id), lvlOK)
2.138 transmit_can_async
Prototype:
int transmit_can_async(ACAN: RawCAN)Group: com
Description:
transmit a CAN frame asynchronously regardless of checking its transmission resultParameters:
Name Const Type Description ACAN No u32 CAN message struct pointer Returns: int
Example:
AId=0X123 can = RawCAN(AId, 8, CH1, 0, [1,2,3,4,5,6,7,8]) if com.transmit_can_async(can) == 0: app.log_text("CAN message" + str(AId) + "has been pushed into transmit queue", lvlOK)
2.139 transmit_can_async_wo_pretx
Prototype:
int transmit_can_async_wo_pretx(ACAN: RawCAN)Group: com
Description:
transmit a CAN frame asynchronously regardless of checking its transmission resultParameters:
Name Const Type Description ACAN No u32 CAN message struct pointer Returns: int
Example:
can = RawCAN(0x123, 8, CH1, 0, [1,2,3,4,5,6,7,8]) if com.transmit_can_async_wo_pretx(can) == 0: app.log_text("successfully transmit can async wo pretx", lvlOK)
2.140 transmit_can_sync
Prototype:
int transmit_can_sync(ACAN: RawCAN, ATimeOutMs: int)Group: com
Description:
transmit a CAN frame synchronously, the current execution is blocked until the frame is sent or timed outParameters:
Name Const Type Description ACAN No u32 Pointer to CAN data struct ATimeoutMS No s16 Timeout time in milliseconds Returns: int
Example:
can = RawCAN(0x123, 8, CH1, 0, [1,2,3,4,5,6,7,8]) com.transmit_can_sync(can, 1000)
2.141 transmit_flexray_async
Prototype:
int transmit_flexray_async(AFlexRay: RawFlexRay)Group: com
Description:
transmit a flexray frame asynchronouslyParameters:
Name Const Type Description AFlexRay No double raw flexray frame pointer Returns: int
Example:
ASlotId=0 flexray = RawFlexRay(ASlotId, 32, CH1, 1, 1, 0, 0, [1,2,3,4,5,6,7,8]) if com.transmit_flexray_async(flexray) == 0: app.log_text("FlexRay message" + str(ASlotId) + "has been pushed into transmit queue", lvlOK)
2.142 transmit_flexray_async_wo_pretx
Prototype:
int transmit_flexray_async_wo_pretx(AFlexRay: RawFlexRay)Group: com
Description:
transmit a flexray frame asynchronouslyParameters:
Name Const Type Description AFlexRay No double raw flexray frame pointer Returns: int
Example:
flexray = RawFlexRay(0, 32, CH1, 1, 1, 0, 0, [1,2,3,4,5,6,7,8]) if com.transmit_flexray_async_wo_pretx(flexray) == 0: app.log_text("successfully transmit flexray async wo pretx", lvlOK)
2.143 transmit_flexray_sync
Prototype:
int transmit_flexray_sync(AFlexRay: RawFlexRay, ATimeOutMs: int)Group: com
Description:
transmit a flexray frame synchronouslyParameters:
Name Const Type Description AFlexRay No double raw flexray frame pointer ATimeoutMs No s16 timeout value in milliseconds Returns: int
Example:
flexray = RawFlexRay(0, 32, CH1, 1, 1, 0, 0, [1,2,3,4,5,6,7,8]) if 0 == com.transmit_flexray_sync(flexray, 1000): app.log_text("flexray frame is transmitted within 1000 ms", lvlOK)
2.144 transmit_lin_async
Prototype:
int transmit_lin_async(ALIN: RawLIN)Group: com
Description:
transmit a LIN frame asynchronously regardless of checking its transmission resultParameters:
Name Const Type Description ALIN No float Pointer to LIN data structure Returns: int
Example:
AId=0x12 lin = RawLIN(AId, 8, CH1, 0, [1,2,3,4,5,6,7,8]) if com.transmit_lin_async(lin) == 0: app.log_text("LIN message" + str(AId) + "has been pushed into transmit queue", lvlOK)
2.145 transmit_lin_async_wo_pretx
Prototype:
int transmit_lin_async_wo_pretx(ALIN: RawLIN)Group: com
Description:
transmit a LIN frame asynchronously regardless of checking its transmission resultParameters:
Name Const Type Description ALIN No float Pointer to LIN data structure Returns: int
Example:
lin = RawLIN(0x12, 8, CH1, 0, [1,2,3,4,5,6,7,8]) if com.transmit_lin_async_wo_pretx(lin) == 0: app.log_text("successfully transmit lin async wo pretx", lvlOK)
2.146 transmit_lin_sync
Prototype:
int transmit_lin_sync(ALIN: RawLIN, ATimeOutMs: int)Group: com
Description:
transmit a LIN frame synchronously, the current execution is blocked until the frame is sent or timed outParameters:
Name Const Type Description ALIN No float Pointer to LIN data structure ATimeoutMS No s16 Timeout time in milliseconds Returns: int
Example:
lin = RawLIN(0x12, 8, CH1, 0, [1,2,3,4,5,6,7,8]) com.transmit_lin_sync(lin, 1000)
2.147 tslog_add_online_replay_config
Prototype:
Tuple tslog_add_online_replay_config(AFileName: str)Group: com
Description:
To create an online replay engine from log file.Parameters:
Name Const Type Description AFileName No u8 Blf File Name, can be absolute path or relative path, when using relative path, the path is relative to “TSMaster.exe” in your current installation directory Returns: Tuple
Example:
idx = com.tslog_add_online_replay_config(r'.\Data\Demo\Logs\CANSystem_CAN2.blf') app.log_text("com.tslog_add_online_replay_config(r'.\Data\Demo\Logs') = " + str(idx), lvlOK)
2.148 tslog_asc_to_blf
Prototype:
int tslog_asc_to_blf(AASCFileName: str, ABLFFileName: str)Group: com
Description:
convert asc file to blf fileParameters:
Name Const Type Description ABLFFileName No u8 name to blf file AASCFileName No u8 name to asc file Returns: int
Example:
if com.tslog_asc_to_blf('blf_write.asc', 'blf_convert.blf') == 0: app.log_text("asc to blf", lvlOK)
2.149 tslog_blf_read_end
Prototype:
int tslog_blf_read_end(AHandle: int)Group: com
Description:
close the opened blf fileParameters:
Name Const Type Description AHandle No s16 handle of blf file Returns: int
Example:
r, h, objCnt = com.tslog_blf_read_start('blf_write.blf') com.tslog_blf_read_end(h)
2.150 tslog_blf_read_object
Prototype:
Tuple tslog_blf_read_object(AHandle: int)Group: com
Description:
read one supported object from blf fileParameters:
Name Const Type Description AHandle No s16 blf file handle Returns: Tuple
Example:
r, h, objCnt = com.tslog_blf_read_start('blf_write.blf') fme = com.tslog_blf_read_object(h) app.log_text("read object is: " + str(fme), lvlOK)
2.151 tslog_blf_read_object_w_comment
Prototype:
Tuple tslog_blf_read_object_w_comment(AHandle: int)Group: com
Description:
read one supported object from blf fileParameters:
Name Const Type Description AHandle No s16 blf file handle Returns: Tuple
Example:
r, h, objCnt = com.tslog_blf_read_start('blf_write.blf') fme = com.tslog_blf_read_object_w_comment(h)
2.152 tslog_blf_read_start
Prototype:
Tuple tslog_blf_read_start(AFileName: str)Group: com
Description:
Opens a blf file and start to read its contentParameters:
Name Const Type Description AFileName No u8 the path name of blf file, can be path relative to TSMaster.exe Returns: Tuple
Example:
r, h, objCnt = com.tslog_blf_read_start('blf_write.blf') app.log_text("com.tslog_blf_read_start('blf_write.blf') = " + str(h) + ', Object count = ' + str(objCnt), lvlOK)
2.153 tslog_blf_read_status
Prototype:
Tuple tslog_blf_read_status(AHandle: int)Group: com
Description:
to read status information of the opened blf fileParameters:
Name Const Type Description AHandle No s16 blf file handle Returns: Tuple
Example:
r, h, objCnt = com.tslog_blf_read_start('blf_write.blf') cnt = com.tslog_blf_read_status(h) app.log_text('com.tslog_blf_read_status(h) = ' + str(cnt), lvlOK)
2.154 tslog_blf_seek_object_time
Prototype:
Tuple tslog_blf_seek_object_time(AHandle: int, AProg100: float)Group: com
Description:
to get timestamp near specified file object ratioParameters:
Name Const Type Description AHandle No s16 blf file handle AProgress100 No s32 percentage of the objects in the blf file Returns: Tuple
Example:
r, h, objCnt = com.tslog_blf_read_start('blf_write.blf') r, t, cnt = com.tslog_blf_seek_object_time(h, 75.0) app.log_text('com.tslog_blf_seek_object_time(h, 75.0) = ' + str(t / 1000000.0) + 's, Count = ' + str(cnt), lvlOK)
2.155 tslog_blf_to_asc
Prototype:
int tslog_blf_to_asc(ABLFFileName: str, AASCFileName: str)Group: com
Description:
convert blf file to asc fileParameters:
Name Const Type Description ABLFFileName No u8 name to blf file AASCFileName No u8 name to asc file Returns: int
Example:
if com.tslog_blf_to_asc('blf_write.blf', 'blf_write.asc') == 0: app.log_text("blf to asc", lvlOK)
2.156 tslog_blf_write_can
Prototype:
int tslog_blf_write_can(AHandle: int, ACAN: RawCAN)Group: com
Description:
write CAN message object in blf fileParameters:
Name Const Type Description AHandle No s16 blf file handle ACAN No u32 CAN message object pointer Returns: int
Example:
r, h = com.tslog_blf_write_start('blf_write.blf') can = RawCAN(0x123, 8, CH1, 12345, [1,2,3,4,5,6,7,8], 6) com.tslog_blf_write_can(h, can)
2.157 tslog_blf_write_end
Prototype:
int tslog_blf_write_end(AHandle: int)Group: com
Description:
Save and close the currently opened blf fileParameters:
Name Const Type Description AHandle No s16 blf file handle Returns: int
Example:
r, h = com.tslog_blf_write_start('blf_write.blf') com.tslog_blf_write_end(h)
2.158 tslog_blf_write_flexray
Prototype:
int tslog_blf_write_flexray(AHandle: int, AFlexRay: RawFlexRay)Group: com
Description:
write flexray frame into blf log fileParameters:
Name Const Type Description AHandle No s16 blf file handle AFlexRay No double flexray frame object pointer Returns: int
Example:
flexray = RawFlexRay(1, 8, CH1, 1, 1, 2, 234567, [1,2,3,4,5,6,7,8], 0, 2) r, h = com.tslog_blf_write_start('blf_write.blf') if com.tslog_blf_write_flexray(h, flexray) == 0: app.log_text("tslog blf write flexray", lvlOK)
2.159 tslog_blf_write_lin
Prototype:
int tslog_blf_write_lin(AHandle: int, ALIN: RawLIN)Group: com
Description:
write LIN message object in blf fileParameters:
Name Const Type Description AHandle No s16 blf file handle ALIN No float LIN message object pointer Returns: int
Example:
r, h = com.tslog_blf_write_start('blf_write.blf') lin = RawLIN(0x12, 8, CH1, 123567, [1,2,3,4,5,6,7,8], 0) com.tslog_blf_write_lin(h, lin)
2.160 tslog_blf_write_realtime_comment
Prototype:
int tslog_blf_write_realtime_comment(AHandle: int, ATimeUs: int, AComment: str)Group: com
Description:
write real time comment into log fileParameters:
Name Const Type Description AHandle No s16 handle of blf file ATimeUs No s16 timestamp in microseconds AComment No u8 comment content Returns: int
Example:
r, h = com.tslog_blf_write_start('blf_write.blf') com.tslog_blf_write_realtime_comment(h, 0, 'this is a real-time comment')
2.161 tslog_blf_write_set_max_count
Prototype:
int tslog_blf_write_set_max_count(AHandle: int, ACount: int)Group: com
Description:
set max count before switching to a new file, if write count exceeds this limit, a new blf file is createdParameters:
Name Const Type Description AHandle No s16 the mat file object for reading ACount No s16 maximum count that should be within range [1000, 4294967295] Returns: int
Example:
r, h = com.tslog_blf_write_start('blf_write.blf') com.tslog_blf_write_set_max_count(h, 1000000)
2.162 tslog_blf_write_start
Prototype:
Tuple tslog_blf_write_start(AFileName: str)Group: com
Description:
create a blf file for writing, note: you must call tslog_blf_write_end to close the log file before the current mini program terminatesParameters:
Name Const Type Description AFileName No u8 the path name of blf file, can be path relative to TSMaster.exe Returns: Tuple
Example:
r, h = com.tslog_blf_write_start('blf_write.blf') app.log_text("com.tslog_blf_write_start('blf_write.blf') = " + str(h), lvlOK)
2.163 tslog_blf_write_start_w_timestamp
Prototype:
Tuple tslog_blf_write_start_w_timestamp(AFileName: str, AYear: int, AMonth: int, ADay: int, AHour: int, AMinute: int, ASecond: int, AMilliseconds: int)Group: com
Description:
create a blf file for writing, note: you must call tslog_blf_write_end to close the log file before the current mini program terminatesParameters:
Name Const Type Description AFileName No u8 the path name of blf file, can be path relative to TSMaster.exe AYear No s16 eWVhcg__ AMonth No s16 bW9udGg_ ADay No s16 ZGF5 AHour No s16 aG91cg__ AMinute No s16 bWludXRl ASecond No s16 c2Vjb25k AMilliseconds No s16 milliseconds Returns: Tuple
Example:
r, h = com.tslog_blf_write_start_w_timestamp('blf_write.blf', 2023, 5, 9, 9, 29, 36, 567) app.log_text("com.tslog_blf_write_start('blf_write.blf') = " + str(h), lvlOK)
2.164 tslog_del_online_replay_config
Prototype:
int tslog_del_online_replay_config(AIndex: int)Group: com
Description:
Delete an online replay engine by its engine indexParameters:
Name Const Type Description AIndex No s16 Replay engine index Returns: int
Example:
r, idx = com.tslog_add_online_replay_config(r'.\Data\Demo\Logs\CANSystem_CAN2.blf') com.tslog_del_online_replay_config(idx)
2.165 tslog_del_online_replay_configs
Prototype:
int tslog_del_online_replay_configs()Group: com
Description:
Delete all online replay enginesParameters: (없음)
Returns: int
Example:
if com.tslog_del_online_replay_configs() == 0: app.log_text("del online replay configs", lvlOK)
2.166 tslog_get_online_replay_config
Prototype:
Tuple tslog_get_online_replay_config(AIndex: int)Group: com
Description:
Get online replay engine properties by engine indexParameters:
Name Const Type Description AIndex No s16 Replay engine index Returns: Tuple
Example:
r, idx = com.tslog_add_online_replay_config(r'.\Data\Demo\Logs\CANSystem_CAN2.blf') r, sName, sFile, autoStart, isRepeat, timingMode, startDelayMs, sendTx, sendRx, maps = com.tslog_get_online_replay_config(idx) app.log_text('com.tslog_get_online_replay_config(idx): Name=' + sName + ', File=' + sFile + ', Auto Start=' + str(autoStart) + ', Timing Mode=' + str(timingMode) + ', Start Delay(ms)=' + str(startDelayMs) + ', Send Tx=' + str(sendTx) + ', Send Rx=' + str(sendRx) + ', Mappings=' + maps, lvlOK)
2.167 tslog_get_online_replay_count
Prototype:
Tuple tslog_get_online_replay_count()Group: com
Description:
Get online replay engine countParameters: (없음)
Returns: Tuple
Example:
if tslog_get_online_replay_count() == 0: app.log_text("get online replay count", lvlOK)
2.168 tslog_get_online_replay_status
Prototype:
Tuple tslog_get_online_replay_status(AIndex: int)Group: com
Description:
Get the replay status of specific online replay engine by its engine indexParameters:
Name Const Type Description AIndex No s16 Replay engine index Returns: Tuple
Example:
r, idx = com.tslog_add_online_replay_config(r'.\Data\Demo\Logs\CANSystem_CAN2.blf') r, stat, percent100 = com.tslog_get_online_replay_status(idx) app.log_text('com.tslog_get_online_replay_status(idx): Status=' + str(stat) + ', Percent(%)=' + str(percent100), lvlOK)
2.169 tslog_pause_online_replay
Prototype:
int tslog_pause_online_replay(AIndex: int)Group: com
Description:
Pause an online replay engine by its engine indexParameters:
Name Const Type Description AIndex No s16 Replay engine index Returns: int
Example:
r, idx = com.tslog_add_online_replay_config(r'.\Data\Demo\Logs\CANSystem_CAN2.blf') com.tslog_pause_online_replay(idx)
2.170 tslog_pause_online_replays
Prototype:
int tslog_pause_online_replays()Group: com
Description:
Pause all online replay enginesParameters: (없음)
Returns: int
Example:
if com.tslog_pause_online_replays() == 0: app.log_text("pause online replays", lvlOK)
2.171 tslog_set_online_replay_config
Prototype:
int tslog_set_online_replay_config(AIndex: int, AName: str, AFileName: str, AAutoStart: bool, AIsRepetitiveMode: bool, AStartTimingMode: int, AStartDelayTimeMs: int, ASendTx: bool, ASendRx: bool, AMappings: str)Group: com
Description:
Set the properties of online replay engine by engine indexParameters:
Name Const Type Description AIndex No s16 Replay engine index AName No u8 Replay engine name AFileName No u8 File name of the blf to be replayed AAutoStart No u16 Whether the log file is automatically replayed after application is connected AIsRepetitiveMode No u16 True: the log file will be replayed continuously, False: the log file will be replayed only once AStartTimingMode No s16 ortImmediately(0): The first frame in the log file will be directly sent when replay is started; ortAsLog(1): The first frame is sent according to log file; ortDelayed(2): The first frame will be sent after a certain delay specified in the parameter AStartDelayTimeMs No s16 The first frame will be sent after the specified delay time in milliseconds ASendTx No u16 Frames marked as “Tx” in the log file will be replayed ASendRx No u16 Frames marked as “Rx” in the log file will be replayed AMappings No u8 Mappings of each channel is specified in a string separated by “,”, and channel 0 means ignore Returns: int
Example:
r, idx = com.tslog_add_online_replay_config(r'.\Data\Demo\Logs\CANSystem_CAN2.blf') com.tslog_set_online_replay_config(idx, 'Replay1', r'.\Data\Demo\Logs\CANSystem_CAN1.blf', False, False, TOnlineReplayTimingMode_ortImmediately, 0, True, True, '1|2,-1')
2.172 tslog_start_online_replay
Prototype:
int tslog_start_online_replay(AIndex: int)Group: com
Description:
Start online replay by engine index. Note: The application should be connected before engine startParameters:
Name Const Type Description AIndex No s16 Replay engine index Returns: int
Example:
r, idx = com.tslog_add_online_replay_config(r'.\Data\Demo\Logs\CANSystem_CAN2.blf') com.tslog_start_online_replay(idx)
2.173 tslog_start_online_replays
Prototype:
int tslog_start_online_replays()Group: com
Description:
Start all online replay enginesParameters: (없음)
Returns: int
Example:
if com.tslog_start_online_replays() == 0: app.log_text("start online replays", lvlOK)
2.174 tslog_stop_online_replay
Prototype:
int tslog_stop_online_replay(AIndex: int)Group: com
Description:
Stop an online replay engine by its engine indexParameters:
Name Const Type Description AIndex No s16 Replay engine index Returns: int
Example:
r, idx = com.tslog_add_online_replay_config(r'.\Data\Demo\Logs\CANSystem_CAN2.blf') com.tslog_stop_online_replay(idx)
2.175 tslog_stop_online_replays
Prototype:
int tslog_stop_online_replays()Group: com
Description:
Stop all online replay enginesParameters: (없음)
Returns: int
Example:
if com.tslog_stop_online_replays() == 0: app.log_text("stop online replays", lvlOK)
2.176 wait_can_message
Prototype:
int wait_can_message(AInstance: MpInstance, ATxCAN: RawCAN, ARxCAN: RawCAN, ATimeOutMs: int)Group: com
Description:
wait a specific CAN message on the busParameters:
Name Const Type Description AInstance No pdouble This is an instance ATxCAN No u32 Transmit a frame before waiting, if the identifier of this frame = -1, then no transmission performed ARxCAN No u32 The frame to receive, user must configure its Identifier and Channel properties ATimeoutMS No s16 Timeout in milliseconds Returns: int
Example:
Instance = MpInstance('PyAPIs') can = RawCAN(0x123, 8, CH1, 0, [1,2,3,4,5,6,7,8]) rx = RawCAN(0x64, 8, CH1, 0, [1,2,3,4,5,6,7,8]) r = com.wait_can_message(Instance, can, rx, 100) if 0 == r or IDX_ERR_SW_API_WAIT_TIMEOUT == r: app.log_text("wait can message 100ms", lvlOK)
3. test
3.1 check_error_begin
Prototype:
void check_error_begin()Group: test
Description:
use in combination with check_error_end to find if there are errors in betweenParameters: (없음)
Returns: void
Example:
if test.check_error_begin() == 0: app.log_text("check error begin", lvlOK)
3.2 check_error_end
Prototype:
Tuple check_error_end()Group: test
Description:
use in combination with check_error_begin to find if there are errors in betweenParameters: (없음)
Returns: Tuple
Example:
n = test.check_error_end() app.log_text('test.check_error_end() = ' + str(n), lvlOK)
3.3 check_test_terminate
Prototype:
int check_test_terminate()Group: test
Description:
check if user wants to terminate the test process, return 0 means user requested terminationParameters: (없음)
Returns: int
Example:
if 0 != test.check_test_terminate(): app.log_text("check test terminate", lvlOK)
3.4 check_verdict
Prototype:
int check_verdict(AInstance: MpInstance, AName: str, AValue: float, AMin: float, AMax: float)Group: test
Description:
check verdict by value range, if value in range, verdict is set to OK, otherwise set to NOKParameters:
Name Const Type Description AInstance No pdouble This is an instance AName No u8 verdict name AValue No s32 actual value AMin No s32 minimum constrant value AMax No s32 maximum constrant value Returns: int
Example:
i = test.check_verdict(Instance, "var1", 12, 2, 15) if IDX_ERR_TEST_CHECK_LOWER == i: # var1 is smaller than range app.log_text("smaller", lvlOK) elif IDX_ERR_TEST_CHECK_UPPER == i: # var1 is greater than range app.log_text("greater", lvlOK) elif IDX_ERR_OK == i: # var1 is within range app.log_text("OK", lvlOK)
3.5 debug_log_info
Prototype:
int debug_log_info(AInstance: MpInstance, AFile: str, AFunc: str, ALine: int, AStr: str, ALevel: int)Group: test
Description:
log debug information including file name, function name and line numberParameters:
Name Const Type Description AInstance No pdouble This is an instance AFile No u8 debug file name AFunc No u8 debug function name ALine No u16 debug line number AStr No u8 string to be printed ALevel No s16 Log level, can be: lvlError = 1, lvlWarning = 2, lvlOK = 3, lvlHint = 4, lvlInfo = 5, lvlVerbose = 6 Returns: int
Example:
Instance = MpInstance('PyAPIs') if test.debug_log_info(Instance, 'file1.c', 'func1', 123, 'str1', lvlOK) == 0: app.log_text("debug log info", lvlOK)
3.6 log_info
Prototype:
int log_info(AInstance: MpInstance, AMsg: str, ALevel: int)Group: test
Description:
log test messages to the current test systemParameters:
Name Const Type Description AInstance No pdouble This is an instance AStr No u8 String to be printed TLevel No s16 Log level, can be: lvlError = 1, lvlWarning = 2, lvlOK = 3, lvlHint = 4, lvlInfo = 5, lvlVerbose = 6 Returns: int
Example:
Instance = MpInstance('PyAPIs') test.log_info(Instance, 'this is a test info', lvlInfo)
3.7 log_string
Prototype:
void log_string(AInstance: MpInstance, AMsg: str, AValue: str, ALevel: int)Group: test
Description:
log name = value pair into the current test systemParameters:
Name Const Type Description AInstance No pdouble This is an instance AStr No u8 String to be printed AValue No u8 value to be printed TLogLevel No s16 Log level, can be: lvlError = 1, lvlWarning = 2, lvlOK = 3, lvlHint = 4, lvlInfo = 5, lvlVerbose = 6 Returns: void
Example:
Instance = MpInstance('PyAPIs') # log error string: test.log_string(Instance, 'this is a test string', 'abc edf', lvlOK)
3.8 log_value
Prototype:
void log_value(AInstance: MpInstance, AMsg: str, AValue: float, ALevel: int)Group: test
Description:
log name = value pair into the current test systemParameters:
Name Const Type Description AInstance No pdouble This is an instance AStr No u8 String to be printed AValue No double value to be printed TLogLevel No s16 Log level, can be: lvlError = 1, lvlWarning = 2, lvlOK = 3, lvlHint = 4, lvlInfo = 5, lvlVerbose = 6 Returns: void
Example:
Instance = MpInstance('PyAPIs') # log error string: test.log_value(Instance, 'this is a test value', 1.23, lvlOK)
3.9 retrieve_current_result_folder
Prototype:
Tuple retrieve_current_result_folder(AInstance: MpInstance)Group: test
Description:
get the test case current log directoryParameters:
Name Const Type Description AFolder No pdouble address of pointer to the log directory Returns: Tuple
Example:
Instance = MpInstance('PyAPIs') test.retrieve_current_result_folder(Instance)
3.10 set_verdict_cok
Prototype:
int set_verdict_cok(AMsg: str)Group: test
Description:
set COK verdict of the current test caseParameters:
Name Const Type Description AMsg No u8 message of the current verdict Returns: int
Example:
test.set_verdict_cok('this is COK verdict')
3.11 set_verdict_nok
Prototype:
int set_verdict_nok(AMsg: str)Group: test
Description:
set NOK verdict of the current test caseParameters:
Name Const Type Description AMsg No u8 message of the current verdict Returns: int
Example:
test.set_verdict_nok('this is NOK verdict')
3.12 set_verdict_ok
Prototype:
int set_verdict_ok(AMsg: str)Group: test
Description:
set OK verdict of the current test caseParameters:
Name Const Type Description AMsg No u8 message of the current verdict Returns: int
Example:
test.set_verdict_ok('this is OK verdict')
3.13 signal_checker_add_check_with_time
Prototype:
Tuple signal_checker_add_check_with_time(ASgnType: int, ACheckKind: int, ASgnName: str, ASgnMin: float, ASgnMax: float, ATimeStartS: float, ATimeEndS: float)Group: test
Description:
to add signal checking logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ACheckKind No s16 signal check kind, see TSMaster header ASgnName No u8 the signal name to be checked ASgnMin No s32 minimum value allowed ASgnMax No s32 maximum value allowed ATimeStartS No s32 check time range start ATimeEndS No s32 check time range end Returns: Tuple
Example:
id_time_EngSpeed = test.signal_checker_add_check_with_time(TSignalType_stCANSignal, TSignalCheckKind_sckAlways, '0/CAN_FD_Powertrain/[xx]/EngineData/EngSpeed', 4500, 4600, 0, 999) app.log_text("signal checker add check with time = " + str(id_time_EngSpeed), lvlOK)
3.14 signal_checker_add_check_with_trigger
Prototype:
Tuple signal_checker_add_check_with_trigger(ASgnType: int, ACheckKind: int, ASgnName: str, ASgnMin: float, ASgnMax: float, ATriggerType: int, ATriggerName: str, ATriggerMin: float, ATriggerMax: float)Group: test
Description:
to add signal checking logic within specific trigger signalParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ACheckKind No s16 signal check kind, see TSMaster header ASgnName No u8 the signal name to be checked ASgnMin No s32 minimum value allowed ASgnMax No s32 maximum value allowed ATriggerType No s16 trigger signal type ATriggerName No u8 trigger signal name ATriggerMin No s32 trigger signal minimum value for activation of trigger ATriggerMax No s32 trigger signal maximum value for activation of trigger Returns: Tuple
Example:
id_trigger_EngSpeed = test.signal_checker_add_check_with_trigger(TSignalType_stCANSignal, TSignalCheckKind_sckAlways, '0/CAN_FD_Powertrain/[xx]/EngineData/EngSpeed', 4500, 4600, TSignalType_stSystemVar, 'Application.Connected', 1, 1) app.log_text("signal checker add check with trigger = " + str(id_trigger_EngSpeed), lvlOK)
3.15 signal_checker_add_falling_edge_with_time
Prototype:
Tuple signal_checker_add_falling_edge_with_time(ASgnType: int, ASgnName: str, ATimeStartS: float, ATimeEndS: float)Group: test
Description:
to add signal falling edge checking logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ATimeStartS No s32 check time range start ATimeEndS No s32 check time range end Returns: Tuple
Example:
id_time_FallingEdge = test.signal_checker_add_falling_edge_with_time(TSignalType_stSystemVar, 'stim_edge', 0, 999) app.log_text("signal checker add falling edge with time = " + str(id_time_FallingEdge), lvlOK)
3.16 signal_checker_add_falling_edge_with_trigger
Prototype:
Tuple signal_checker_add_falling_edge_with_trigger(ASgnType: int, ASgnName: str, ATriggerType: int, ATriggerName: str, ATriggerMin: float, ATriggerMax: float)Group: test
Description:
to add signal falling edge checking logic within specific trigger signal activationParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ATriggerType No s16 trigger signal type ATriggerName No u8 trigger signal name ATriggerMin No s32 trigger signal minimum value for activation of trigger ATriggerMax No s32 trigger signal maximum value for activation of trigger Returns: Tuple
Example:
id_trigger_FallingEdge = test.signal_checker_add_falling_edge_with_trigger(TSignalType_stSystemVar, 'stim_edge', TSignalType_stSystemVar, 'Application.Connected', 1, 1) app.log_text("signal checker add falling edge with trigger = " + str(id_trigger_FallingEdge), lvlOK)
3.17 signal_checker_add_follow_with_time
Prototype:
Tuple signal_checker_add_follow_with_time(ASgnType: int, AFollowSignalType: int, ASgnName: str, AFollowSgnName: str, AErrorRange: float, ATimeStartS: float, ATimeEndS: float)Group: test
Description:
to add signal following another signal behavior checking logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header AFollowSgnType No s16 follow signal type, see TSMaster header ASgnName No u8 the signal name to be checked AFollowSgnName No u8 the follow signal name to be checked AErrorRange No s32 error range ATimeStartS No s32 check time range start ATimeEndS No s32 check time range end Returns: Tuple
Example:
if test.signal_checker_add_follow_with_time(TSignalType_stSystemVar, TSignalType_stSystemVar, 'stim_var', 'stim_follow_var', 20, 0, 999) == 0: app.log_text("signal checker for this signal id is %d" % id, lvlOK)
3.18 signal_checker_add_follow_with_trigger
Prototype:
Tuple signal_checker_add_follow_with_trigger(ASgnType: int, AFollowSignalType: int, ASgnName: str, AFollowSgnName: str, AErrorRange: float, ATriggerType: int, ATriggerName: str, ATriggerMin: float, ATriggerMax: float)Group: test
Description:
to add signal following another signal behavior checking logic within specific trigger activation rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header AFollowSgnType No s16 follow signal type, see TSMaster header ASgnName No u8 the signal name to be checked AFollowSgnName No u8 the follow signal name to be checked AErrorRange No s32 error range ATriggerType No s16 trigger signal type ATriggerName No u8 trigger signal name ATriggerMin No s32 trigger signal minimum value for activation of trigger ATriggerMax No s32 trigger signal maximum value for activation of trigger Returns: Tuple
Example:
if test.signal_checker_add_follow_with_trigger(TSignalType_stSystemVar, TSignalType_stSystemVar, 'stim_var', 'stim_follow_var', 20, TSignalType_stSystemVar, 'Application.Connected', 1, 1) == 0: app.log_text("signal checker for this signal id is %d" % id, lvlOK)
3.19 signal_checker_add_jump_with_time
Prototype:
Tuple signal_checker_add_jump_with_time(ASgnType: int, ASgnName: str, AIgnoreFrom: bool, AFrom: float, ATo: float, ATimeStartS: float, ATimeEndS: float)Group: test
Description:
to add signal checking logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked AIgnoreFrom No boolean whether ignore from value AFrom No double from value of signal ATo No double to value of signal ATimeStartS No double check time range start ATimeEndS No double check time range end Returns: Tuple
Example:
id_time_jump = test.signal_checker_add_jump_with_time(TSignalType_stSystemVar, 'stim_jump', False, 8, 20, 0, 999) app.log_text("signal checker add jump with time = " + str(id_time_jump), lvlOK)
3.20 signal_checker_add_jump_with_trigger
Prototype:
Tuple signal_checker_add_jump_with_trigger(ASgnType: int, ASgnName: str, AIgnoreFrom: bool, AFrom: float, ATo: float, ATriggerType: int, ATriggerName: str, ATriggerMin: float, ATriggerMax: float)Group: test
Description:
to add signal checking logic within specific trigger signalParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked AIgnoreFrom No boolean minimum value allowed AFrom No double minimum value allowed ATo No double maximum value allowed ATriggerType No s16 trigger signal type ATriggerName No u8 trigger signal name ATriggerMin No float trigger signal minimum value for activation of trigger ATriggerMax No float trigger signal maximum value for activation of trigger Returns: Tuple
Example:
id_trigger_jump = test.signal_checker_add_jump_with_trigger(TSignalType_stSystemVar, 'stim_jump', False, 8, 20, TSignalType_stSystemVar, 'Application.Connected', 1, 1) app.log_text("test.signal checker add jump with trigger = " + str(id_trigger_jump), lvlOK)
3.21 signal_checker_add_monotony_falling_with_time
Prototype:
Tuple signal_checker_add_monotony_falling_with_time(ASgnType: int, ASgnName: str, ASampleIntervalMs: int, ATimeStartS: float, ATimeEndS: float)Group: test
Description:
to add signal monotony falling behavior checking logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ASampleIntervalMs No s16 sample interval in milliseconds ATimeStartS No s32 check time range start ATimeEndS No s32 check time range end Returns: Tuple
Example:
id_time_falling = test.signal_checker_add_monotony_falling_with_time(TSignalType_stSystemVar, 'stim_falling', 200, 0, 999) app.log_text("signal checker add monotony rising with time = " + str(id_time_falling), lvlOK)
3.22 signal_checker_add_monotony_falling_with_trigger
Prototype:
Tuple signal_checker_add_monotony_falling_with_trigger(ASgnType: int, ASgnName: str, ASampleIntervalMs: int, ATriggerType: int, ATriggerName: str, ATriggerMin: float, ATriggerMax: float)Group: test
Description:
to add signal monotony falling behavior checking logic within specific trigger activationParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ASampleIntervalMs No s16 sample interval in milliseconds ATriggerType No s16 trigger signal type ATriggerName No u8 trigger signal name ATriggerMin No s32 trigger signal minimum value for activation of trigger ATriggerMax No s32 trigger signal maximum value for activation of trigger Returns: Tuple
Example:
id_trigger_falling = test.signal_checker_add_monotony_falling_with_trigger(TSignalType_stSystemVar, 'stim_falling', 200, TSignalType_stSystemVar, 'Application.Connected', 1, 1) app.log_text("signal checker add monotony rising with trigger = " + str(id_trigger_falling), lvlOK)
3.23 signal_checker_add_monotony_rising_with_time
Prototype:
Tuple signal_checker_add_monotony_rising_with_time(ASgnType: int, ASgnName: str, ASampleIntervalMs: int, ATimeStartS: float, ATimeEndS: float)Group: test
Description:
to add signal monotony rising behavior checking logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ASampleIntervalMs No s16 sample interval in milliseconds ATimeStartS No s32 check time range start ATimeEndS No s32 check time range end Returns: Tuple
Example:
id_time_rising = test.signal_checker_add_monotony_rising_with_time(TSignalType_stSystemVar, 'stim_rising', 200, 0, 999) app.log_text("test.signal_checker_add_monotony_rising_with_time(TSignalType_stSystemVar, 'stim_rising', 200, 0, 999) = " + str(id_time_rising), lvlOK)
3.24 signal_checker_add_monotony_rising_with_trigger
Prototype:
Tuple signal_checker_add_monotony_rising_with_trigger(ASgnType: int, ASgnName: str, ASampleIntervalMs: int, ATriggerType: int, ATriggerName: str, ATriggerMin: float, ATriggerMax: float)Group: test
Description:
to add signal monotony rising behavior checking logic within specific trigger activationParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ASampleIntervalMs No s16 sample interval in milliseconds ATriggerType No s16 trigger signal type ATriggerName No u8 trigger signal name ATriggerMin No s32 trigger signal minimum value for activation of trigger ATriggerMax No s32 trigger signal maximum value for activation of trigger Returns: Tuple
Example:
id_trigger_rising = test.signal_checker_add_monotony_rising_with_trigger(TSignalType_stSystemVar, 'stim_rising', 200, TSignalType_stSystemVar, 'Application.Connected', 1, 1) app.log_text("signal checker add monotony rising with trigger = " + str(id_trigger_rising), lvlOK)
3.25 signal_checker_add_rising_edge_with_time
Prototype:
Tuple signal_checker_add_rising_edge_with_time(ASgnType: int, ASgnName: str, ATimeStartS: float, ATimeEndS: float)Group: test
Description:
to add signal rising edge checking logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ATimeStartS No s32 check time range start ATimeEndS No s32 check time range end Returns: Tuple
Example:
id_time_RisingEdge = test.signal_checker_add_rising_edge_with_time(TSignalType_stSystemVar, 'stim_edge', 0, 999) app.log_text("signal checker add falling edge with time = " + str(id_time_RisingEdge), lvlOK)
3.26 signal_checker_add_rising_edge_with_trigger
Prototype:
Tuple signal_checker_add_rising_edge_with_trigger(ASgnType: int, ASgnName: str, ATriggerType: int, ATriggerName: str, ATriggerMin: float, ATriggerMax: float)Group: test
Description:
to add signal rising edge checking logic within specific trigger signal activationParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ATriggerType No s16 trigger signal type ATriggerName No u8 trigger signal name ATriggerMin No s32 trigger signal minimum value for activation of trigger ATriggerMax No s32 trigger signal maximum value for activation of trigger Returns: Tuple
Example:
id_trigger_RisingEdge = test.signal_checker_add_rising_edge_with_trigger(TSignalType_stSystemVar, 'stim_edge', TSignalType_stSystemVar, 'Application.Connected', 1, 1) app.log_text("signal checker add falling edge with trigger = " + str(id_trigger_RisingEdge), lvlOK)
3.27 signal_checker_add_statistics_with_time
Prototype:
Tuple signal_checker_add_statistics_with_time(ASgnType: int, AStatisticsKind: int, ASgnName: str, ATimeStartS: float, ATimeEndS: float)Group: test
Description:
to add signal statistics logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header AStatisticsKind No s16 signal statistics kind, see TSMaster header ASgnName No u8 the signal name to be checked ATimeStartS No s32 check time range start ATimeEndS No s32 check time range end Returns: Tuple
Example:
id_time_stat = test.signal_checker_add_statistics_with_time(TSignalType_stSystemVar, TSignalStatisticsKind_sskMax, 'map_can_expr', 0, 999) app.log_text("signal checker add statistics with time = " + str(id_time_stat), lvlOK)
3.28 signal_checker_add_statistics_with_trigger
Prototype:
Tuple signal_checker_add_statistics_with_trigger(ASgnType: int, AStatisticsKind: int, ASgnName: str, ATriggerType: int, ATriggerName: str, ATriggerMin: float, ATriggerMax: float)Group: test
Description:
to add signal checking logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header AStatisticsKind No s16 signal statistics kind, see TSMaster header ASgnName No u8 the signal name to be checked ATriggerType No s16 minimum value allowed ATriggerName No u8 maximum value allowed ATriggerMin No s32 check time range start ATriggerMax No s32 check time range end Returns: Tuple
Example:
test.signal_checker_add_statistics_with_trigger(TSignalType_stSystemVar, TSignalStatisticsKind_sskMax, 'map_can_expr', TSignalType_stSystemVar, 'Application.Connected', 1, 1)
3.29 signal_checker_add_unchange_with_time
Prototype:
Tuple signal_checker_add_unchange_with_time(ASgnType: int, ASgnName: str, ATimeStartS: float, ATimeEndS: float)Group: test
Description:
to add signal checking logic within specific time rangeParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ATimeStartS No float check time range start ATimeEndS No float check time range end Returns: Tuple
Example:
id_time_unchange = test.signal_checker_add_unchange_with_time(TSignalType_stSystemVar, 'Application.Connected', 0, 999) app.log_text("signal checker add unchange with time = " + str(id_time_unchange), lvlOK)
3.30 signal_checker_add_unchange_with_trigger
Prototype:
Tuple signal_checker_add_unchange_with_trigger(ASgnType: int, ASgnName: str, ATriggerType: int, ATriggerName: str, ATriggerMin: float, ATriggerMax: float)Group: test
Description:
to add signal checking logic within specific trigger signalParameters:
Name Const Type Description ASgnType No s16 signal type, see TSMaster header ASgnName No u8 the signal name to be checked ATriggerType No s16 trigger signal type ATriggerName No u8 trigger signal name ATriggerMin No float trigger signal minimum value for activation of trigger ATriggerMax No float trigger signal maximum value for activation of trigger Returns: Tuple
Example:
id_trigger_unchange = test.signal_checker_add_unchange_with_trigger(TSignalType_stSystemVar, 'Application.Connected', TSignalType_stSystemVar, 'Application.Connected', 1, 1) app.log_text("signal checker add unchange with trigger = " + str(id_trigger_unchange), lvlOK)
3.31 signal_checker_check_statistics
Prototype:
Tuple signal_checker_check_statistics(AInstance: MpInstance, ACheckId: int, AMin: float, AMax: float)Group: test
Description:
get statistics check result in signal checkerParameters:
Name Const Type Description AInstance No pdouble This is an instance ACheckId No u16 check id returned from signal checker add functions AMin No double allowed minimum statistics range AMax No double allowed maximum statistics range Returns: Tuple
Example:
Instance = MpInstance('PyAPIs') r, id_time_stat = test.signal_checker_add_statistics_with_time(TSignalType_stSystemVar, TSignalStatisticsKind_sskMax, 'map_can_expr', 0, 999) r, is_pass, value, repr = test.signal_checker_check_statistics(Instance, id_time_stat, 500, 600) app.log_text('test.signal_checker_check_statistics(Instance, id_time_stat): pass=' + str(is_pass) + ', value=' + str(value) + ', repr=' + repr, lvlOK)
3.32 signal_checker_clear
Prototype:
int signal_checker_clear()Group: test
Description:
clear all check items in signal checker engineParameters: (없음)
Returns: int
Example:
test.signal_checker_clear() # start to add new check items
3.33 signal_checker_enable
Prototype:
int signal_checker_enable(ACheckId: int, AEnable: bool)Group: test
Description:
enable or disable specific check in signal checker engine, each check is enabled by defaultParameters:
Name Const Type Description ACheckId No s16 check id returned from signal checker add functions AEnable No u16 true: enable check, false: disable check Returns: int
Example:
# retrieve id by signal checker add functions r, id_time_EngSpeed = test.signal_checker_add_check_with_time(TSignalType_stCANSignal, TSignalCheckKind_sckAlways, '0/CAN_FD_Powertrain/[xx]/EngineData/EngSpeed', 4500, 4600, 0, 999) test.signal_checker_enable(id_time_EngSpeed, True)
3.34 signal_checker_get_result
Prototype:
Tuple signal_checker_get_result(AInstance: MpInstance, ACheckId: int)Group: test
Description:
get check result in signal checkerParameters:
Name Const Type Description AInstance No pdouble This is an instance ACheckId No s16 check id returned from signal checker add functions Returns: Tuple
Example:
Instance = MpInstance('PyAPIs') r, id_time_stat = test.signal_checker_add_statistics_with_time(TSignalType_stSystemVar, TSignalStatisticsKind_sskMax, 'map_can_expr', 0, 999) r, is_pass, value, repr = test.signal_checker_get_result(Instance, id_time_stat) app.log_text('signal checker get result: pass=' + str(is_pass) + ', value=' + str(value) + ', repr=' + repr, lvlOK)
3.35 write_result_image
Prototype:
int write_result_image(AInstance: MpInstance, AName: str, AImageFileFullPath: str)Group: test
Description:
write image path to test result for report generationParameters:
Name Const Type Description AInstance No pdouble This is an instance AName No u8 value name AImageFullPath No u8 full path of image file Returns: int
Example:
Instance = MpInstance('PyAPIs') if test.write_result_image(Instance, 'Img', r'.\Data\Resources\TOSUN.png') == 0: app.log_text("successfully write result image", lvlOK)
3.36 write_result_string
Prototype:
void write_result_string(AInstance: MpInstance, AName: str, AValue: str, ALevel: int)Group: test
Description:
write result value in string formatParameters:
Name Const Type Description AInstance No pdouble This is an instance AName No u8 value name AValue No u8 result value in string format ALevel No s16 verdict of the result Returns: void
Example:
Instance = MpInstance('PyAPIs') if test.write_result_string(Instance, 'speed', '123', lvlOK) == 0: app.log_text("write result string", lvlOK)
3.37 write_result_value
Prototype:
void write_result_value(AInstance: MpInstance, AName: str, AValue: float, ALevel: int)Group: test
Description:
write result value in double formatParameters:
Name Const Type Description AInstance No pdouble This is an instance AName No u8 value name AValue No s32 result value in string format ALevel No s16 verdict of the result Returns: void
Example:
Instance = MpInstance('PyAPIs') if test.write_result_value(Instance, 'Temperature', 23.4, lvlOK) == 0: app.log_text("write result value", lvlOK)
Alphabetical Index
- add_application
- add_cyclic_message_can
- add_direct_mapping_can
- add_direct_mapping_with_factor_offset_can
- add_expression_mapping
- add_path_to_environment
- add_system_constant
- am_get_running_state
- am_run
- am_select_sub_module
- am_stop
- block_current_pretx
- call_library_api
- call_mini_program_api
- call_system_api
- can_pdu_container_get_cycle_by_index
- can_pdu_container_get_cycle_count
- can_pdu_container_refresh
- can_pdu_container_set_cycle_by_index
- can_pdu_container_set_cycle_count
- can_rbs_activate_all_networks
- can_rbs_activate_message_by_name
- can_rbs_activate_network_by_name
- can_rbs_activate_node_by_name
- can_rbs_batch_set_end
- can_rbs_batch_set_signal
- can_rbs_batch_set_start
- can_rbs_configure
- can_rbs_enable
- can_rbs_fault_inject_clear
- can_rbs_fault_inject_message_lost
- can_rbs_fault_inject_signal_alter
- can_rbs_get_signal_value_by_address
- can_rbs_get_signal_value_by_element
- can_rbs_is_running
- can_rbs_set_crc_signal
- can_rbs_set_message_cycle_by_name
- can_rbs_set_message_direction
- can_rbs_set_normal_signal
- can_rbs_set_rc_signal
- can_rbs_set_rc_signal_with_limit
- can_rbs_set_signal_value_by_address
- can_rbs_set_signal_value_by_element
- can_rbs_start
- can_rbs_stop
- check
- check_error_begin
- check_error_end
- check_terminate
- check_test_terminate
- check_verdict
- clear_bus_statistics
- clear_measurement_form
- configure_can_baudrate
- configure_canfd_baudrate
- configure_lin_baudrate
- connect
- create_system_var
- debug_log
- debug_log_info
- del_application
- del_cyclic_message_can
- del_cyclic_messages
- del_mapping
- delete_path_from_environment
- delete_symbol_mapping_item
- delete_symbol_mapping_items
- delete_system_constant
- delete_system_var
- directory_exists
- disconnect
- enable_all_graphics
- enable_bus_statistics
- enable_symbol_mapping_engine
- enable_symbol_mapping_item
- end_log
- excel_get_cell_count
- excel_get_cell_value
- excel_get_sheet_count
- excel_get_sheet_name
- excel_load
- excel_set_cell_count
- excel_set_cell_value
- excel_set_sheet_count
- excel_set_sheet_name
- excel_unload
- excel_unload_all
- execute_app
- execute_python_script
- execute_python_string
- flexray_rbs_activate_all_clusters
- flexray_rbs_activate_cluster_by_name
- flexray_rbs_activate_ecu_by_name
- flexray_rbs_activate_frame_by_name
- flexray_rbs_batch_set_end
- flexray_rbs_batch_set_signal
- flexray_rbs_batch_set_start
- flexray_rbs_configure
- flexray_rbs_enable
- flexray_rbs_get_signal_value_by_address
- flexray_rbs_get_signal_value_by_element
- flexray_rbs_is_running
- flexray_rbs_set_crc_signal
- flexray_rbs_set_frame_direction
- flexray_rbs_set_normal_signal
- flexray_rbs_set_rc_signal
- flexray_rbs_set_rc_signal_with_limit
- flexray_rbs_set_signal_value_by_address
- flexray_rbs_set_signal_value_by_element
- flexray_rbs_start
- flexray_rbs_stop
- flexray_rbs_update_frame_by_header
- force_directory
- get_application_list
- get_bus_statistics
- get_can_channel_count
- get_can_signal_value
- get_configuration_file_name
- get_configuration_file_path
- get_constant_double
- get_current_application
- get_custom_components_dir
- get_doc_path
- get_error_description
- get_flexray_channel_count
- get_flexray_signal_value
- get_fps_can
- get_fps_canfd
- get_fps_lin
- get_hardware_id_array
- get_hardware_id_string
- get_host_app_path
- get_lin_channel_count
- get_lin_signal_value
- get_main_window_handle
- get_mapping
- get_system_var_address
- get_system_var_def_by_index
- get_system_var_def_by_name
- get_system_var_generic
- get_system_var_internal_count
- get_system_var_logging
- get_system_var_user_count
- get_system_var_value
- get_timestamp_us
- get_tsmaster_version
- get_turbo_mode
- ini_close
- ini_create
- ini_delete_key
- ini_delete_section
- ini_key_exists
- ini_read_bool
- ini_read_float
- ini_read_int32
- ini_read_int64
- ini_read_string
- ini_section_exists
- ini_write_bool
- ini_write_float
- ini_write_int32
- ini_write_int64
- ini_write_string
- inject_can_message
- inject_flexray_frame
- inject_lin_message
- ioip_connect_tcp_server
- ioip_connect_udp_server
- ioip_create
- ioip_delete
- ioip_disconnect_tcp_server
- ioip_enable_tcp_server
- ioip_enable_udp_server
- ioip_receive_tcp_client_response
- ioip_receive_udp_client_response
- ioip_send_buffer_tcp
- ioip_send_buffer_udp
- ioip_send_tcp_server_response
- ioip_send_udp_broadcast
- ioip_send_udp_server_response
- ioip_set_udp_server_buffer_size
- is_connected
- is_tsmaster_host
- j1939_extract_id
- j1939_get_destination
- j1939_get_dp
- j1939_get_edp
- j1939_get_last_pdu
- j1939_get_last_pdu_as_string
- j1939_get_pgn
- j1939_get_priority
- j1939_get_r
- j1939_get_source
- j1939_make_id
- j1939_set_destination
- j1939_set_dp
- j1939_set_edp
- j1939_set_pgn
- j1939_set_priority
- j1939_set_r
- j1939_set_source
- j1939_transmit_pdu_as_string_async
- j1939_transmit_pdu_as_string_sync
- j1939_transmit_pdu_async
- j1939_transmit_pdu_sync
- lin_rbs_activate_all_networks
- lin_rbs_activate_message_by_name
- lin_rbs_activate_network_by_name
- lin_rbs_activate_node_by_name
- lin_rbs_batch_set_end
- lin_rbs_batch_set_signal
- lin_rbs_batch_set_start
- lin_rbs_configure
- lin_rbs_enable
- lin_rbs_get_signal_value_by_address
- lin_rbs_get_signal_value_by_element
- lin_rbs_is_running
- lin_rbs_set_message_delay_time_by_name
- lin_rbs_set_signal_value_by_address
- lin_rbs_set_signal_value_by_element
- lin_rbs_start
- lin_rbs_stop
- load_plugin
- load_symbol_mapping_settings
- log_info
- log_string
- log_text
- log_value
- make_toast
- mini_delay_cpu
- open_directory_and_select_file
- open_help_doc
- panel_get_bkgd_color
- panel_get_enable
- panel_get_opacity
- panel_get_position_xy
- panel_get_rotation_angle
- panel_get_rotation_center
- panel_get_scale_xy
- panel_get_selector_items
- panel_get_width_height
- panel_set_bkgd_color
- panel_set_enable
- panel_set_height
- panel_set_opacity
- panel_set_position_x
- panel_set_position_xy
- panel_set_position_y
- panel_set_rotation_angle
- panel_set_rotation_center
- panel_set_scale_x
- panel_set_scale_y
- panel_set_selector_items
- panel_set_width
- panel_set_width_height
- pause
- play_sound
- print_delta_time
- print_system_var_value
- prompt_user_input_string
- prompt_user_input_value
- read_mat_file_end
- read_mat_file_start
- read_mat_file_variable_count
- read_mat_file_variable_double
- read_mat_file_variable_string
- read_text_file_end
- read_text_file_line
- read_text_file_start
- retrieve_current_result_folder
- run_form
- run_python_script
- save_screenshot
- save_symbol_mapping_settings
- set_analysis_time_range
- set_can_channel_count
- set_can_signal_value
- set_check_failed_terminate
- set_current_application
- set_default_output_dir
- set_flexray_channel_count
- set_flexray_signal_value
- set_lin_channel_count
- set_lin_signal_value
- set_mapping
- set_system_var_double
- set_system_var_double_array
- set_system_var_double_array_async
- set_system_var_double_async
- set_system_var_generic
- set_system_var_generic_async
- set_system_var_int32
- set_system_var_int32_array
- set_system_var_int32_array_async
- set_system_var_int32_async
- set_system_var_int64_array_from_string
- set_system_var_int64_array_from_string_async
- set_system_var_int64_from_string
- set_system_var_int64_from_string_async
- set_system_var_logging
- set_system_var_string
- set_system_var_string_async
- set_system_var_uint32
- set_system_var_uint32_async
- set_system_var_uint64_from_string
- set_system_var_uint64_from_string_async
- set_system_var_uint8_array
- set_system_var_uint8_array_async
- set_system_var_unit
- set_system_var_value_table
- set_thread_priority
- set_turbo_mode
- set_verdict_cok
- set_verdict_nok
- set_verdict_ok
- sgnsrv_get_can_signal_phy_value_in_msg
- sgnsrv_get_can_signal_phy_value_latest
- sgnsrv_get_flexray_signal_phy_value_in_frame
- sgnsrv_get_flexray_signal_phy_value_latest
- sgnsrv_get_lin_signal_phy_value_in_msg
- sgnsrv_get_lin_signal_phy_value_latest
- sgnsrv_register_can_signal_by_msg_identifier
- sgnsrv_register_can_signal_by_msg_name
- sgnsrv_register_flexray_signal_by_frame
- sgnsrv_register_flexray_signal_by_frame_name
- sgnsrv_register_lin_signal_by_msg_identifier
- sgnsrv_register_lin_signal_by_msg_name
- show_confirm_dialog
- show_window_system_messages
- signal_checker_add_check_with_time
- signal_checker_add_check_with_trigger
- signal_checker_add_falling_edge_with_time
- signal_checker_add_falling_edge_with_trigger
- signal_checker_add_follow_with_time
- signal_checker_add_follow_with_trigger
- signal_checker_add_jump_with_time
- signal_checker_add_jump_with_trigger
- signal_checker_add_monotony_falling_with_time
- signal_checker_add_monotony_falling_with_trigger
- signal_checker_add_monotony_rising_with_time
- signal_checker_add_monotony_rising_with_trigger
- signal_checker_add_rising_edge_with_time
- signal_checker_add_rising_edge_with_trigger
- signal_checker_add_statistics_with_time
- signal_checker_add_statistics_with_trigger
- signal_checker_add_unchange_with_time
- signal_checker_add_unchange_with_trigger
- signal_checker_check_statistics
- signal_checker_clear
- signal_checker_enable
- signal_checker_get_result
- start_log
- stim_get_signal_status
- stim_set_signal_status
- stop_form
- terminate_app_by_name
- terminate_application
- transmit_can_async
- transmit_can_async_wo_pretx
- transmit_can_sync
- transmit_flexray_async
- transmit_flexray_async_wo_pretx
- transmit_flexray_sync
- transmit_lin_async
- transmit_lin_async_wo_pretx
- transmit_lin_sync
- tsdb_get_can_db_count
- tsdb_get_can_db_properties_by_address
- tsdb_get_can_db_properties_by_index
- tsdb_get_can_ecu_properties_by_address
- tsdb_get_can_ecu_properties_by_index
- tsdb_get_can_frame_properties_by_address
- tsdb_get_can_frame_properties_by_db_index
- tsdb_get_can_frame_properties_by_index
- tsdb_get_can_signal_properties_by_address
- tsdb_get_can_signal_properties_by_db_index
- tsdb_get_can_signal_properties_by_frame_index
- tsdb_get_can_signal_properties_by_index
- tsdb_get_flexray_db_count
- tsdb_get_flexray_db_properties_by_address
- tsdb_get_flexray_db_properties_by_index
- tsdb_get_flexray_ecu_properties_by_address
- tsdb_get_flexray_ecu_properties_by_index
- tsdb_get_flexray_frame_properties_by_address
- tsdb_get_flexray_frame_properties_by_db_index
- tsdb_get_flexray_frame_properties_by_index
- tsdb_get_flexray_signal_properties_by_address
- tsdb_get_flexray_signal_properties_by_db_index
- tsdb_get_flexray_signal_properties_by_frame_index
- tsdb_get_flexray_signal_properties_by_index
- tsdb_get_lin_db_count
- tsdb_get_lin_db_properties_by_address
- tsdb_get_lin_db_properties_by_index
- tsdb_get_lin_ecu_properties_by_address
- tsdb_get_lin_ecu_properties_by_index
- tsdb_get_lin_frame_properties_by_address
- tsdb_get_lin_frame_properties_by_db_index
- tsdb_get_lin_frame_properties_by_index
- tsdb_get_lin_signal_properties_by_address
- tsdb_get_lin_signal_properties_by_db_index
- tsdb_get_lin_signal_properties_by_frame_index
- tsdb_get_lin_signal_properties_by_index
- tsdb_load_can_db
- tsdb_load_flexray_db
- tsdb_load_lin_db
- tsdb_unload_can_db
- tsdb_unload_can_dbs
- tsdb_unload_flexray_db
- tsdb_unload_flexray_dbs
- tsdb_unload_lin_db
- tsdb_unload_lin_dbs
- tslog_add_online_replay_config
- tslog_asc_to_blf
- tslog_blf_read_end
- tslog_blf_read_object
- tslog_blf_read_object_w_comment
- tslog_blf_read_start
- tslog_blf_read_status
- tslog_blf_seek_object_time
- tslog_blf_to_asc
- tslog_blf_write_can
- tslog_blf_write_end
- tslog_blf_write_flexray
- tslog_blf_write_lin
- tslog_blf_write_realtime_comment
- tslog_blf_write_set_max_count
- tslog_blf_write_start
- tslog_blf_write_start_w_timestamp
- tslog_del_online_replay_config
- tslog_del_online_replay_configs
- tslog_get_online_replay_config
- tslog_get_online_replay_count
- tslog_get_online_replay_status
- tslog_pause_online_replay
- tslog_pause_online_replays
- tslog_set_online_replay_config
- tslog_start_online_replay
- tslog_start_online_replays
- tslog_stop_online_replay
- tslog_stop_online_replays
- ui_get_component
- ui_get_form_unique_id
- ui_kill_form
- ui_panel_clear_control
- ui_place_form
- ui_set_form_unique_id
- ui_show_form
- ui_show_open_file_dialog
- ui_show_page_by_index
- ui_show_page_by_name
- ui_show_save_file_dialog
- ui_show_select_directory_dialog
- ui_toggle_mdi_form
- unload_plugin
- wait
- wait_can_message
- wait_system_var
- wait_system_var_disappear
- wait_system_var_existance
- write_mat_file_end
- write_mat_file_start
- write_mat_file_variable_double
- write_mat_file_variable_double_array
- write_mat_file_variable_string
- write_realtime_comment
- write_result_image
- write_result_string
- write_result_value
- write_text_file_end
- write_text_file_line
- write_text_file_line_double_array
- write_text_file_line_string_array
- write_text_file_start
'design' 카테고리의 다른 글
그래픽 프로그램(graphic program)으로 yaw_rate_ws 계산하기 (0) 2024.12.11 yaw_rate_model - ai를 이용한 모델 생성과 활용 (5) 2024.11.07 실시간으로 FFT 하기 - 미니프로그램과 ai (1) 2024.10.25