Skip to content
Discussion options

You must be logged in to vote
Admin verified this answer by nevstop May 13, 2026

在 CSM 框架中,处理同步消息(-@)的 Response 分支里,Response Info 簇中的 Argument 返回的是目标模块执行完对应状态后,通过 Return Argument 或类似方式传回的数据

具体来说:

  • 原理:当你使用 -@(同步调用)发送消息时,发送方会阻塞等待,直到目标模块处理完该消息。目标模块处理完毕后,CSM 会立即进入发送方的 Response 分支。此时,Response Info 簇中的 Argument 携带的正是目标模块返回的结果数据
  • 与异步返回的区别:同步返回的 ArgumentResponse 分支中获取;而异步消息(->)的返回值则在 Async Response 分支中获取。两者的数据传递方式相同,但触发的时机和上下文不同——同步是立即阻塞等待,异步是非阻塞、回调式
  • 常见用法:你可以在目标模块的状态代码中,通过 Return ArgumentSet Response Argument 等 VI(具体名称取决于模板版本)来设置要返回的值。发送方在 Response 分支中读取 Argument 即可获得该值。
  • 典型场景:例如模块 A 向模块 B 发送 Get_Data -@ B,模块 B 的 Get_Data 状态执行完毕后返回一个数值或字符串,模块 A 的 Response 分支中 Argument 就是那个数值或字符串。

更多关于消息格式与同步/异步机制,可参考 消息格式Response 分支说明

🤖 此回答由 CSM-QA-Robot 自动生成。如有偏差,欢迎追问或修正。

这个是…

Replies: 1 comment 1 reply

Comment options

nevstop
May 12, 2026
Maintainer Author

You must be logged in to vote
1 reply
@nevstop
Comment options

nevstop May 13, 2026
Maintainer Author

Answer verified by Admin May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant