<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RPC &#8211; 上海同星智能科技有限公司</title>
	<atom:link href="https://www.tosunai.com/tag/rpc/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tosunai.com</link>
	<description>Engineer Everything!</description>
	<lastBuildDate>Thu, 11 Jun 2026 03:56:00 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>

<image>
	<url>https://www.tosunai.com/wp-content/uploads/2024/09/112x112-100x100.webp</url>
	<title>RPC &#8211; 上海同星智能科技有限公司</title>
	<link>https://www.tosunai.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>基于TSMaster的自动化刷写与流程状态实时显示方案</title>
		<link>https://www.tosunai.com/a-solution-for-automated-flashing-and-real-time-process-status-display-based-on-tsmaster/</link>
					<comments>https://www.tosunai.com/a-solution-for-automated-flashing-and-real-time-process-status-display-based-on-tsmaster/#respond</comments>
		
		<dc:creator><![CDATA[pan]]></dc:creator>
		<pubDate>Thu, 11 Jun 2026 03:33:34 +0000</pubDate>
				<category><![CDATA[软件操作教程]]></category>
		<category><![CDATA[RPC]]></category>
		<category><![CDATA[UDS诊断]]></category>
		<category><![CDATA[自动化流程]]></category>
		<guid isPermaLink="false">https://www.tosunai.com/?p=24445</guid>

					<description><![CDATA[<p>在汽车电子产线、服务站或实验室中，你是否也遇到过这些痛点：刷写过程不可见、状态无法实时回传、失败后难以快速定位 [&#8230;]</p>
<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.tosunai.com/a-solution-for-automated-flashing-and-real-time-process-status-display-based-on-tsmaster/">基于TSMaster的自动化刷写与流程状态实时显示方案</a> first appeared on <a rel="nofollow" href="https://www.tosunai.com">上海同星智能科技有限公司</a>.&lt;/p&gt;</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">在汽车电子产线、服务站或实验室中，你是否也遇到过这些痛点：刷写过程不可见、状态无法实时回传、失败后难以快速定位、无法与MES系统高效集成？</p>



<p class="wp-block-paragraph">今天，我们分享一套<strong>基于同星TSMaster软件平台与配套硬件的自动化刷写与流程状态实时显示方案</strong>。该方案通过 COM/RPC 自动化接口调用诊断系统变量，实现无人值守自动化刷写，并借助UDP实时通信将诊断流程步骤、执行状态、进度信息与刷写结果同步外发，支持命令行日志输出与图形化进度条可视化。</p>



<p class="wp-block-paragraph" style="font-weight:700"></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="1080" height="608" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_01.webp" alt="TSMaster自动化刷写方案整体架构" class="wp-image-24432" title="基于TSMaster的自动化刷写与流程状态实时显示方案 1" srcset="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_01.webp 1080w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_01-768x432.webp 768w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_01-800x450.webp 800w" sizes="(max-width: 1080px) 100vw, 1080px" /></figure>
</div>


<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-11">方案亮点速览</h2>



<p class="has-medium-font-size wp-block-paragraph"><strong>配置防呆校验</strong></p>



<p class="wp-block-paragraph">自动检测工程路径、刷写文件合法性，异常即时提示，避免无效执行。</p>



<p class="wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><strong>命令行实时状态显示</strong></p>



<p class="wp-block-paragraph">支持 bat/exe格式一键调用，命令行实时输出刷写流程与执行结果，步骤异常显示 Fail 并保留工程界面。</p>



<p class="wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><strong>进度条可视化</strong></p>



<p class="wp-block-paragraph">独立弹窗置顶显示刷写进度：初始化、刷写中、刷写完成三级进度提示，百分比实时刷新，直观展示执行进度。</p>



<p class="wp-block-paragraph"></p>



<p class="has-medium-font-size wp-block-paragraph"><strong>异常处理（可选）</strong></p>



<p class="wp-block-paragraph">刷写成功自动退出工程，刷写失败保留工程界面并抛出错误，便于问题定位。</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-12">典型应用场景</h2>



<p class="wp-block-paragraph">本方案主要面向多数汽车电子产线和主机厂、整车厂服务站、零部件测试验证等场景：</p>



<ul class="wp-block-list">
<li>实现无人值守自动化刷写，大幅提升产线 EOL 效率；</li>



<li>实时输出诊断服务名称、执行步骤、运行状态、成功 / 失败结果；</li>



<li>支持调试人员快速定位失败节点，降低排查成本；</li>



<li>可集成到 MES / 上位机系统，形成标准化自动化刷写工位。</li>
</ul>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-13">方案实现原理</h2>



<p class="wp-block-paragraph">自动化刷写的核心是通过脚本控制 TSMaster 内部系统变量，实现诊断流程启动、执行、状态读取与结果回收。</p>



<p class="wp-block-paragraph">该方案支持两种控制方式：COM 接口调用、RPC 远程过程调用，并通过UDP 套接字实现状态实时上报。</p>



<h3 class="wp-block-heading">3.1 技术架构</h3>



<ol class="wp-block-list">
<li>配置层：提供统一参数配置入口，管理工程路径、刷写文件、诊断 ID、等核心参数；</li>



<li>控制层：由 Python 脚本通过 COM/RPC 接口实现 TSMaster 工程远程控制、配置解析与防呆校验；</li>



<li>采集层：TSMaster 内置 C 小程序实时读取诊断流程系统变量，获取服务执行状态与结果；</li>



<li>通信层：采用 UDP 本地套接字实现实时性的数据传输；</li>



<li>展示层：通过命令行日志 + 图形进度条完成流程状态可视化展示。</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="1080" height="621" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_02.webp" alt="TSMaster自动化刷写技术架构图" class="wp-image-24441" title="基于TSMaster的自动化刷写与流程状态实时显示方案 2" srcset="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_02.webp 1080w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_02-768x442.webp 768w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_02-800x460.webp 800w" sizes="(max-width: 1080px) 100vw, 1080px" /></figure>
</div>


<h3 class="wp-block-heading">3.2 COM 自动化实现原理</h3>



<p class="wp-block-paragraph">通过 win32com 直接创建并控制 TSMaster 应用实例，无需手动打开工程，脚本可完成：</p>



<ul class="wp-block-list">
<li>诊断工程加载</li>



<li>硬件通道配置</li>



<li>仿真启动</li>



<li>诊断流程执行</li>



<li>系统变量读写</li>
</ul>



<p class="wp-block-paragraph"><strong>COM 方式实现脚本：</strong></p>



<pre class="wp-block-code"><code>global app
app = win32com.client.Dispatch("TSMaster.TSApplication")
com = app.TSCOM()  
formMan = app.TSFormManager()
formMan.show_main_form()
app.set_current_application("TSMaster")
formMan.load_project(project_path, True)  # 指定对应工程
app.set_can_channel_count(1)  
app.connect()  # 启动 TSMaster</code></pre>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading">3.3 RPC 远程控制实现原理</h3>



<p class="wp-block-paragraph">通过 TSMaster 内置 RPC 服务，实现外部脚本对已打开工程的远程控制，适用于需要人工干预与脚本协同的场景。</p>



<p class="wp-block-paragraph"><strong>RPC方式实现脚本：</strong></p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-14"><code>initialize_lib_tsmaster(appname)
namelist = pchar()
get_active_application_list(namelist)
app_name_list = namelist.value.decode().split(';')
rpc_tsmaster_create_client(app_name_list&#91;1].encode(),        rpchandle)
rpc_tsmaster_activate_client(rpchandle, True)
rpc_tsmaster_cmd_start_simulation(rpchandle)</code></pre>



<p class="wp-block-paragraph">使用RPC方式需要额外在TSMaster中设置本地RPC，如下图所示：</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="1080" height="360" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_03.webp" alt="TSMaster本地RPC设置界面" class="wp-image-24440" title="基于TSMaster的自动化刷写与流程状态实时显示方案 3" srcset="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_03.webp 1080w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_03-768x256.webp 768w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_03-800x267.webp 800w" sizes="(max-width: 1080px) 100vw, 1080px" /></figure>
</div>


<p class="wp-block-paragraph">Note: COM 与 RPC 仅连接方式不同，刷写逻辑、配置读取、UDP 通信、防呆校验等模块完全通用。</p>



<h3 class="wp-block-heading">3.4 核心实现</h3>



<figure class="wp-block-table"><table><tbody><tr><td>所属端</td><td>模块名称</td><td>核心功能描述</td></tr><tr><td rowspan="5">Python 侧</td><td>配置解析</td><td>读取并解析 Setting.ini 配置文件，获取工程路径、刷写文件、诊断 ID 等关键参数</td></tr><tr><td>防呆校验</td><td>自动校验工程文件、APP/BOOT 文件、FlashDriver 合法性，拦截中文路径、文件缺失等异常</td></tr><tr><td>UDP 数据监听</td><td>启动本地 UDP 服务，绑定指定端口，实时接收 TSMaster 小程序发送的诊断流程状态数据</td></tr><tr><td>进度条 UI</td><td>创建置顶可视化窗口，实时刷新刷写进度</td></tr><tr><td>TS 工程控制 (COM/RPC)</td><td>通过 COM 接口或 RPC 远程调用，实现工程加载、流程启动、执行控制与结果回收</td></tr><tr><td rowspan="3">TSMaster 小程序侧</td><td>UDP 客户端初始化</td><td>创建 UDP 套接字，配置本地与服务端通信地址，建立与 Python 的实时数据链路</td></tr><tr><td>诊断流程变量监听</td><td>读取 TSMaster 内部系统变量，获取诊断服务名称、执行步骤、运行状态等信息</td></tr><tr><td>状态数据实时发送</td><td>将诊断流程状态与执行结果通过 UDP 报文实时上报至 Python 端，实现状态同步</td></tr></tbody></table></figure>



<h3 class="wp-block-heading">3.4.1 Python 核心代码</h3>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-15 wp-block-paragraph"><strong>防呆校验：</strong></p>



<p class="wp-block-paragraph">用于检查输入app/boot或者工程文件是否合规是否存在。</p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-16"><code>def  check_config():
global setting_dict
driver=setting_dict&#91;'Driver1']
data=setting_dict&#91;'Data1']
profile=setting_dict&#91;'ProjectFullFile']
if driver == "":
return "Flash driver missing"
if not os.path.exists(driver):
    return "Flash driver does not exist"
if data == "":
    return "APP hex missing"
if not os.path.exists(data):
    return "APP hex file does not exist"
if profile == "":
    return "Project missing"
if not os.path.exists(profile):
    return "Project file does not exist"
return "success"</code></pre>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-17 wp-block-paragraph"><strong>配置文件读取：</strong></p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-18"><code>def  read_ini(setting_path):
setting = ConfigParser()
# 读取setting ini文件
setting.read(setting_path)  # config.ini为你要读取的ini文件名

# setting获取配置值
setting_dict&#91;'ProjectFullFile'] = setting.get('Project', 'ProjectFullFile')
# print(f"ProjectFullFile value: {setting_dict&#91;'ProjectFullFile']}")
setting_dict&#91;'DownLoadAuto'] = setting.get('Project', 'DownLoadAuto')
setting_dict&#91;'Result'] = setting.get('Result', 'Result')
setting_dict&#91;'Enforcemode'] = setting.get('Project', 'Enforcemode')
setting_dict&#91;'PowerOn'] = setting.get('GeneralSettings', 'PowerOn')
setting_dict&#91;'Data1'] = setting.get('Data1', 'file_path')
setting_dict&#91;'Driver1'] = setting.get('Driver1', 'file_path')
setting_dict&#91;'FlowName'] = setting.get('DiagnosticFlow', 'FlowName')
setting_dict&#91;'DiagnosticName'] = setting.get('DiagnosticFlow', 'DiagnosticName')
setting_dict&#91;'SeedKeys'] = setting.get('SecurityAccess', 'SeedKeys')
setting_dict&#91;'requestId'] = setting.get('DiagnosticId', 'requestId')
setting_dict&#91;'responseId'] = setting.get('DiagnosticId', 'responseId')
setting_dict&#91;'functionId'] = setting.get('DiagnosticId', 'functionId')</code></pre>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-19 wp-block-paragraph"><strong>进度条可视化：</strong></p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-20"><code>class ProgressPopup:
    def __init__(self):
        self.root = None

self.progress = None
        self.label = None

    def show(self):
        "在独立线程中显示弹窗"
        def create_window():
            self.root = tk.Tk()
            self.root.title("UDS诊断进度")
            self.root.geometry("300x120")
            self.root.attributes('-topmost', True)  # 置顶显示

            self.label = tk.Label(self.root, text="诊断进度:", font=("Arial", 10))
            self.label.pack(pady=5)

            self.progress = ttk.Progressbar(self.root, length=250, mode='determinate')
            self.progress.pack(pady=10)

            self.percent = tk.Label(self.root,  text="等待数据...", font=("Arial", 10))
            self.percent.pack()

            self.root.mainloop()

        thread = threading.Thread(target=create_window, daemon=True)
        thread.start()

    def update(self, value):
        if self.root and self.progress:
            self.root.after(0, lambda: self._update_ui(value))

    def _update_ui(self, value):
        self.progress&#91;'value'] = value
        self.percent.config(text=f"{value:.2f}%")
        if value &gt;= 100:
            messagebox.showinfo("完成", "UDS刷写完成！")

self.root.destroy()
progress_popup = ProgressPopup()
progress_popup.show()</code></pre>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-21 wp-block-paragraph"><strong>UDP 服务端（接收状态日志）：</strong></p>



<p class="wp-block-paragraph">在24年版本（2024.5.24及之后）的诊断流程中新增加了Uds Flow 1_Step State系统变量，用于获取刷写状态字符串，可用于将刷写状态进行回传。</p>



<p class="wp-block-paragraph">整体通信逻辑为TSMaster（客户端，端口 20001）监听 Python 脚本（服务端，端口 30001）的 UDP 报文，实现流程状态实时回传。</p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-22"><code>def  sock_connect(UDP_IP,UDP_PORT):
      global sock
      sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
       sock.bind((UDP_IP,UDP_PORT))</code></pre>



<p class="wp-block-paragraph">定义了一个名为 sock_connect 的函数，建立了一个基于UDP协议的套接字连接，并将其绑定到指定的IP地址和端口号上。</p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-23"><code>def  rececv_data():
        while isRecv:
         bufsize = 1024
         data , addr = sock.recvfrom(bufsize)
         print(data.decode())</code></pre>



<p class="wp-block-paragraph">定义接收数据，在循环中接收UDP套接字（sock）接收到的数据，并将接收到的数据解码并打印出来。</p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-24"><code>def  start_thread():
     global t1
     t1 = threading.Thread(target=rececv_data)
      t1.start()</code></pre>



<p class="wp-block-paragraph">创建一个线程（t1）来执行另一个函数 receive_data，从而在一个独立的线程中接收UDP套接字的数据。</p>



<p class="wp-block-paragraph"></p>



<h3 class="wp-block-heading">3.4.2 TSMaster C 小程序代码（UDP 发送状态）</h3>



<p class="wp-block-paragraph">C 小程序运行于 TSMaster 内部，负责系统变量读取与 UDP 报文发送，主要步骤为：</p>



<p class="wp-block-paragraph">套接字初始化：创建 UDP 套接字，绑定本地 IP 与端口（20001），配置服务端地址（端口30001）。</p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-25"><code>clientSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
clientAddr.sin_family = AF_INET;
clientAddr.sin_port = htons(20001);
clientAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
bind(clientSocket, (sockaddr*)&amp;clientAddr, sizeof(clientAddr));
serverAddr.sin_family = AF_INET;
serverAddr.sin_port = htons(30001);
serverAddr.sin_addr.s_addr = inet_addr("127.0.0.1");</code></pre>



<p class="wp-block-paragraph">变量监听：通过系统变量接口获取诊断流程步骤状态（Diagnostic0.Uds Flow 1_Step State）。<br>数据上报：将流程状态通过 UDP 发送至 Python 服务端，实现状态实时同步。</p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-26"><code>char s&#91;512];
s32 ret = app.get_system_var_string("Diagnostic0.Uds Flow 1_Step State", 512, &amp;s&#91;0]);
if (ret == 0) {
    sendto(clientSocket, s, strlen(s), 0, (sockaddr*)&amp;serverAddr, sizeof(serverAddr));
    log("%s", s);
}</code></pre>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-27 wp-block-paragraph"><strong>Setting.ini配置文件：</strong></p>



<p class="wp-block-paragraph">配置文件用于定义自动化刷写核心参数，包含工程路径、烧录模式、硬件配置、文件路径、诊断参数、安全算法、通信 ID 等关键配置项，示例如下：</p>



<pre class="wp-block-code has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-28"><code>&#91;Project]  ——TSMaster工程文件夹
ProjectFullFile=C:UsersdengzhipingDesktopdemoproject ——工程路径
DownLoadAuto = 1 ——是否自动烧录，1自动烧录，0不自动烧录
Enforcemode = 0 ——是否强刷，1强刷，0不强刷

&#91;Result]
Result = 3 ——刷写结果

&#91;GeneralSettings]
PowerOn = 1  ——是否需要重新上下电
HardWare = 16

&#91;Data1]  ——BOOT或者APP文件路径
file_path = C:UsersdengzhipingDesktopdemoauto_demo

&#91;Driver1] ——FlashDriver文件路径
file_path = C:UsersdengzhipingDesktopdemoauto_demo

&#91;DiagnosticFlow]
FlowName = Uds Flow 1  ——诊断流程名
DiagnosticName = Diagnostic0  ——流程ID

&#91;SecurityAccess]
SeedKeys=xxxxx  ——安全算法（可选）

&#91;DiagnosticId]
requestId = 0x7C0  ——请求（物理）ID
responseId = 0x7C8  ——应答ID
functionId = 0x7DF  ——功能ID</code></pre>



<p class="wp-block-paragraph"></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-29">运行效果展示</h2>



<p class="wp-block-paragraph">最终呈现的方式：python文件会被用户侧打包为一个exe文件，或者处理为bat文件，方便客户去调用自动化刷写。如果正常刷写完成，会自动退出当前工程；若刷写失败，则不退出当前工程，并且抛出failed。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1080" height="389" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_04.webp" alt="TSMaster防呆校验-刷写文件路径不存在" class="wp-image-24439" title="基于TSMaster的自动化刷写与流程状态实时显示方案 4" srcset="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_04.webp 1080w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_04-768x277.webp 768w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_04-800x288.webp 800w" sizes="auto, (max-width: 1080px) 100vw, 1080px" /><figcaption class="wp-element-caption">（刷写文件路径不存在）</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1080" height="177" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_05.webp" alt="TSMaster防呆校验-项目工程路径不存在" class="wp-image-24438" title="基于TSMaster的自动化刷写与流程状态实时显示方案 5" srcset="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_05.webp 1080w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_05-768x126.webp 768w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_05-800x131.webp 800w" sizes="auto, (max-width: 1080px) 100vw, 1080px" /><figcaption class="wp-element-caption">（项目工程路径不存在）</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="600" height="419" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_06.webp" alt="TSMaster防呆校验测试结果" class="wp-image-24437" title="基于TSMaster的自动化刷写与流程状态实时显示方案 6"><figcaption class="wp-element-caption">测试防呆校验</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1080" height="477" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_07.webp" alt="TSMaster命令行实时显示刷写流程状态" class="wp-image-24436" title="基于TSMaster的自动化刷写与流程状态实时显示方案 7" srcset="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_07.webp 1080w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_07-768x339.webp 768w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_07-800x353.webp 800w" sizes="auto, (max-width: 1080px) 100vw, 1080px" /><figcaption class="wp-element-caption">命令行中可以显示刷写流程</figcaption></figure>
</div>


<p class="wp-block-paragraph">创建一个bat文件，双击运行，也可以在命令行窗口看到实时的刷新结果，若某一诊断服务失败，则显示Failed，并且不自动关闭工程。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1080" height="456" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_08.webp" alt="TSMaster刷写流程Failed失败提示" class="wp-image-24435" title="基于TSMaster的自动化刷写与流程状态实时显示方案 8" srcset="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_08.webp 1080w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_08-768x324.webp 768w, https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_08-800x338.webp 800w" sizes="auto, (max-width: 1080px) 100vw, 1080px" /><figcaption class="wp-element-caption">刷写流程Failed</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="298" height="150" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_09.webp" alt="TSMaster UDS诊断初始化进度条" class="wp-image-24434" title="基于TSMaster的自动化刷写与流程状态实时显示方案 9"><figcaption class="wp-element-caption">初始化等待刷新进度条</figcaption></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="308" height="161" src="https://www.tosunai.com/wp-content/uploads/2026/05/solutions-articles-20260611-1_10.webp" alt="TSMaster UDS刷写中与刷写完成进度提示" class="wp-image-24433" title="基于TSMaster的自动化刷写与流程状态实时显示方案 10"><figcaption class="wp-element-caption">刷写中&amp;刷写完成提示</figcaption></figure>
</div>


<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-30">常见问题与解答</h2>



<p class="wp-block-paragraph">Q1：程序发生异常，请检查ini文件中工程路径是否正确？<br>A：这个是配置的ini文件中工程路径不对，或者没有正确安装TSMaster，导致打开工程指定不到TSMaster。</p>



<p class="wp-block-paragraph">Q2：系统报错OSError: [WinError 10048] 通常每个套接字地址(协议/网络地址/端口)只允许使用一次？<br>A：在网络编程中，一个套接字地址由协议（例如TCP或UDP）、网络地址（例如IP地址）和端口号组成。这个错误通常在尝试在相同的地址上创建多个套接字时发生，操作系统默认情况下不允许多个套接字绑定到相同的地址。一般发生在生成exe之后，打开会出现此错误，需要脚本里边重新更改端口号。</p>



<p class="wp-block-paragraph">Q3：显示“打开ini文件错误或者是ini文件格式错误！KeyError: &#8216;Driver1&#8217;”？<br>A：该报错是由于ini配置文件名不对，或者没有找到键值&#8217;Driver1&#8217;，确认Setting配置文件是否存在，再者检查是否存在Driver1这个键值。</p>



<p class="wp-block-paragraph">Q4：工程文件路径配置对了，为什么还是提醒工程Project file does not exist？<br>A：需要检查工程路径下有中文，有中文或者特殊字符都会出现识别不了情况。</p>



<p class="wp-block-paragraph">Q5：本地存在多个刷写项目，如何打开指定的刷写工程？<br>A：COM口可以在setting配置文件中传入指定工程文件的路径，RPC方式可以指定获取到的app_name_list，若只有一个app_name_list[0]，若有多个根据开启的RPC服务端名称确认（如TSMaster1对应app_name_list[1]）。</p>



<p class="wp-block-paragraph">Q6：两种调用方式存在什么区别？<br>A：COM接口可以实现在工程未打开情况下自动调用打开，RPC则需要要求工程处于开启状态，通过脚本或其他上位机直接控制，看实际适配场景进行选择。</p>



<p class="wp-block-paragraph">Q7：工程路径正确但提示文件不存在？<br>A：工程路径包含中文或特殊字符，导致解析异常，将工程与文件放置于纯英文路径，避免特殊符号。</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph">本方案基于TSMaster平台，充分利用其开放的COM/RPC自动化接口及系统变量监听能力，搭配Python脚本实现配置解析、防呆校验、UDP通信与可视化展示，最终形成一套高效率、可观测、可追溯、易调试的自动化刷写方案。无论是产线EOL批量刷写，还是实验室调试验证，都能显著提升效率、降低排查成本。欢迎尝试并集成到您的TSMaster工作流中。</p>



<div class="wp-block-group box-margin has-background is-vertical is-content-justification-center is-layout-flex wp-container-core-group-is-layout-7e46d5a2 wp-block-group-is-layout-flex" style="background-color:#f9f9f9">
<h2 class="wp-block-heading has-text-align-center"><strong><strong><strong><strong>联系我们</strong></strong></strong></strong></h2>



<p class="has-text-align-center wp-block-paragraph">如果您希望获取更详细的汽车测试解决方案，欢迎访问同星官网或添加一对一专业客服。我们将根据您的具体需求，量身定制高效可靠的测试方案，并随时解答您的每一个技术疑问，期待为您提供全方位支持。</p>



<p class="has-text-align-center wp-block-paragraph"></p>



<p class="has-text-align-center wp-block-paragraph">官网：<a target="_blank" href="https://www.tosunai.com/" rel="noreferrer noopener">www.tosunai.com</a></p>



<p class="has-text-align-center wp-block-paragraph">邮箱：<a href="mailto:sales@tosunai.cn">sales@tosunai.cn</a></p>



<p class="wp-block-paragraph"></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="400" height="400" src="https://www.tosunai.com/wp-content/uploads/2022/09/Tosun-wechat-QRcode.webp" alt="Tosun-wechat-QRcode" class="wp-image-1235" title="基于TSMaster的自动化刷写与流程状态实时显示方案 11" srcset="https://www.tosunai.com/wp-content/uploads/2022/09/Tosun-wechat-QRcode.webp 400w, https://www.tosunai.com/wp-content/uploads/2022/09/Tosun-wechat-QRcode-12x12.webp 12w, https://www.tosunai.com/wp-content/uploads/2022/09/Tosun-wechat-QRcode-100x100.webp 100w" sizes="auto, (max-width: 400px) 100vw, 400px" /></figure>
</div>
<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.tosunai.com/a-solution-for-automated-flashing-and-real-time-process-status-display-based-on-tsmaster/">基于TSMaster的自动化刷写与流程状态实时显示方案</a> first appeared on <a rel="nofollow" href="https://www.tosunai.com">上海同星智能科技有限公司</a>.&lt;/p&gt;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.tosunai.com/a-solution-for-automated-flashing-and-real-time-process-status-display-based-on-tsmaster/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>软件更新 &#124; 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验</title>
		<link>https://www.tosunai.com/more-than-just-an-upgrade-tsmaster-november-edition-released/</link>
					<comments>https://www.tosunai.com/more-than-just-an-upgrade-tsmaster-november-edition-released/#respond</comments>
		
		<dc:creator><![CDATA[pan]]></dc:creator>
		<pubDate>Tue, 16 Dec 2025 04:28:58 +0000</pubDate>
				<category><![CDATA[软件更新]]></category>
		<category><![CDATA[C小程序]]></category>
		<category><![CDATA[MBD]]></category>
		<category><![CDATA[RBS]]></category>
		<category><![CDATA[RPC]]></category>
		<category><![CDATA[TSMaster]]></category>
		<category><![CDATA[TSMaster新功能]]></category>
		<category><![CDATA[其他]]></category>
		<category><![CDATA[小程序]]></category>
		<category><![CDATA[检测信号]]></category>
		<category><![CDATA[系统变量]]></category>
		<guid isPermaLink="false">https://www.tosunai.com/?p=22496</guid>

					<description><![CDATA[<p>TSMaster软件的每一次更新，都旨在让您的工程更高效、探索更自由。11月版本现已发布，本次更新聚焦于核心功 [&#8230;]</p>
<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.tosunai.com/more-than-just-an-upgrade-tsmaster-november-edition-released/">软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验</a> first appeared on <a rel="nofollow" href="https://www.tosunai.com">上海同星智能科技有限公司</a>.&lt;/p&gt;</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">TSMaster软件的每一次更新，都旨在让您的工程更高效、探索更自由。11月版本现已发布，本次更新聚焦于核心功能模块的深度优化与拓展，涵盖<strong>小程序易用性升级、API 更新、面板进阶、MBD功能升级、示例工程更新和新硬件支持</strong>等内容。这些升级将显著提升软件的性能、灵活性与用户体验，助您更高效地应对复杂开发与测试挑战。</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-style-default is-layout-flow wp-block-quote-is-layout-flow">
<h2 class="wp-block-heading has-black-color has-text-color has-link-color wp-elements-46" style="font-style:normal;font-weight:600"><strong>TSMaster 2025.11</strong></h2>
</blockquote>



<p class="wp-block-paragraph" style="font-size:1em"></p>



<h2 class="wp-block-heading has-text-color has-link-color wp-elements-47" style="color:#007bd1"><strong><strong><strong><strong><strong>小程序易用性升级</strong></strong></strong></strong></strong></h2>



<hr class="wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide"/>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="wp-block-paragraph">→【设计】-【C小程序】</p>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-48 wp-block-paragraph"><strong>【工具新增选项】</strong></p>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>更新功能：</strong></p>



<ul class="wp-block-list">
<li>系统变量直接读写访问选项，默认激活，自动生成系统变量直接访问代码</li>



<li>支持信号直接读写访问选项，默认激活，自动生成信号直接访问代码</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="687" height="462" src="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-1.webp" alt="technical articles 20251216 1 TSMaster 11月版" class="wp-image-22502" title="软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验 12" srcset="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-1.webp 687w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-1-18x12.webp 18w" sizes="auto, (max-width: 687px) 100vw, 687px" /></figure>
</div>


<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-49 wp-block-paragraph"><strong>【新增变量/信号直接访问】</strong></p>



<p class="wp-block-paragraph"><strong>更新内容：</strong></p>



<ul class="wp-block-list">
<li>新增数组类型系统变量直接访问</li>



<li>新增RBS信号直接访问</li>
</ul>



<p class="wp-block-paragraph">【数组类型系统变量】在 C 小程序中可直接使用 SYSVAR_ARRAY(xArr)[i] = val; 语法。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="868" height="517" src="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-2.webp" alt="technical articles 20251216 2 TSMaster 11月版" class="wp-image-22503" title="软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验 13" srcset="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-2.webp 868w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-2-768x457.webp 768w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-2-18x12.webp 18w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-2-800x476.webp 800w" sizes="auto, (max-width: 868px) 100vw, 868px" /></figure>
</div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="868" height="617" src="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-3.webp" alt="technical articles 20251216 3 TSMaster 11月版" class="wp-image-22504" title="软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验 14" srcset="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-3.webp 868w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-3-768x546.webp 768w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-3-18x12.webp 18w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-3-800x569.webp 800w" sizes="auto, (max-width: 868px) 100vw, 868px" /></figure>
</div>


<p class="wp-block-paragraph">【RBS信号】在 C 小程序中可直接对 RBS 信号赋值或读取，如：</p>



<p class="wp-block-paragraph">$(EngSpeed) = 125;</p>



<p class="wp-block-paragraph">$(0::CAN_FD_Powertrain::Engine::EngineData::EngSpeed) = 126;</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="868" height="351" src="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-4.webp" alt="technical articles 20251216 4 TSMaster 11月版" class="wp-image-22505" style="object-fit:cover" title="软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验 15" srcset="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-4.webp 868w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-4-768x311.webp 768w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-4-18x7.webp 18w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-4-800x324.webp 800w" sizes="auto, (max-width: 868px) 100vw, 868px" /></figure>
</div>


<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-text-color has-link-color wp-elements-50" style="color:#007bd1"><strong><strong>API更新</strong></strong></h2>



<hr class="wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide"/>



<p class="wp-block-paragraph">→【设计】-【小程序】</p>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-51 wp-block-paragraph"><strong>【 RBS读写API 】</strong></p>



<pre class="wp-block-code"><code>rbs_set_signal_value_by_address</code></pre>



<p class="wp-block-paragraph">函数说明：使用其符号地址设置RBS信号的值。这是一个协议无关的功能，它自动检测总线类型并将请求路由到适当的特定于总线的RBS处理程序。</p>



<pre class="wp-block-code"><code>rbs_get_signal_value_by_address</code></pre>



<p class="wp-block-paragraph">函数说明：使用其符号地址检索RBS信号的当前值。这是一个协议无关的功能，它自动从符号地址检测总线类型，并将请求路由到适当的特定于总线的RBS处理程序（CAN、LIN或FlexRay）。</p>



<p class="wp-block-paragraph"></p>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-52 wp-block-paragraph"><strong>【 <strong>数组类型系统变量元素API</strong>】</strong></p>



<pre class="wp-block-code"><code>get_system_var_double_array_element</code></pre>



<p class="wp-block-paragraph">函数说明：从指定索引位置的系统变量数组中检索单个Double元素；</p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-code"><code>get_system_var_int32_array_element</code></pre>



<p class="wp-block-paragraph">函数说明：从指定索引位置的系统变量数组中检索单个Int32元素；</p>



<p class="wp-block-paragraph"></p>



<pre class="wp-block-code"><code>get_system_var_int64_array_element</code></pre>



<p class="wp-block-paragraph">函数说明：从指定索引位置的系统变量数组中检索单个Int64元素；</p>



<pre class="wp-block-code"><code>get_system_var_uint8_array_element</code></pre>



<p class="wp-block-paragraph">函数说明：从指定索引位置的系统变量数组中检索单个UInt8元素；</p>



<pre class="wp-block-code"><code>set_system_var_double_array_element</code></pre>



<p class="wp-block-paragraph">函数说明：在指定的索引位置设置系统变量数组中的单个Double元素。该操作为同步操作；</p>



<pre class="wp-block-code"><code> set_system_var_int32_array_element</code></pre>



<p class="wp-block-paragraph">函数说明：在指定的索引位置设置系统变量数组中的单个Int32元素。该操作为同步操作；</p>



<pre class="wp-block-code"><code>set_system_var_int64_array_element</code></pre>



<p class="wp-block-paragraph">函数说明：在指定的索引位置设置系统变量数组中的单个Int64元素。该操作为同步操作；</p>



<pre class="wp-block-code"><code>set_system_var_uint8_array_element</code></pre>



<p class="wp-block-paragraph">函数说明：在指定的索引位置设置系统变量数组中单个UInt8元素。该操作是同步的，并立即更新数组元素。</p>



<p class="wp-block-paragraph"></p>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-53 wp-block-paragraph"><strong>【&nbsp;<strong><strong>CAN 周期统计 API</strong></strong>&nbsp;】</strong></p>



<pre class="wp-block-code"><code>metric_register_can_frame_interval</code></pre>



<p class="wp-block-paragraph">函数说明：在指定通道注册CAN帧；在使用周期统计API时，必须先注册，否则采样列表为空；</p>



<pre class="wp-block-code"><code>metric_start</code></pre>



<p class="wp-block-paragraph">函数说明：将统计状态机置为 RUNNING，开始对所有已注册通道的接收帧记录时间戳并累积间隔数据；</p>



<pre class="wp-block-code"><code>metric_is_running</code></pre>



<p class="wp-block-paragraph">函数说明：返回全局运行状态，确认已处于 RUNNING状态后再读数据，在metric_start函数后使用；</p>



<pre class="wp-block-code"><code>metric_get_can_frame_interval_stat</code></pre>



<p class="wp-block-paragraph">函数说明：仅读取当前已累积的 CAN 周期统计信息（最小值、最大值、当前值、平均值、标准差等）；如需清零则使用下一条函数；</p>



<pre class="wp-block-code"><code>metric_get_w_reset_can_frame_interval_stat</code></pre>



<p class="wp-block-paragraph">函数说明：在返回CAN 周期统计信息的同时，清零其统计数据；</p>



<pre class="wp-block-code"><code>metric_stop</code></pre>



<p class="wp-block-paragraph">函数说明：将状态机切换至 STOPPED，停止采样与时间戳记录，后续仍可再start继续累计；</p>



<pre class="wp-block-code"><code>metric_reset_can_frame_interval_stat</code></pre>



<p class="wp-block-paragraph">函数说明：对指定通道的CAN帧统计执行清零操作，在stop状态或运行状态均可调用；</p>



<pre class="wp-block-code"><code>metric_reset_frames_interval_stat_of_channel</code></pre>



<p class="wp-block-paragraph">函数说明：按总线和通道清零，仅清除指定总线与逻辑通道的统计数据，该函数的粒度比上条函数更细；</p>



<pre class="wp-block-code"><code>metric_reset_frames_interval_stat_of_bus</code></pre>



<p class="wp-block-paragraph">函数说明：按总线清零，仅清除指定总线类型的统计数据；</p>



<pre class="wp-block-code"><code>metric_reset_frames_interval_stat_of_all</code></pre>



<p class="wp-block-paragraph">函数说明：清零所有的周期统计，可用于测试用例的复位；</p>



<pre class="wp-block-code"><code>metric_unregister_can_frame_interval</code></pre>



<p class="wp-block-paragraph">函数说明：最后调用该函数，将指定通道的CAN帧从统计系统移除，释放关联资源，同时丢弃该通道的统计数据，此后对应的句柄无效。</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-text-color has-link-color wp-elements-54" style="color:#007bd1"><strong><strong><strong>面板功能进阶</strong></strong></strong></h2>



<hr class="wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide"/>



<p class="wp-block-paragraph">→【仿真】-【面板】</p>



<p class="wp-block-paragraph"><strong>更新内容：</strong><br>Page Control 新增删除单页功能：可在设计界面直接删除选中标签页。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="665" height="422" src="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-5.webp" alt="technical articles 20251216 5 TSMaster 11月版" class="wp-image-22506" style="object-fit:cover" title="软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验 16" srcset="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-5.webp 665w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-5-18x12.webp 18w" sizes="auto, (max-width: 665px) 100vw, 665px" /></figure>
</div>


<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-text-color has-link-color wp-elements-55" style="color:#007bd1"><strong><strong><strong>MBD模块升级</strong></strong></strong></h2>



<hr class="wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide"/>



<p class="wp-block-paragraph"><strong>更新内容：</strong><br>在MBD框图中突出显示源/目的地。</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="638" height="403" src="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-6.webp" alt="technical articles 20251216 6 TSMaster 11月版" class="wp-image-22507" style="object-fit:cover" title="软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验 17" srcset="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-6.webp 638w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-6-18x12.webp 18w" sizes="auto, (max-width: 638px) 100vw, 638px" /></figure>
</div>


<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-text-color has-link-color wp-elements-56" style="color:#007bd1"><strong><strong><strong><strong>示例工程更新</strong></strong></strong></strong></h2>



<hr class="wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide"/>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-57 wp-block-paragraph"><strong><strong>【信号测试器高级示例】</strong></strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1080" height="716" src="https://www.tosunai.com/wp-content/uploads/2025/11/technical-articles-202501103-13.webp" alt="technical articles 202501103 13 TSMaster 11月版" class="wp-image-21755" style="object-fit:cover" title="软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验 18" srcset="https://www.tosunai.com/wp-content/uploads/2025/11/technical-articles-202501103-13.webp 1080w, https://www.tosunai.com/wp-content/uploads/2025/11/technical-articles-202501103-13-768x509.webp 768w, https://www.tosunai.com/wp-content/uploads/2025/11/technical-articles-202501103-13-18x12.webp 18w, https://www.tosunai.com/wp-content/uploads/2025/11/technical-articles-202501103-13-800x530.webp 800w" sizes="auto, (max-width: 1080px) 100vw, 1080px" /></figure>
</div>


<p class="wp-block-paragraph"></p>



<p class="has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-58 wp-block-paragraph"><strong>【联合仿真RPC服务器实现】</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1080" height="558" src="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-7.webp" alt="technical articles 20251216 7 TSMaster 11月版" class="wp-image-22508" style="object-fit:cover" title="软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验 19" srcset="https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-7.webp 1080w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-7-768x397.webp 768w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-7-18x9.webp 18w, https://www.tosunai.com/wp-content/uploads/2025/12/technical-articles-20251216-7-800x413.webp 800w" sizes="auto, (max-width: 1080px) 100vw, 1080px" /></figure>
</div>


<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading has-text-color has-link-color wp-elements-59" style="color:#007bd1"><strong><strong><strong><strong>新硬件支持</strong></strong></strong></strong></h2>



<hr class="wp-block-separator has-text-color has-cyan-bluish-gray-color has-alpha-channel-opacity has-cyan-bluish-gray-background-color has-background is-style-wide"/>



<p class="wp-block-paragraph">→【硬件】-【通道选择】</p>



<p class="wp-block-paragraph"><strong>更新内容：</strong><br>新设备TC1052、TTS1017Pro已加入支持列表。</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-style-default is-layout-flow wp-block-quote-is-layout-flow">
<h3 class="wp-block-heading has-black-color has-text-color has-link-color wp-elements-60" style="font-style:normal;font-weight:600"><strong>欢迎下载体验TSMaster 2025最新版本</strong></h3>
</blockquote>



<div class="wp-block-group box-margin has-background is-vertical is-content-justification-stretch is-layout-flex wp-container-core-group-is-layout-977340ba wp-block-group-is-layout-flex" style="background-color:#f9f9f9">
<h2 class="wp-block-heading has-text-align-center has-vivid-cyan-blue-color has-text-color has-link-color wp-elements-61"><strong>TSMaster 技术交流群</strong></h2>



<p class="has-text-align-center wp-block-paragraph"></p>



<p class="has-text-align-center wp-block-paragraph">如您有关于TSMaster软件使用问题需要技术支持，欢迎扫码添加<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-cyan-blue-color">TOSUN同星技术客服</mark></strong>企微直接联系和咨询：</p>



<p class="has-text-align-center wp-block-paragraph"><img loading="lazy" decoding="async" width="150" height="150" class="wp-image-12425" style="width: 150px;" src="https://www.tosunai.com/wp-content/uploads/2024/08/technical-articles-20240820-6.webp" alt="同星技术支持 QRcode" title="软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验 20" srcset="https://www.tosunai.com/wp-content/uploads/2024/08/technical-articles-20240820-6.webp 463w, https://www.tosunai.com/wp-content/uploads/2024/08/technical-articles-20240820-6-300x300.webp 300w, https://www.tosunai.com/wp-content/uploads/2024/08/technical-articles-20240820-6-150x150.webp 150w, https://www.tosunai.com/wp-content/uploads/2024/08/technical-articles-20240820-6-12x12.webp 12w, https://www.tosunai.com/wp-content/uploads/2024/08/technical-articles-20240820-6-100x100.webp 100w" sizes="auto, (max-width: 150px) 100vw, 150px" /></p>
</div>



<div class="wp-block-columns are-vertically-aligned-top has-background is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex" style="background-color:#f9f9f9">
<div class="wp-block-column is-vertically-aligned-top is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<p class="wp-block-paragraph"><strong>小贴士：</strong></p>



<ol class="wp-block-list">
<li>软件下载：<br>点击下方软件下载链接，直接下载安装，建议下载 beta 版本<br></li>



<li>软件升级：<br>在电脑有互联网连接的前提下，可以在软件内检查升级至最新版本。</li>
</ol>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph"><strong>注：同星智能技术支持邮箱：<a title="" href="mailto:support@tosunai.cn">support@tosunai.cn</a>，欢迎大家前来咨询！（须注明公司及联系方式）</strong></p>



<div class="wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-fe48e5de wp-block-buttons-is-layout-flex">
<div class="wp-block-button"><a class="wp-block-button__link has-vivid-cyan-blue-background-color has-background wp-element-button" href="https://www.tosunai.com/downloads/">下载 TSMaster</a></div>
</div>
</div></div>
</div>
</div>



<p class="wp-block-paragraph"></p>
<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.tosunai.com/more-than-just-an-upgrade-tsmaster-november-edition-released/">软件更新 | 不止于升级！TSMaster 11月版发布，解锁六大核心功能新体验</a> first appeared on <a rel="nofollow" href="https://www.tosunai.com">上海同星智能科技有限公司</a>.&lt;/p&gt;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.tosunai.com/more-than-just-an-upgrade-tsmaster-november-edition-released/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>干货分享 &#124; TSMaster RPC 基础入门：编程指导和使用说明</title>
		<link>https://www.tosunai.com/tsmaster-rpc-programming-guide-and-instructions/</link>
					<comments>https://www.tosunai.com/tsmaster-rpc-programming-guide-and-instructions/#respond</comments>
		
		<dc:creator><![CDATA[pan]]></dc:creator>
		<pubDate>Wed, 17 Jul 2024 05:29:52 +0000</pubDate>
				<category><![CDATA[软件操作教程]]></category>
		<category><![CDATA[RPC]]></category>
		<category><![CDATA[TSMaster使用教程]]></category>
		<category><![CDATA[其他]]></category>
		<category><![CDATA[系统变量]]></category>
		<guid isPermaLink="false">https://www.tosunai.com/?p=11643</guid>

					<description><![CDATA[<p>介绍RPC模块前，我们先浅聊一下RPC的相关说明，以及在什么样的情况下需要了解本文 。 RPC 说明远程过程调 [&#8230;]</p>
<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.tosunai.com/tsmaster-rpc-programming-guide-and-instructions/">干货分享 | TSMaster RPC 基础入门：编程指导和使用说明</a> first appeared on <a rel="nofollow" href="https://www.tosunai.com">上海同星智能科技有限公司</a>.&lt;/p&gt;</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="11643" class="elementor elementor-11643" data-elementor-post-type="post">
				<div class="elementor-element elementor-element-a1c6786 e-flex e-con-boxed e-con e-parent" data-id="a1c6786" data-element_type="container" data-e-type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-0714c95 e-con-full e-flex e-con e-child" data-id="0714c95" data-element_type="container" data-e-type="container">
				<div class="elementor-element elementor-element-10a20b6 elementor-widget elementor-widget-text-editor" data-id="10a20b6" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>介绍RPC模块前，我们先浅聊一下RPC的相关说明，以及在什么样的情况下需要了解本文 。</p><section><section><section><section><ol><li><strong>RPC 说明<br /></strong>远程过程调用（RPC, Remote Procedure Call）是一种网络通信协议，使得程序可以调用另一台计算机上的程序或服务，就像调用本地的程序一样。RPC 的主要目的是简化分布式计算，使得开发者无需关注底层的网络通信细节。<br /><br /></li><li><strong>什么情况下需要了解此文章？<br /></strong>用户基于 TSMaster 开发了对应的应用工程，想在外部程序中自动化控制TSMaster，可以查阅此文章。<span style="color: #ff0000;">（备注：除了 RPC，TSMaster还提供了基于COM的接口，有需求可另行查阅相关文章。）</span><br /><br />本文适用程控模式：TSMaster1 控制 TSMaster2，或者其他进程控制 TSMaster 进程（使用 TSMaster.dll）适用于语言:C++ 、Python、 C#等语言。</li></ol></section></section></section></section>								</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-4e071bd e-flex e-con-boxed e-con e-parent" data-id="4e071bd" data-element_type="container" data-e-type="container" data-settings="{&quot;background_background&quot;:&quot;classic&quot;}">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-f7f2601 e-con-full e-flex e-con e-child" data-id="f7f2601" data-element_type="container" data-e-type="container">
				<div class="elementor-element elementor-element-0d1e6d6 elementor-widget elementor-widget-heading" data-id="0d1e6d6" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h6 class="elementor-heading-title elementor-size-default">本文目录</h6>				</div>
				</div>
				<div class="elementor-element elementor-element-3b43478 elementor-widget elementor-widget-table-of-contents" data-id="3b43478" data-element_type="widget" data-e-type="widget" data-settings="{&quot;headings_by_tags&quot;:[&quot;h2&quot;,&quot;h3&quot;,&quot;h4&quot;],&quot;exclude_headings_by_selector&quot;:&quot;.Mainfooter&quot;,&quot;marker_view&quot;:&quot;bullets&quot;,&quot;icon&quot;:{&quot;value&quot;:&quot;&quot;,&quot;library&quot;:&quot;&quot;},&quot;no_headings_message&quot;:&quot;No headings were found on this page.&quot;,&quot;hierarchical_view&quot;:&quot;yes&quot;,&quot;min_height&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;min_height_widescreen&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;min_height_laptop&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;min_height_tablet_extra&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;min_height_tablet&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;min_height_mobile_extra&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]},&quot;min_height_mobile&quot;:{&quot;unit&quot;:&quot;px&quot;,&quot;size&quot;:&quot;&quot;,&quot;sizes&quot;:[]}}" data-widget_type="table-of-contents.default">
				<div class="elementor-widget-container">
									<div id="elementor-toc__3b43478" class="elementor-toc__body">
			<div class="elementor-toc__spinner-container">
				<svg class="elementor-toc__spinner eicon-animation-spin e-font-icon-svg e-eicon-loading" aria-hidden="true" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg"><path d="M500 975V858C696 858 858 696 858 500S696 142 500 142 142 304 142 500H25C25 237 238 25 500 25S975 237 975 500 763 975 500 975Z"></path></svg>			</div>
		</div>
						</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-04d9166 e-flex e-con-boxed e-con e-parent" data-id="04d9166" data-element_type="container" data-e-type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-1427f65 e-con-full e-flex e-con e-child" data-id="1427f65" data-element_type="container" data-e-type="container">
				<div class="elementor-element elementor-element-b9289b5 headingTitleH2 elementor-widget elementor-widget-heading" data-id="b9289b5" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">01 | RPC的基本概念</h2>				</div>
				</div>
				<div class="elementor-element elementor-element-ddf608e elementor-widget elementor-widget-text-editor" data-id="ddf608e" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p><strong>客户端和服务器：</strong></p><p>客户端：发起 RPC 请求的程序。</p><p>服务器：接收 RPC 请求并执行相应过程的程序。</p><p> </p><p><strong>代理:</strong></p><p>客户端代理：封装请求并将其发送到服务器。</p><p>服务器代理：接收请求，解包并调用本地过程，之后将结果返回给客户端代理。</p><p> </p><p><strong>通信机制:</strong></p><p>传输协议：底层使用的协议，比如 TCP、UDP。</p><p>数据序列化：将数据结构或对象转换成可以传输的格式，比如 JSON、XML、Protocol Buffers。</p><p> </p><p><strong>RPC 工作流程:</strong></p><ul><li>客户端调用本地代理方法：客户端调用一个看似本地的方法，但实际上这个方法由客户端代理负责处理；</li><li>客户端代理序列化请求：将方法名、参数等信息打包成消息；</li><li>消息传输：客户端代理将消息通过网络传输到服务器；</li><li>服务器代理解包请求：接收到消息后，服务器代理解包消息并调用实际的本地方法；</li><li>执行方法并生成响应：本地方法执行完毕后，生成响应结果；</li><li>服务器代理打包响应：服务器代理将结果打包成消息并通过网络发送回客户端；</li><li>客户端代理解包响应：客户端代理接收到响应消息后，解包并将结果返回给客户端。</li></ul>								</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-51bc960 e-flex e-con-boxed e-con e-parent" data-id="51bc960" data-element_type="container" data-e-type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-380e139 e-con-full e-flex e-con e-child" data-id="380e139" data-element_type="container" data-e-type="container">
				<div class="elementor-element elementor-element-127410f headingTitleH2 elementor-widget elementor-widget-heading" data-id="127410f" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">02、TSMaster RPC 应用

</h2>				</div>
				</div>
				<div class="elementor-element elementor-element-48bb52c elementor-widget elementor-widget-text-editor" data-id="48bb52c" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<h3>1｜RPC 功能</h3><p>基于 TSMaster 的 RPC 机制，用户可以在 TSMaster 上位机环境中搭建完整的工程，涵盖从测试用例开发到程控设备管理、总线通讯配置以及控制板卡操作等一系列流程。通过这一机制，用户能够高效地在客户端远程控制 TSMaster 服务器，<strong><span style="color: #3366ff;">实现对系统变量、CAN 信号、LIN 信号、FlexRay 信号以及以太网（ETH）信号等的读写操作。此外，用户还可以调用 TSMaster 服务器上定义的各种函数</span></strong>，进一步扩展和定制系统功能。</p><p> </p><p>这种集成化的解决方案使得工程管理和自动化测试更加便捷和高效。用户无需在多个平台之间切换，即可完成包括硬件配置、信号监控、数据采集和测试执行等复杂任务。通过TSMaster 的 RPC 机制，用户在客户端即可实现对服务器的远程程控，简化了操作流程，提高了测试和开发效率，确保了系统的稳定性和可靠性。</p><p><br />TSMaster 提供了强大的接口和丰富的功能模块，用户可以根据需求灵活组合使用，实现对各种信号和设备的精细控制和管理。这种架构不仅适用于研发测试阶段，也适用于生产环境中的实时监控和故障诊断，极大提升了工程项目的整体质量和效率。</p><p> </p><p>不仅如此，TSMaster 的 RPC 机制支持多种拓扑结构，不仅可以实现客户端与服务器之间的一对一通信，还能够实现以下复杂的通信拓扑：</p><p> </p><ol><li><strong><span style="color: #3366ff;">一对多 (One-to-Many)：</span></strong>单个客户端可以同时控制多个 TSMaster 服务器，适用于需要同时管理多个测试环境或设备的情况。</li><li><span style="color: #3366ff;"><strong>多对一 (Many-to-One)：</strong></span>多个客户端可以同时连接到一个 TSMaster 服务器，这样不同的用户或测试系统可以共享同一个服务器资源，实现协同工作和资源共享。</li><li><span style="color: #3366ff;"><strong>多对多 (Many-to-Many)：</strong></span>多个客户端和多个服务器之间可以进行灵活的通信和控制，构建复杂的分布式测试和控制系统，适用于大型工程项目和分布式测试环境。</li></ol>								</div>
				</div>
				<div class="elementor-element elementor-element-b3bd31d elementor-widget elementor-widget-image" data-id="b3bd31d" data-element_type="widget" data-e-type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
															<img loading="lazy" decoding="async" width="1024" height="294" src="https://www.tosunai.com/wp-content/uploads/2024/07/technical-articles-20240717-1-1024x294.webp" class="attachment-large size-large wp-image-11645" alt="TSMaster 的 RPC 机制：一对多 (One-to-Many)、多对一 (Many-to-One)、多对多 (Many-to-Many)" srcset="https://www.tosunai.com/wp-content/uploads/2024/07/technical-articles-20240717-1-1024x294.webp 1024w, https://www.tosunai.com/wp-content/uploads/2024/07/technical-articles-20240717-1-300x86.webp 300w, https://www.tosunai.com/wp-content/uploads/2024/07/technical-articles-20240717-1-768x220.webp 768w, https://www.tosunai.com/wp-content/uploads/2024/07/technical-articles-20240717-1-18x5.webp 18w, https://www.tosunai.com/wp-content/uploads/2024/07/technical-articles-20240717-1-800x230.webp 800w, https://www.tosunai.com/wp-content/uploads/2024/07/technical-articles-20240717-1.webp 1080w" sizes="auto, (max-width: 1024px) 100vw, 1024px" title="干货分享 | TSMaster RPC 基础入门：编程指导和使用说明 22">															</div>
				</div>
				<div class="elementor-element elementor-element-ac5c8ca elementor-widget elementor-widget-text-editor" data-id="ac5c8ca" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p>这种灵活的拓扑结构使得 TSMaster 能够适应各种复杂的工程需求，无论是在单一项目中还是在跨项目、跨地域的分布式测试中，都能提供高效、可靠的解决方案。通过这种多样化的通信模式，用户可以最大限度地利用硬件和软件资源，提高系统的扩展性和灵活性，满足不同规模和复杂度的工程项目需求。</p>								</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-2de1d56 e-flex e-con-boxed e-con e-parent" data-id="2de1d56" data-element_type="container" data-e-type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-618720f e-con-full e-flex e-con e-child" data-id="618720f" data-element_type="container" data-e-type="container">
				<div class="elementor-element elementor-element-cf12770 headingTitleH2 elementor-widget elementor-widget-heading" data-id="cf12770" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">03、TSMaster RPC 使用说明</h2>				</div>
				</div>
				<div class="elementor-element elementor-element-b59cf63 elementor-widget elementor-widget-text-editor" data-id="b59cf63" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									基于RPC本身机制，TSMaster提供了相应接口，在需要被程控的工程中，激活RPC server端，为程控脚本提供相应资源。

								</div>
				</div>
				<div class="elementor-element elementor-element-65fd41e elementor-widget elementor-widget-text-editor" data-id="65fd41e" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<h3>1｜激活 server</h3><p>开启server端操作如下：</p><p> </p><p>新建一个C脚本，在启动事件中输入下面代码，即表示激活了当前工程的rpc server rpc_tsmaster_activate_server(true);</p><p>实际上，在 TSMaster v2024.06.05.1124 版本之后，所有TSMaster工程已经默认激活了RPC功能。</p><p> </p><h3>2｜活 client</h3><p>native_int h; //client 句柄</p><p>//参数 1 为提供 rpc 服务的 TSMaster 应用程序名</p><p>com.rpc_tsmaster_create_client(“TSMaster”,&amp;h);</p><p>//激活 client 端</p><p>Com.rpc_tsmaster_activate_client(h,true);</p><p> </p><h3>3｜修改 server 端数据</h3><p><span style="text-decoration: underline;"><strong>3.1 启动停止 server 工程</strong></span></p><p>启动工程：</p><p style="padding-left: 40px;">TSMaster 小程序：</p><p><span style="color: #3366ff;">com.rpc_tsmaster_cmd_start_simulation(h);</span></p><p style="padding-left: 40px;">API(C\C++\C#\Python):</p><p><span style="color: #3366ff;">rpc_tsmaster_cmd_start_simulation(h);</span></p><p> </p><p> </p><p><span style="text-decoration: underline;"><strong>3.2 读写系统变量</strong></span></p><p>设置系统变量：</p><p style="padding-left: 40px;">TSMaster 小程序：</p><p><span style="color: #3366ff;">com.rpc_tsmaster_cmd_write_system_var(h, &#8220;Var1&#8221;, &#8220;1.2345&#8221;);</span></p><p style="padding-left: 40px;">API(C\C++\C#\Python):</p><p><span style="color: #3366ff;">rpc_tsmaster_cmd_write_system_var(h,&#8221;Var1&#8243;,&#8221;1.2345&#8243;);</span></p><p> </p><p>获取系统变量：</p><p style="padding-left: 40px;">TSMaster 小程序：</p><p><span style="color: #3366ff;">com.rpc_tsmaster_cmd_read_system_var(h, &#8220;Var1&#8221;, &#8220;1.2345&#8221;);</span></p><p style="padding-left: 40px;">API(C\C++\C#\Python):</p><p><span style="color: #3366ff;">rpc_tsmaster_cmd_read_system_var(h,&#8221;Var1&#8243;,&#8221;1.2345&#8243;);</span></p><p> </p><p> </p><p><strong><span style="text-decoration: underline;">3.3 读写 CAN 信号</span></strong></p><p>设置 CAN 信号：</p><p style="padding-left: 40px;">TSMaster 小程序：</p><p><span style="color: #3366ff;">com.rpc_tsmaster_cmd_set_can_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, 1234)</span></p><p style="padding-left: 40px;">API(C\C++\C#\Python):</p><p><span style="color: #3366ff;">rpc_tsmaster_cmd_set_can_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, 1234)</span></p><p> </p><p>获取 CAN 信号：</p><p style="padding-left: 40px;">double d = 0;</p><p style="padding-left: 40px;">TSMaster 小程序：</p><p><span style="color: #3366ff;">com.rpc_tsmaster_cmd_get_can_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, %d)</span></p><p style="padding-left: 40px;">API(C\C++\C#\Python):</p><p><span style="color: #3366ff;">rpc_tsmaster_cmd_get_can_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, %d)</span></p><p> </p><p> </p><p><span style="text-decoration: underline;"><strong>3.4 读写 LIN 信号</strong></span></p><p>设置 LIN 信号：</p><p style="padding-left: 40px;">TSMaster 小程序：</p><p><span style="color: #3366ff;">com.rpc_tsmaster_cmd_set_lin_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, 1234);</span></p><p style="padding-left: 40px;">API(C\C++\C#\Python):</p><p><span style="color: #3366ff;">rpc_tsmaster_cmd_set_lin_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, 1234);</span></p><p> </p><p>获取 LIN 信号：</p><p style="padding-left: 40px;">double d = 0;</p><p style="padding-left: 40px;">TSMaster 小程序：</p><p><span style="color: #3366ff;">com.rpc_tsmaster_cmd_get_lin_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, %d);</span></p><p style="padding-left: 40px;">API(C\C++\C#\Python):</p><p><span style="color: #3366ff;">rpc_tsmaster_cmd_get_lin_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, %d);</span></p><p> </p><p> </p><p><span style="text-decoration: underline;"><strong>3.5 读写 FlexRay 信号</strong></span></p><p>设置 FR 信号：</p><p style="padding-left: 40px;">TSMaster 小程序：</p><p><span style="color: #3366ff;">com.rpc_tsmaster_cmd_set_flexray_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, 1234);</span></p><p style="padding-left: 40px;">API(C\C++\C#\Python):</p><p><span style="color: #3366ff;">rpc_tsmaster_cmd_set_flexray_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, 1234);</span></p><p> </p><p>获取 FR 信号：</p><p style="padding-left: 40px;">double d = 0;</p><p style="padding-left: 40px;">TSMaster 小程序：</p><p><span style="color: #3366ff;">com.rpc_tsmaster_cmd_get_can_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, %d);</span></p><p style="padding-left: 40px;">API(C\C++\C#\Python):</p><p><span style="color: #3366ff;">rpc_tsmaster_cmd_get_can_signal(h,&#8221;chnidx/net/node/msg/signal&#8221;, %d)</span></p><p> </p><p> </p><p><span style="text-decoration: underline;"><strong>3.6 RPC 使用 TSMaster 系统函数</strong></span></p><p> </p><p><span style="color: #3366ff;">// 第一步：准备调用函数的输入参数</span></p><p><span style="color: #3366ff;">#define STR_BUFFER_SIZE 1024</span></p><p><span style="color: #3366ff;">char args[4][STR_BUFFER_SIZE];</span></p><p><span style="color: #3366ff;">char* pArgs[4] = {&amp;args[0][0], &amp;args[1][0], &amp;args[2][0], &amp;args[3][0]};</span></p><p><span style="color: #3366ff;">sprintf_s(pArgs[0], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;var1&#8221;);</span></p><p><span style="color: #3366ff;">sprintf_s(pArgs[1], STR_BUFFER_SIZE, &#8220;%d&#8221;, svtString);</span></p><p><span style="color: #3366ff;">sprintf_s(pArgs[2], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;string default value&#8221;);</span></p><p><span style="color: #3366ff;">sprintf_s(pArgs[3], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;this is a comment&#8221;);</span></p><p> </p><p><span style="color: #3366ff;">// 步骤 2：调用任意 API</span></p><p><span style="color: #3366ff;">s32 ret;</span></p><p><span style="color: #3366ff;">ret = com.rpc_tsmaster_call_system_api(h, &#8220;app.create_system_var&#8221;, 4, STR_BUFFER_SIZE,</span></p><p><span style="color: #3366ff;">&amp;pArgs[0]);</span></p><p> </p><p><span style="color: #3366ff;">// 步骤 3：处理参数中的返回值（如果可用）</span></p><p><span style="color: #3366ff;">s32 i;</span></p><p><span style="color: #3366ff;">log(&#8220;API call result = %d&#8221;, ret);</span></p><p><span style="color: #3366ff;">for (i=0; i&lt;4; i++){</span></p><p><span style="color: #3366ff;">log(&#8220;Argument %d: %s&#8221;, i+1, pArgs[i]);</span></p><p><span style="color: #3366ff;">}</span></p><p> </p><p>上述代码等价与在 TSMaster 进程中使用 app.create_system_var 来创建系统变量，即：app.create_system_var(var1,svtString,”string default value”,”this is a comment”);</p><p> </p><p><span style="color: #ff0000;">需要注意的是，使用该方式调用 TSMaster 内的系统函数，无法使用参数为指针类型(报文类型除外)的函数。</span></p><p> </p><p> </p><p><span style="text-decoration: underline;"><strong>3.7 RPC 使用小程序库函数</strong></span></p><p> </p><p><span style="color: #3366ff;">// 第一步：准备调用函数的输入参数</span></p><p><span style="color: #3366ff;">#define STR_BUFFER_SIZE 1024</span></p><p><span style="color: #3366ff;">char args[4][STR_BUFFER_SIZE];</span></p><p><span style="color: #3366ff;">char* pArgs[4] = {&amp;args[0][0], &amp;args[1][0], &amp;args[2][0], &amp;args[3][0]};</span></p><p><span style="color: #3366ff;">sprintf_s(pArgs[0], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;var1&#8221;);</span></p><p><span style="color: #3366ff;">sprintf_s(pArgs[1], STR_BUFFER_SIZE, &#8220;%d&#8221;, svtString);</span></p><p><span style="color: #3366ff;">sprintf_s(pArgs[2], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;string default value&#8221;);</span></p><p><span style="color: #3366ff;">sprintf_s(pArgs[3], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;this is a comment&#8221;);</span></p><p> </p><p><span style="color: #3366ff;">//步骤 2：调用任意 API</span></p><p><span style="color: #3366ff;">s32 ret;TSMaster RPC 编程指导</span></p><p><span style="color: #3366ff;">ret = com.rpc_tsmaster_call_library_api(h, &#8220;mylib.create_system_var&#8221;, 4, STR_BUFFER_SIZE,</span></p><p><span style="color: #3366ff;">&amp;pArgs[0]);</span></p><p> </p><p><span style="color: #3366ff;">// 步骤 3：处理参数中的返回值（如果可用）</span></p><p><span style="color: #3366ff;">s32 i;</span></p><p><span style="color: #3366ff;">log(&#8220;API call result = %d&#8221;, ret);</span></p><p><span style="color: #3366ff;">for (i=0; i&lt;4; i++){</span></p><p><span style="color: #3366ff;">log(&#8220;Argument %d: %s&#8221;, i+1, pArgs[i]);</span></p><p><span style="color: #3366ff;">}</span></p>								</div>
				</div>
				</div>
					</div>
				</div>
		<div class="elementor-element elementor-element-e32fcb4 e-flex e-con-boxed e-con e-parent" data-id="e32fcb4" data-element_type="container" data-e-type="container">
					<div class="e-con-inner">
		<div class="elementor-element elementor-element-71053e6 e-con-full e-flex e-con e-child" data-id="71053e6" data-element_type="container" data-e-type="container">
				<div class="elementor-element elementor-element-7bfd9dd headingTitleH2 elementor-widget elementor-widget-heading" data-id="7bfd9dd" data-element_type="widget" data-e-type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
					<h2 class="elementor-heading-title elementor-size-default">04、TSMaster RPC 函数说明

</h2>				</div>
				</div>
				<div class="elementor-element elementor-element-1917d22 elementor-widget elementor-widget-text-editor" data-id="1917d22" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									基于RPC本身机制，TSMaster提供了相应接口，在需要被程控的工程中，激活RPC server端，为程控脚本提供相应资源。

								</div>
				</div>
				<div class="elementor-element elementor-element-600bf00 elementor-widget elementor-widget-text-editor" data-id="600bf00" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<h3>1｜rpc_tsmaster_create_client</h3><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><strong>函数名称</strong></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section>UInt32 rpc_tsmaster_create_client(const char* ATSMasterAppName,const psize_t AHandle)</section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><strong>功能介绍</strong></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section>创建一个 TSMaster Rpc 客户端</section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><strong>调用位置</strong></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section>初始化 tsmaster lib 库之后</section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><strong>输入参数</strong></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section>ATSMasterAppName: TSMaster server 端的应用程序名称;AHandle : TSMaster Rpc 客户端句柄</section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><strong>返回值</strong></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section>==0: 函数执行成功其他值：函数执行失败</section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><strong>示例</strong></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section>s32 h;rpc_tsmaster_create_client(&#8220;TSMaster1&#8221;, &amp;h)</section></section></td></tr></tbody></table><h3>2｜rpc_tsmaster_activate_client</h3><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_activate_client(const size_t AHandle,const bool AActivate)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>激活或者停用一个 TSMaster Rpc 客户端</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>AActivate: true=激活，false=停用</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>rpc_tsmaster_activate_client(h, true)</p></section></section></td></tr></tbody></table></section></section></section><h3>3｜rpc_tsmaster_is_simulation_running</h3><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_is_simulation_running(const size_t AHandle,const pbool AIsRunning)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>获取远程 TSMaster 仿真运行的状态</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>AIsRunning：远程 TSMaster 仿真运行的状态的数据指针</p><p>True=正在运行，false=未运行</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>bool b;</p><p>if (0 == com.rpc_tsmaster_is_simulation_running(h, &amp;b)){</p><p>if (b){</p><p>// current simulation is running</p><p>}</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><p> </p><section><section><section><section><h3><em><strong>4</strong></em>｜<strong>rpc_tsmaster_cmd_set_mode_realtime</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_set_mode_realtime(const size_t AHandle)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>将 TSMaster Rpc server 配置为实时模式</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后，仿真运行之前</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>rpc_tsmaster_cmd_set_mode_realtime(h)</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>5</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_set_mode_sim</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_set_mode_sim(const size_t AHandle)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>将 TSMaster Rpc server 配置为仿真模式</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后，仿真运行之前</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>rpc_tsmaster_cmd_set_mode_sim(h)</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><p> </p><h3><em><strong>6</strong></em>｜<strong>rpc_tsmaster_cmd_start_simulation</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_start_simulation(const size_t AHandle)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>启动 TSMaster Rpc server 仿真</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>rpc_tsmaster_cmd_start_simulation(h)</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>7</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_set_can_signal</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_set_can_signal(const size_t AHandle,const</p><p>char* ASgnAddress,const double AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>在远程 TSMaster 上修改数据库中的 CAN 信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ASgnAddress：数据库中信号的路径</p><p>AValue: 信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>if(0==rpc_tsmaster_cmd_set_can_signal(h,</p><p>&#8220;0/CAN_FD_Powertrain/Engine/EngineData/EngSpeed&#8221;, 1234)){</p><p>// signal written</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>8</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_get_can_signal</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_get_can_signal(const size_t AHandle,const</p><p>char* ASgnAddress,const pdouble AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>在远程 TSMaster 上获取数据库中的 CAN 信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ASgnAddress：数据库中信号的路径</p><p>AValue: 信号值指针</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>double d;</p><p>if(0==rpc_tsmaster_cmd_get_can_signal(h,</p><p>&#8220;0/CAN_FD_Powertrain/Engine/EngineData/EngSpeed&#8221;, &amp;d)){</p><p>// signal is retrieved</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>9</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_set_lin_signal</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_set_lin_signal(const size_t AHandle,const</p><p>char* ASgnAddress,const double AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>在远程 TSMaster 上修改数据库中的 LIN 信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ASgnAddress：数据库中信号的路径</p><p>AValue: 信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>if(0==rpc_tsmaster_cmd_set_lin_signal(h,</p><p>&#8220;chnidx/net/node/msg/signal&#8221;, 1234)){</p><p>// signal written</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>10</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_get_lin_signal</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_get_lin_signal(const size_t AHandle,const</p><p>char* ASgnAddress,const pdouble AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>在远程 TSMaster 上获取数据库中的 LIN 信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ASgnAddress：数据库中信号的路径</p><p>AValue: 信号值指针</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>double d;</p><p>if(0==rpc_tsmaster_cmd_get_lin_signal(h,</p><p>&#8220;chnidx/net/node/msg/signal&#8221;, &amp;d)){</p><p>// signal is retrieved</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>11</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_set_flexray_signal</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_set_flexray_signal(const size_t  AHandle,const char* ASgnAddress,const double AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>在远程 TSMaster 上修改数据库中的 flexray 信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ASgnAddress：数据库中信号的路径</p><p>AValue: 信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>if(0==rpc_tsmaster_cmd_set_flexray_signal(h,</p><p>&#8220;chnidx/net/node/msg/signal&#8221;, 1234)){</p><p>// signal written</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>12</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_get_flexray_signal</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_get_flexray_signal(const size_t AHandle,const char* ASgnAddress,const pdouble AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>在远程 TSMaster 上获取数据库中的 flexray 信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ASgnAddress：数据库中信号的路径</p><p>AValue: 信号值指针</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>double d;</p><p>if(0==rpc_tsmaster_cmd_get_flexray_signal(h,</p><p>&#8220;chnidx/net/node/msg/signal&#8221;, &amp;d)){</p><p>// signal is retrieved</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>13</strong></em>｜<strong>rpc_tsmaster_cmd_write_system_var</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_write_system_var(const size_t AHandle,const char* ACompleteName,const char* AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>从远程 TSMaster 按名称写入系统变量</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ACompleteName：系统变量名称</p><p>AValue: 数据值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>rpc_tsmaster_cmd_write_system_var(h, &#8220;v1&#8221;, &#8220;1.2345&#8221;)</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>14</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_read_system_var</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_read_system_var(const size_t AHandle,const char* ASysVarName,const pdouble AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>从远程 TSMaster 按名称读取系统变量    </p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ASysVarName：系统变量名称</p><p>AValue: 数据值指针</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>double d;</p><p>if (0 == rpc_tsmaster_cmd_read_system_var(h, &#8220;v1&#8221;, &amp;d)){</p><p>log(&#8220;value = %f&#8221;, d);</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>15</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_write_signal</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_write_signal(const size_t AHandle,const TLIBApplicationChannelType ABusType,const char* AAddr,const double</p><p>AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>从远程 TSMaster 按名称写入信号值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ABusType：总线类型</p><p>AAddr：数据库中信号的路径</p><p>AValue: 数据值</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>if(0==rpc_tsmaster_cmd_write_signal(h,APP_CAN,</p><p>&#8220;0/Powertrain/Engine/EngSpeed&#8221;, 1234)){</p><p>// value written</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>16</strong></em>｜<strong>rpc_tsmaster_cmd_read_signal</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_read_signal(const size_t AHandle,const TLIBApplicationChannelType ABusType,const char* AAddr,const</p><p>pdouble AValue)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>从远程 TSMaster 按名称读取信号</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>ABusType：总线类型</p><p>AAddr：数据库中信号的路径</p><p>AValue: 数据值指针</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>double d;</p><p>if(0==rpc_tsmaster_cmd_read_signal(h,APP_CAN,</p><p>&#8220;0/Powertrain/Engine/EngSpeed&#8221;, &amp;d)){</p><p>log(&#8220;signal value = %f&#8221;, d);</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>17</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_delete_client</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_delete_client(const size_t AHandle)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>删除 rpc client</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>rpc_tsmaster_delete_client(h)</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>18</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_cmd_stop_simulation</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_cmd_stop_simulation(const size_t AHandle)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>停止远程 TSMaster 仿真</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>rpc_tsmaster_cmd_stop_simulation(h)</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>19</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_call_system_api</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_call_system_api(const size_t AHandle,const char* AAPIName,const s32 AArgCount,const s32 AArgCapacity,const</p><p>char** AArgs)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p><strong>Client 调用 server 端使用系统函数</strong></p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>AAPIName：系统函数名称，”app.create_system_var”</p><p>AArgCount: 函数参数数量</p><p>AArgCapacity：参数字符串长度</p><p>AArgs：参数字符串数组</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>// 第一步：准备调用函数的输入参数</p><p>#define STR_BUFFER_SIZE 1024</p><p>char args[4][STR_BUFFER_SIZE];</p><p>char* pArgs[4] = {&amp;args[0][0], &amp;args[1][0], &amp;args[2][0], &amp;args[3][0]};</p><p>sprintf_s(pArgs[0], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;var1&#8221;);</p><p>sprintf_s(pArgs[1], STR_BUFFER_SIZE, &#8220;%d&#8221;, svtString);</p><p>sprintf_s(pArgs[2], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;string default value&#8221;);</p><p>sprintf_s(pArgs[3], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;this is a comment&#8221;);</p><p>// 步骤 2：调用任意 API</p><p>s32 ret;</p><p>ret = com.rpc_tsmaster_call_system_api(h, &#8220;app.create_system_var&#8221;, 4,</p><p>STR_BUFFER_SIZE, &amp;pArgs[0]);</p><p>// 步骤 3：处理参数中的返回值（如果可用）</p><p>s32 i;</p><p>log(&#8220;API call result = %d&#8221;, ret);</p><p>for (i=0; i&lt;4; i++){</p><p>log(&#8220;Argument %d: %s&#8221;, i+1, pArgs[i]);</p><p>}</p></section></section></td></tr></tbody></table></section></section></section><section><section><section><section><h3><em><strong>20</strong></em>｜<strong style="font-size: 16px;">rpc_tsmaster_call_library_api</strong></h3></section></section><section><section><section></section></section></section></section></section><section><section><section><table width="100%"><tbody><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>函数名称</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>UInt32 rpc_tsmaster_call_library_api(const size_t AHandle,const char* AAPIName,const s32 AArgCount,const s32 AArgCapacity,const  char** AArgs)</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>功能介绍</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p><strong>Client 调用 server 端使用系统函数</strong></p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>调用位置</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>创建 TSMaster Rpc 客户端之后</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>输入参数</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>AHandle : TSMaster Rpc 客户端句柄</p><p>AAPIName：小程序库函数名称，”mylib.create_system_var”</p><p>AArgCount: 函数参数数量</p><p>AArgCapacity：参数字符串长度</p><p>AArgs：参数字符串数组</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>返回值</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>==0: 函数执行成功</p><p>其他值：函数执行失败</p></section></section></td></tr><tr><td colspan="1" rowspan="1" width="33.0000%"><section><section><p><strong>示例</strong></p></section></section></td><td colspan="1" rowspan="1" width="67.0000%"><section><section><p>// 第一步：准备调用函数的输入参数</p><p>#define STR_BUFFER_SIZE 1024</p><p>char args[4][STR_BUFFER_SIZE];</p><p>char* pArgs[4] = {&amp;args[0][0], &amp;args[1][0], &amp;args[2][0], &amp;args[3][0]};</p><p>sprintf_s(pArgs[0], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;var1&#8221;);</p><p>sprintf_s(pArgs[1], STR_BUFFER_SIZE, &#8220;%d&#8221;, svtString);</p><p>sprintf_s(pArgs[2], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;string default value&#8221;);</p><p>sprintf_s(pArgs[3], STR_BUFFER_SIZE, &#8220;%s&#8221;, &#8220;this is a comment&#8221;);</p><p>//步骤 2：调用任意 API</p><p>s32 ret;</p><p>ret = com.rpc_tsmaster_call_library_api(h, &#8220;mylib.create_system_var&#8221;,</p><p>4, STR_BUFFER_SIZE, &amp;pArgs[0]);</p><p>// 步骤 3：处理参数中的返回值（如果可用）</p><p>s32 i;</p><p>log(&#8220;API call result = %d&#8221;, ret);</p><p>for (i=0; i&lt;4; i++){</p><p>log(&#8220;Argument %d: %s&#8221;, i+1, pArgs[i]);</p><p>}</p></section></section></td></tr></tbody></table></section></section></section>								</div>
				</div>
				</div>
					</div>
				</div>
				</div>
		<p>&lt;p&gt;The post <a rel="nofollow" href="https://www.tosunai.com/tsmaster-rpc-programming-guide-and-instructions/">干货分享 | TSMaster RPC 基础入门：编程指导和使用说明</a> first appeared on <a rel="nofollow" href="https://www.tosunai.com">上海同星智能科技有限公司</a>.&lt;/p&gt;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.tosunai.com/tsmaster-rpc-programming-guide-and-instructions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
