{"id":14324,"date":"2024-10-17T11:55:32","date_gmt":"2024-10-17T03:55:32","guid":{"rendered":"https:\/\/www.tosunai.com\/?p=14324"},"modified":"2024-10-17T12:12:05","modified_gmt":"2024-10-17T04:12:05","slug":"tsync-function-and-use-of-synchronization-mechanism-timestamp-multiple-devices","status":"publish","type":"post","link":"https:\/\/www.tosunai.com\/en\/tsync-function-and-use-of-synchronization-mechanism-timestamp-multiple-devices\/","title":{"rendered":"Sharing | TSync function and use of the synchronization mechanism of the timestamp between multiple devices"},"content":{"rendered":"
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

With the increasing number of channels for automotive network testing, it is often necessary to connect multiple TOSUN devices to the same TSMaster application on the same computer at the same time, and perform functions such as CAN message sending and receiving and logging by multiple devices at the same time, which inevitably has the requirement of timestamp synchronization between multiple devices as well as time synchronization between devices and the operating system on the computer.<\/p>

\u00a0<\/p>

In order to meet TOSUN between multiple devices and devices and computers between the time synchronization requirements, in this regard, TOSUN TSMaster introduced the TSync synchronization mechanism function, this article introduces the TSync synchronization mechanism function and the corresponding method of use.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t

Keywords in this article: tsync synchronization mechanism, multiple devices, devices and computers, timestamp synchronization<\/p>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t

\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
Table of Contents for this article<\/h6>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t
\n\t\t\t
\n\t\t\t\t<\/path><\/svg>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t

01\u3001Why there is synchronization error between equipment\n\n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

In a multi-device operating environment, each device has an internal clock source. Usually generated by a crystal, the number of pulses are counted by the controller, which in turn timestamps specific events (e.g., message reception, send completion, etc.). This is shown in Figure 1. When multiple devices receive the same event, we would like to get the same timestamp, but this is usually not done and the sources of error include:<\/p>

\u00a0<\/p>

Phase Error:<\/strong>For example, different device power-up timings, startup sequences, etc. lead to fixed deviations in their timestamps;<\/p>

Frequency deviation:<\/strong>Even though the phase deviation is corrected during startup, there is still a slight difference in the frequency of the crystal.<\/p>

\u00a0<\/p>

For example, a crystal with a temperature difference of \u00b130 ppm at room temperature, assuming that the actual deviation is 10 ppm, i.e., 10 parts per million, will produce 60*60*1000*10\/10^6 = 36 milliseconds of deviation in one hour, which is brought about by the lowest level device, and the device can not be corrected by itself alone.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"Independent\t\t\t\t\t\t\t\t\t\t\t
Figure 1 Each device has a separate clock module<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t

02. Awakening\n\n<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\tTSync time synchronization mechanism function is for TOSUN device, including TC series, TP series and other CAN\/CAN FD devices, to achieve the synchronization timestamp error between devices is less than 500 microseconds, and to ensure that the time of TOSUN device and the computer operating system is also completely synchronized function. As shown in Figure 2.\n\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"TC1013\t\t\t\t\t\t\t\t\t\t\t
Figure 2 TC1013 device supporting TSync time synchronization mechanism<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

2.1 Verification methods for the TSync time synchronization mechanism<\/h3>

TSync time synchronization verification is achieved by sending and receiving CAN messages through two TOSUN devices, the main verification method is to use the CAN message send callback event and CAN message receive callback event of C applet to get the message timestamp, and further calculate the time difference between the message sending time of device A and the message receiving time of device B, which is \"comp_time\", as shown in Fig. 3. time\", as shown in Figure 3. At the same time, the graphical module can be used to accurately observe the floating change of the time difference between devices and derive the synchronization effect between devices.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"Part\t\t\t\t\t\t\t\t\t\t\t
Figure 3 Part of the verification script for the TSync time synchronization mechanism<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

The following compares the differences in time synchronization between the devices of the two test groups by means of a reference test group with and without the TSync synchronization mechanism activated.<\/p>

\u00a0<\/p>

2.2 Reference test set for activating the TSync time synchronization mechanism<\/h3>

Reference test group 1: Using activated TSync mechanism and running for more than 48 hours<\/strong><\/p>

[Project]<\/p><\/section><\/section><\/td>

descriptive<\/p><\/section><\/section><\/td><\/tr>

[TOSUN devices]<\/p><\/section><\/section><\/td>

Two TC1013s, designated by \"Equipment A\" and \"Equipment B\"<\/p><\/section><\/section><\/td><\/tr>

[Device firmware compilation time]<\/p><\/section><\/section><\/td>

V2024-09-21<\/p><\/section><\/section><\/td><\/tr>

[Software environment]<\/p><\/section><\/section><\/td>

TSMaster x64 v2024.9.23.1185<\/p><\/section><\/section><\/td><\/tr>

[TSync mechanism activated]<\/p><\/section><\/section><\/td>

be<\/p><\/section><\/section><\/td><\/tr>

[Test Procedure]<\/p><\/section><\/section><\/td>

\u25ba Physically connect CAN channel 1 of \"Device A\" to CAN channel 1 of \"Device B\".<\/p>

\u25ba CAN message 0x123 sent by \"Device A\" channel 1, received by \"Device B\" channel 1<\/p>

\u25ba Run the C applet script to calculate the send\/receive time difference between the two devices<\/p>

\u25ba Observation of the time difference by means of a graphical module<\/p>

\u25ba Continuous operation and observation<\/p><\/section><\/section><\/td><\/tr>

[Test run length]<\/p><\/section><\/section><\/td>

178200 seconds, i.e. over 48 hours<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section>

\u00a0<\/p>

Refer to the results of the test group 1 run:<\/strong><\/p>

After 2 days of continuous operation and observation, it can be found that the time difference \"comp_time\" between the two devices has been maintained at about 220 microseconds. In fact, this 200us difference is mainly due to the startup phase error, because the error caused by different crystal sources has been controlled to a very small range, so it can meet most of the synchronization requirements of CAN bus communication. As shown in Figure 4.<\/p><\/section><\/section>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"Figure\t\t\t\t\t\t\t\t\t\t\t
Fig. 4 Long wake-up signal<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\tThe actual timestamps of the time of sending the message and the time of receiving the message are printed via a system message, together with the corresponding differences, as shown in Figure 5.\n\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"Figure\t\t\t\t\t\t\t\t\t\t\t
Figure 5 System message activating TSync time synchronization<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

2.3 Reference test set without TSync time synchronization mechanism activated<\/strong><\/h3><\/section>

Reference test group 2: TSync mechanism not activated<\/strong><\/p><\/section><\/section>

[Project]<\/p><\/section><\/section><\/td>

descriptive<\/p><\/section><\/section><\/td><\/tr>

[TOSUN devices]<\/p><\/section><\/section><\/td>

Two TC1013s, designated by \"Equipment A\" and \"Equipment B\"<\/p><\/section><\/section><\/td><\/tr>

[Device firmware compilation time]<\/p><\/section><\/section><\/td>

V2024-09-21<\/p><\/section><\/section><\/td><\/tr>

[Software environment]<\/p><\/section><\/section><\/td>

TSMaster x64 v2024.9.23.1185<\/p><\/section><\/section><\/td><\/tr>

[TSync mechanism activated]<\/p><\/section><\/section><\/td>

clogged<\/p><\/section><\/section><\/td><\/tr>

[Test Procedure]<\/p><\/section><\/section><\/td>

\u25ba Physically connect CAN channel 1 of \"Device A\" to CAN channel 1 of \"Device B\".<\/p>

\u25ba CAN message 0x123 sent by \"Device A\" channel 1, received by \"Device B\" channel 1<\/p>

\u25ba Run the C applet script to calculate the send\/receive time difference between the two devices<\/p>

\u25ba Observation of the time difference by means of a graphical module<\/p>

\u25ba Continuous operation and observation<\/p><\/section><\/section><\/td><\/tr>

[Test run length]<\/p><\/section><\/section><\/td>

About 30 minutes.<\/p><\/section><\/section><\/td><\/tr><\/tbody><\/table><\/section><\/section>

\u00a0<\/p>

Refer to the results of the test group 2 run:<\/strong><\/p>

Without activating the TSync time synchronization function in advance, you can find that the time difference between the two devices for sending and receiving messages \"comp_time\" is getting bigger and bigger with the running time, which is not quite in line with the application of time synchronization requirements. As shown in Figure 6.<\/p><\/section>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"Figure\t\t\t\t\t\t\t\t\t\t\t
Figure 6 Results of running TSync time synchronization without activation<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t

03\u3001How to activate the TSync function of TOSUN device<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

To activate the TSync function of TOSUN device, mainly through upgrading the device firmware and the control settings of TSync on the TSMaster software side.<\/p>

\u00a0<\/p>

3.1 Upgrading the firmware of the updated device<\/h3>

The procedure for upgrading the firmware of TOSUN device is as follows:<\/p>

\u00a0<\/p>

1. Prepare a computer and install the latest version of TSMaster software, the recommended version is V2024.09.23.1185 and above. Software update path: [Help] - [Check Upgrade] - [Download Public Test Version]. As shown in Figure 7.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"Figure\t\t\t\t\t\t\t\t\t\t\t
Figure 7 Upgrade and download the latest version of TSMaster<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

2. Connect the device that needs to be upgraded to the computer via USB.<\/p>

\u00a0<\/p>

3. Through [Hardware] - [Channel Mapping] - [Hardware], after selecting the device, right-click at [Device Firmware Compilation Time] on the right and select [Read Latest Firmware Compilation Time], as shown in Figure 8.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"Figure\t\t\t\t\t\t\t\t\t\t\t
Figure 8 Reading the latest firmware compilation time<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t4. After reading, select [Update Device Firmware], after the download prompts \"Load Firmware Complete\", select [Upgrade] button to upgrade automatically. As shown in Figure 9. After the upgrade is successful, plug and unplug the USB port of the device according to the prompts.\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"Figure\t\t\t\t\t\t\t\t\t\t\t
Figure 9 Upgrading Firmware<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

3.2 TSync Control Settings for TSMaster Software<\/h3>

After connecting the device to the TSMaster, activate [Enable TSync Time Synchronization Mechanism] through [Hardware] - [Channel Selection] - [Settings] - [TSync Control], and you can refresh the list by right clicking on \"List of Online Devices Supporting TSync Technology\" at the bottom. After enabling the TSync mechanism, devices that support this mechanism can realize hardware timestamp synchronization. As shown in Figure 10.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\"Figure\t\t\t\t\t\t\t\t\t\t\t
Figure 10 Enabling the TSync time synchronization mechanism<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\ttip\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t
  1. Software Download:<\/strong>
    Click on the software download link below to download and install directly, beta version is recommended:

    <\/li>
  2. Software upgrades:<\/strong>
    You can check for upgrades to the latest version within the software, provided that your computer has an Internet connection.<\/li><\/ol>

    Note: TOSUN Technical Support Email:support@tosunai.cn<\/a>We welcome inquiries! (Company and contact information must be indicated)<\/strong><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

    \n\t\t\t\t
    \n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t<\/path><\/svg>\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\tClick to download<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"

    As the number of channels for automotive network testing continues to grow, from time to time it is necessary to have multiple same-star devices connected to the same TSMaster application on the same computer at the same time, [...].<\/p>","protected":false},"author":11,"featured_media":14336,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[90],"tags":[65,131],"class_list":{"0":"post-14324","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-software-tutorial","8":"tag-tsmaster","10":"entry","11":"has-media","12":"owp-thumbs-layout-horizontal","13":"owp-btn-normal","14":"owp-tabs-layout-horizontal","15":"has-no-thumbnails","16":"has-product-nav"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/posts\/14324"}],"collection":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/comments?post=14324"}],"version-history":[{"count":7,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/posts\/14324\/revisions"}],"predecessor-version":[{"id":14342,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/posts\/14324\/revisions\/14342"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/media\/14336"}],"wp:attachment":[{"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/media?parent=14324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/categories?post=14324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tosunai.com\/en\/wp-json\/wp\/v2\/tags?post=14324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}