CSM 函数面板

CSM 函数面板

csm-palette

CSM API

Template Palette

CSM - No-Event Structure Template.vi

用于创建具有无用户界面的 CSM 模块的模板

输入控件:

  • Name(“” to use uuid): CSM 模块名称
    • 如果输入为 ““,将使用 UUID 作为模块名称。该模块被标记为独立模式,不会包含在模块列表中。
    • 如果输入以 ‘#’ 结尾,则该模块将在工作模式下运行。具有相同名称的模块将共享同一消息队列。任何外部消息将由其中一个模块处理,取决于哪个模块空闲。
    • 否则,输入字符串将被用作模块名称,该名称应在系统中保持唯一。如果在系统中使用重复的模块名称,CSM 将进入 “Critical Error” 状态。

输出控件:

CSM - With Event Structure Template.vi

用于创建具有用户界面的 CSM 模块的模板,模板中包含用户事件结构用于响应用户操作。

输入控件:

  • Name(“” to use uuid): CSM 模块名称
    • 如果输入为 ““,将使用 UUID 作为模块名称。该模块被标记为独立模式,不会包含在模块列表中。
    • 如果输入以 ‘#’ 结尾,则该模块将在工作模式下运行。具有相同名称的模块将共享同一消息队列。任何外部消息将由其中一个模块处理,取决于哪个模块空闲。
    • 否则,输入字符串将被用作模块名称,该名称应在系统中保持唯一。如果在系统中使用重复的模块名称,CSM 将进入 “Critical Error” 状态。

输出控件:

CSM - With Event Structure Template - Tiny.vi

用于创建具有用户界面的 CSM 模块的模板,模板中包含用户事件结构用于响应用户操作。此模板的代码比较紧凑。

输入控件:

  • Name(“” to use uuid): CSM 模块名称
    • 如果输入为 ““,将使用 UUID 作为模块名称。该模块被标记为独立模式,不会包含在模块列表中。
    • 如果输入以 ‘#’ 结尾,则该模块将在工作模式下运行。具有相同名称的模块将共享同一消息队列。任何外部消息将由其中一个模块处理,取决于哪个模块空闲。
    • 否则,输入字符串将被用作模块名称,该名称应在系统中保持唯一。如果在系统中使用重复的模块名称,CSM 将进入 “Critical Error” 状态。

输出控件:

Parse State Queue++.vi

解析JKI状态机状态队列,返回将执行的下一个当前状态、参数等信息。

输入控件:

  • State Queue: 整个状态队列被连接到此输入。这应该来自 CSM 的移位寄存器。
  • Error In (no error): 来自JKI状态机的错误簇被连接到此输入。如果发生错误并出现在此输入上,则当前状态输出将返回 “Error Handler” 状态。
  • Name(“” to use uuid): CSM 模块名称
    • 如果输入为 ““,将使用 UUID 作为模块名称。该模块被标记为独立模式,不会包含在模块列表中。
    • 如果输入以 ‘#’ 结尾,则该模块将在工作模式下运行。具有相同名称的模块将共享同一消息队列。任何外部消息将由其中一个模块处理,取决于哪个模块空闲。
    • 否则,输入字符串将被用作模块名称,该名称应在系统中保持唯一。如果在系统中使用重复的模块名称,CSM 将进入 “Critical Error” 状态。
  • Response Timeout(5000ms):同步调用时的响应超时设置,默认 5000 ms.
  • Dequeue Timeout(0ms): 检查 CSM 消息队列的超时设置,默认为0,不进行等待。
  • Response Arguments: 来自上一个状态的响应参数。它应该来连接 CSM 的移位寄存器,用于传递外部调用的返回值。

输出控件:

  • Remaining States: 返回继续执行的所有状态及参数。 These should be passed through the current state in the state machine. These can also be modified or augmented within the current state if necessary.
  • Arguments: 返回可能在当前状态字符串中使用的任何参数。这些参数位于“»”字符之后。注意:参数变量不得包含任何不可打印的字符,比如换行符或回车符。
  • Current State: 将执行的下一个当前状态
  • Name Used: 分配给此CSM模块的实际名称
  • Argument - State: 如果是 CSM 定义的内置状态,此参数表示此状态的前状态
  • From Who: 如果Current State 是由外部发送的,则这是源CSM模块名称。

Build State String with Arguments++.vi

构建一个包含JKI状态机参数的状态字符串。

例如:

发送给本地状态机时, Target Module (“”) 应该为空.

  If State = A 并且没有参数, 那么 <b>State with Arguments</b> = A
  If State = A , Arguments = B 那么 <b>State with Arguments</b> = A >> B

在发送给其他CSM的情况下, 假设 Target Module (“”) 的名称是 “Target”

  • 同步调用,发送的消息后等待返回:

       If State = A 并且没有参数, 那么 <b>State with Arguments</b> = A -@target
       If State = A , Arguments = B 那么 <b>State with Arguments</b> = A >> B -@target
    
  • 异步调用,发送消息后,将进入”Async Message Posted” 状态,当外部模块处理完毕后,本地模块将收到 “Async Response” 消息:

       If State = A 并且没有参数, 那么 <b>State with Arguments</b> = A ->target
       If State = A , Arguments = B 那么 <b>State with Arguments</b> = A >> B ->target
    

输入控件:

  • State: 状态或消息名称字符串
  • Arguments (“”): State 的参数
  • Target Module (“”): 此消息发送的目标 CSM 模块名称
  • Sync-Call(-@) T By Default/Async-Call(->) F: 同步调用输入”TRUE”; 异步调用输入”FALSE”

输出控件:

  • State with Arguments: 包含 JKI 状态机状态、参数等信息的字符串

Build Message with Arguments++.vi

Builds a message that contains arguments for CSM. This VI will parse “State with Arguments” for message type, message string, arguments and target module from input State with Arguments and replace corresponding parts in the message with input values. Different message type symbol(->|,->,-@) will be used in different Polymorphic Vi instance.

Polymorphic Option:

  • Build Message with Arguments(Auto Check).vi
  • Build Asynchronous Message with Arguments.vi
  • Build No-Reply Asynchronous Message with Arguments.vi
  • Build Synchronous Message with Arguments.vi

Inputs:

  • State with Arguments: Input Message which might contain Arguments or target Module
  • Arguments (“”): The arguments which will be used to replace arguments in State with Arguments. if empty, no arguments will be included in output strings.
  • Target Module (“”): The target which will be used to replace target in State with Arguments. if empty, target in State with Arguments will be used.

Outputs:

  • State with Arguments: String stands for state with arguments

Inputs:

Outputs:

Build Message with Arguments(Auto Check).vi

Builds a message that contains arguments for CSM. This VI will parse “State with Arguments” for message type, message string, arguments and target module from input State with Arguments and replace corresponding parts in the message with input values. The message type from input State with Arguments will be used.

For Example:

If State with Arguments input is “API: DoSth” Arguments (“”) input is “Arguments” Target Module (“”) input is “Callee” Then result string is “API: DoSth » Arguments” as no message symbol is detected.

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “” Then result string is “API: DoSth » NewArguments -> Callee”

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “NewCallee” Then result string is “API: DoSth » NewArguments -> NewCallee”

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “” Target Module (“”) input is “NewCallee” Then result string is “API: DoSth -> NewCallee”

If State with Arguments input is “API: DoSth » Arguments -@ Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “” Then result string is “API: DoSth » NewArguments -@ Callee”

Inputs:

  • State with Arguments: Input Message which might contain Arguments or target Module
  • Arguments (“”): The arguments which will be used to replace arguments in State with Arguments. if empty, no arguments will be included in output strings.
  • Target Module (“”): The target which will be used to replace target in State with Arguments. if empty, target in State with Arguments will be used.

Outputs:

  • State with Arguments: String stands for state with arguments

Build Asynchronous Message with Arguments.vi

Builds a message that contains arguments for CSM. This VI will parse “State with Arguments” for message string, arguments and target module from input State with Arguments and replace corresponding parts in the message with input values with async-message symbol “->” if Target Module (“”) is specified.

For Example:

If State with Arguments input is “API: DoSth” Arguments (“”) input is “Arguments” Target Module (“”) input is “Callee” Then result string is “API: DoSth » Arguments -> Callee”. It’s different with Build Message with Arguments(Auto Check).vi. . Message Type Symbol is replaced with “->”.

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “” Then result string is “API: DoSth » NewArguments -> Callee”

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “NewCallee” Then result string is “API: DoSth » NewArguments -> NewCallee”

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “” Target Module (“”) input is “NewCallee” Then result string is “API: DoSth -> NewCallee”

If State with Arguments input is “API: DoSth » Arguments -@ Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “” Then result string is “API: DoSth » NewArguments -> Callee”. Message Type Symbol is replaced with “->”.

Inputs:

  • State with Arguments: Input Message which might contain Arguments or target Module
  • Arguments (“”): The arguments which will be used to replace arguments in State with Arguments. if empty, no arguments will be included in output strings.
  • Target Module (“”): The target which will be used to replace target in State with Arguments. if empty, target in State with Arguments will be used.

Outputs:

  • State with Arguments: String stands for state with arguments

Build No-Reply Asynchronous Message with Arguments.vi

Builds a message that contains arguments for CSM. This VI will parse “State with Arguments” for message string, arguments and target module from input State with Arguments and replace corresponding parts in the message with input values with No-Reply async-message symbol “->|” if Target Module (“”) is specified.

For Example:

If State with Arguments input is “API: DoSth” Arguments (“”) input is “Arguments” Target Module (“”) input is “Callee” Then result string is “API: DoSth » Arguments ->| Callee”. It’s different with Build Message with Arguments(Auto Check).vi. Message Type Symbol is replaced with “->|”.

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “” Then result string is “API: DoSth » NewArguments ->| Callee”. Message Type Symbol is replaced with “->|”.

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “NewCallee” Then result string is “API: DoSth » NewArguments ->| NewCallee”. Message Type Symbol is replaced with “->|”.

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “” Target Module (“”) input is “NewCallee” Then result string is “API: DoSth ->| NewCallee”. Message Type Symbol is replaced with “->|”.

If State with Arguments input is “API: DoSth » Arguments -@ Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “” Then result string is “API: DoSth » NewArguments ->| Callee”. Message Type Symbol is replaced with “->|”.

Inputs:

  • State with Arguments: Input Message which might contain Arguments or target Module
  • Arguments (“”): The arguments which will be used to replace arguments in State with Arguments. if empty, no arguments will be included in output strings.
  • Target Module (“”): The target which will be used to replace target in State with Arguments. if empty, target in State with Arguments will be used.

Outputs:

  • State with Arguments: String stands for state with arguments

Build Synchronous Message with Arguments.vi

Builds a message that contains arguments for CSM. This VI will parse “State with Arguments” for message string, arguments and target module from input State with Arguments and replace corresponding parts in the message with input values with sync-message symbol “-@” if Target Module (“”) is specified.

For Example:

If State with Arguments input is “API: DoSth” Arguments (“”) input is “Arguments” Target Module (“”) input is “Callee” Then result string is “API: DoSth » Arguments ->| Callee”. It’s different with Build Message with Arguments(Auto Check).vi. Message Type Symbol is replaced with “-@”.

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “” Then result string is “API: DoSth » NewArguments ->| Callee”. Message Type Symbol is replaced with “-@”.

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “NewCallee” Then result string is “API: DoSth » NewArguments -@ NewCallee”. Message Type Symbol is replaced with “-@”.

If State with Arguments input is “API: DoSth » Arguments -> Callee” Arguments (“”) input is “” Target Module (“”) input is “NewCallee” Then result string is “API: DoSth -@ NewCallee”. Message Type Symbol is replaced with “-@”.

If State with Arguments input is “API: DoSth » Arguments -@ Callee” Arguments (“”) input is “NewArguments” Target Module (“”) input is “” Then result string is “API: DoSth » NewArguments -@ Callee”.

Inputs:

  • State with Arguments: Input Message which might contain Arguments or target Module
  • Arguments (“”): The arguments which will be used to replace arguments in State with Arguments. if empty, no arguments will be included in output strings.
  • Target Module (“”): The target which will be used to replace target in State with Arguments. if empty, target in State with Arguments will be used.

Outputs:

  • State with Arguments: String stands for state with arguments

Build Interrupt Status Message.vi

Builds a message that contains arguments for CSM. This VI will parse “State with Arguments” for message type, message string, arguments and target module from input State with Arguments and replace corresponding parts in the message with input values. The message type from input State with Arguments will be used. For Example: If State with Arguments input is “API: DoSth” Then result string is “API: DoSth » Arguments” as no message symbol is detected. If State with Arguments input is “API: DoSth » Arguments -> Callee” Then result string is “API: DoSth » NewArguments -> Callee” If State with Arguments input is “API: DoSth » Arguments -> Callee” Then result string is “API: DoSth » NewArguments -> NewCallee” If State with Arguments input is “API: DoSth » Arguments -> Callee” Then result string is “API: DoSth -> NewCallee” If State with Arguments input is “API: DoSth » Arguments -@ Callee” Then result string is “API: DoSth » NewArguments -@ Callee”

  • State with Arguments: Input Message which might contain Arguments or target Module
  • Arguments (“”): The arguments which will be used to replace arguments in State with Arguments. if empty, no arguments will be included in output strings.
  • Target Module (“”): The target which will be used to replace target in State with Arguments. if empty, target in State with Arguments will be used.
  • State with Arguments: String stands for state with arguments

Inputs:

  • State with Arguments:
  • Arguments (“”):

Outputs:

  • State with Arguments:

Build Normal Status Message.vi

Builds a message that contains arguments for CSM. This VI will parse “State with Arguments” for message type, message string, arguments and target module from input State with Arguments and replace corresponding parts in the message with input values. The message type from input State with Arguments will be used. For Example: If State with Arguments input is “API: DoSth” Then result string is “API: DoSth » Arguments” as no message symbol is detected. If State with Arguments input is “API: DoSth » Arguments -> Callee” Then result string is “API: DoSth » NewArguments -> Callee” If State with Arguments input is “API: DoSth » Arguments -> Callee” Then result string is “API: DoSth » NewArguments -> NewCallee” If State with Arguments input is “API: DoSth » Arguments -> Callee” Then result string is “API: DoSth -> NewCallee” If State with Arguments input is “API: DoSth » Arguments -@ Callee” Then result string is “API: DoSth » NewArguments -@ Callee”

  • State with Arguments: Input Message which might contain Arguments or target Module
  • Arguments (“”): The arguments which will be used to replace arguments in State with Arguments. if empty, no arguments will be included in output strings.
  • Target Module (“”): The target which will be used to replace target in State with Arguments. if empty, target in State with Arguments will be used.
  • State with Arguments: String stands for state with arguments

Inputs:

  • State with Arguments:
  • Arguments (“”):

Outputs:

  • State with Arguments:

Build Register Status Message.vi

Builds register status message. The message looks like: [source-state]@[source-module] » [response-message]@[response-module] -> For examples: DownloadFinished@Downloader >> StartPlay@Player -> DownloadFinished@Downloader >> StartPlay -> // response-module is current module DownloadFinished@Downloader -> // response-module is current module. response-message is DownloadFinished DownloadFinished@* >> StartPlay@Player -> // Any Module's DownloadFinished is registered to Player's StartPlay state.

Inputs:

  • Source CSM Name (* as Default):
  • CSM Name:
  • Status:
  • Response Message (if “”, same as Source Message):

Outputs:

  • State with Arguments:

Build Unregister Status Message.vi

Builds unregister status message. The message looks like: [source-state]@[source-module] » [response-module] -> For examples: DownloadFinished@Downloader >> StartPlay -> DownloadFinished@Downloader ->

Inputs:

  • Source CSM Name (* as Default):
  • CSM Name:
  • Status:

Outputs:

  • State with Arguments:

Add State(s) to Queue By BOOL++.vi

根据高优先级和Bool输入,此VI生成TRUE/False和剩余状态的连接状态。High Priority输入决定是否在剩余状态之前或之后连接TRUE或False字符串。Bool输入决定要连接的字符串是TRUE还是False。

Inputs:

  • State Queue(“”): 整个状态队列被连接到此输入
  • TRUE(“”): Bool 为 True 时插入的状态字符串
  • False(“”): Bool 为 False 时插入的状态字符串
  • Bool: 选择连接到TRUE终端或False终端的状态字符串的标志。
  • High Priority(FALSE): 如果为True,状态将被插入到State Queue(“”)的顶部。如果为False,它被附加到尾部。

Outputs:

  • State Queue Out: 返回继续执行的所有状态及参数。

Add State(s) to Queue By BOOL(Element).vi

根据高优先级和Bool输入,此VI生成TRUE/False和剩余状态的连接状态。High Priority输入决定是否在剩余状态之前或之后连接TRUE或False字符串。Bool输入决定要连接的字符串是TRUE还是False。

Inputs:

  • State Queue(“”): 整个状态队列被连接到此输入
  • TRUE(“”): Bool 为 True 时插入的状态字符串
  • False(“”): Bool 为 False 时插入的状态字符串
  • Bool: 选择连接到TRUE终端或False终端的状态字符串的标志。
  • High Priority(FALSE): 如果为True,状态将被插入到State Queue(“”)的顶部。如果为False,它被附加到尾部。

Outputs:

  • State Queue Out: 返回继续执行的所有状态及参数。

Add State(s) to Queue By BOOL(Array Left).vi

根据高优先级和Bool输入,此VI生成TRUE/False和剩余状态的连接状态。High Priority输入决定是否在剩余状态之前或之后连接TRUE或False字符串。Bool输入决定要连接的字符串是TRUE还是False。

Inputs:

  • State Queue(“”): 整个状态队列被连接到此输入
  • TRUE(“”): Bool 为 True 时插入的状态字符串
  • False(“”): Bool 为 False 时插入的状态字符串
  • Bool: 选择连接到TRUE终端或False终端的状态字符串的标志。
  • High Priority(FALSE): 如果为True,状态将被插入到State Queue(“”)的顶部。如果为False,它被附加到尾部。

Outputs:

  • State Queue Out: 返回继续执行的所有状态及参数。

Add State(s) to Queue By BOOL(Array Right).vi

根据高优先级和Bool输入,此VI生成TRUE/False和剩余状态的连接状态。High Priority输入决定是否在剩余状态之前或之后连接TRUE或False字符串。Bool输入决定要连接的字符串是TRUE还是False。

Inputs:

  • State Queue(“”): 整个状态队列被连接到此输入
  • TRUE(“”): Bool 为 True 时插入的状态字符串
  • False(“”): Bool 为 False 时插入的状态字符串
  • Bool: 选择连接到TRUE终端或False终端的状态字符串的标志。
  • High Priority(FALSE): 如果为True,状态将被插入到State Queue(“”)的顶部。如果为False,它被附加到尾部。

Outputs:

  • State Queue Out: 返回继续执行的所有状态及参数。

Add State(s) to Queue By BOOL(Array All).vi

根据高优先级和Bool输入,此VI生成TRUE/False和剩余状态的连接状态。High Priority输入决定是否在剩余状态之前或之后连接TRUE或False字符串。Bool输入决定要连接的字符串是TRUE还是False。

Inputs:

  • State Queue(“”): 整个状态队列被连接到此输入
  • TRUE(“”): Bool 为 True 时插入的状态字符串
  • False(“”): Bool 为 False 时插入的状态字符串
  • Bool: 选择连接到TRUE终端或False终端的状态字符串的标志。
  • High Priority(FALSE): 如果为True,状态将被插入到State Queue(“”)的顶部。如果为False,它被附加到尾部。

Outputs:

  • State Queue Out: 返回继续执行的所有状态及参数。

CSM - Broadcast Status Change.vi

向系统广播状态更改。已注册状态的 CSM 模块将接收到状态更改。

输入控件:

  • Status with Arguments: 将被广播的状态及参数
  • State Queue(“”): 整个状态队列被连接到此输入
  • Broadcast(T): 控制是否广播的开关输入

输出控件:

  • Remaining States: 返回继续执行的所有状态及参数。

Arguments

CSM - Make String Arguments Safe.vi

’->’,’->|’,’-@’,’-&’,’<-“ 是关键字,不能出现在参数中。使用此 VI 保证参数安全。

Inputs:

  • Argument String: 可能包含关键字的参数 ‘->’,’->|’,’-@’,’-&’,’<-“.

Outputs:

  • Safe Argument String: 安全参数

CSM - Revert Arguments-Safe String.vi

’->’,’->|’,’-@’,’-&’,’<-“ 是关键字,不能出现在参数中。使用CSM Make String Arguments Safe.vi保证参数安全。此VI用于将安全参数转换为原始参数。

Inputs:

  • Safe Argument String: 安全参数

Outputs:

  • Origin Argument String: 可能包含关键字的参数 ‘->’,’->|’,’-@’,’-&’,’<-“.

CSM - Convert Data to HexStr.vi

将复杂参数(变体)转换为十六进制字符串,该字符串可以安全地用作状态参数,而不会破坏字符串队列逻辑。

输入控件:

  • Variant: 数据,保存为变体(variant)格式

输出控件:

  • HEX String (0-9,A-F): Hex字符串格式,不包含不可见字符,符合 CSM 的参数要求

CSM - Convert HexStr to Data.vi

将十六进制字符串参数转换回变体数据。

输入控件:

  • HEX String: Hex字符串格式,不包含不可见字符,符合 CSM 的参数要求

输出控件:

  • Variant: 数据,保存为变体(variant)格式
  • error out: 错误簇

Advance APIs

CSM - Start Async Call.vi

异步调用模板代码的VI片段

输入控件:

输出控件:

CSM - Synchronized Call.vi

同步调用模板代码的VI片段

输入控件:

  • 无 -

输出控件:

CSM - Mark As Worker Module.vi

在CSM名称后添加“#”,以标记此模块为工作者,其与具有相同名称的其他工作者共享相同的消息队列。一个带有生成的UUID的实际名称将被分配给此CSM模块。

输入控件:

  • CSM Name: CSM 模块名称

输出控件:

  • CSM Name(marked as worker): 添加“#”标记 的CSM 模块名称

CSM - Compact Multiple States.vi

将多个状态紧凑成单个字符串以供输入使用

输入控件:

  • States in Lines: 多个状态的字符串数组

输出控件:

  • States: 包含所有输入状态的字符串

CSM - Check If Module Exists.vi

检查 CSM 模块是否存在

输入控件:

  • CSM Name: CSM 模块名称
  • Error in: 错误簇

输出控件:

  • Exist?: 返回模式是否存在,存在返回True,不存在返回False
  • CSM Name(dup): 返回 CSM Name
  • Error out: 错误簇

CSM - List Modules.vi

列出系统中所有活动的CSM模块。

输入控件:

  • Exclude Standalone CSM(T): 是否包含独立工作模式的模块
  • Error in: 错误簇

输出控件:

  • Module Names: 模块名称列表
  • Error out: 错误簇

CSM - Module Status.vi

获取CSM模块的状态

输入控件:

  • CSM Name: CSM 模块名称.
  • Error in: 错误簇

输出控件:

  • Mode: 返回模块的工作模式:”Stand-alone”, “CSM” 或 “Action Worker”.
  • #As Worker: 工作者模式下,此模块的工作者数量
  • #msg to be processed: CSM消息队列中的待处理消息个数
  • CSM Name(dup): 返回 CSM Name
  • Error out: 错误簇

CSM - Register Status Change.vi

注册以接收其他CSM模块状态更改的通知。如果未连接 “Response Message” 或输入为空,则将使用相同的Status 名称作为响应消息。

输入控件:

  • CSM Name: CSM 模块名称.
  • Source CSM Name (* as Default): 生成状态的CSM模块。您可以使用“*”来表示所有生成相同状态的模块。
  • Status: 状态字符串
  • Response Message (if “”, same as Source Message): 注册后,如果状态发生变化,将接收到此消息。
  • Priority(T:As Status,F:As Interrupt): 如果响应消息为False,则将其插入到状态队列的前面;否则,将其附加到队列的尾部。
  • Error in: 错误簇

输出控件:

  • CSM Name(dup): 返回 CSM Name
  • Error out: 错误簇

CSM - Unregister Status Change.vi

取消注册其他 CSM 模块状态更改的通知。

输入控件:

  • CSM Name: CSM 模块名称.
  • Source CSM Name: 生成状态的CSM模块。您可以使用“*”来表示所有生成相同状态的模块。
  • Status: 状态字符串
  • Error in: 错误簇

输出控件:

  • CSM Name(dup): 返回 CSM Name
  • Error out: 错误簇

CSM - Get New State Notifier Event.vi

输入控件:

  • Name(“” to use uuid) in: CSM 模块名称
  • Error in: 错误簇

输出控件:

  • New State Notifier Event: 用户事件句柄,用来当收到消息时,使用CSM模块中断在事件结构中的等待
  • Error out: 错误簇

Non-CSM Support

CSM - Post Message.vi

向指定的CSM发布一条消息,相当于异步调用,但不等待返回参数。

输入控件:

  • Target Module:目标 CSM 模块名称
  • State: 消息字符串
  • Arguments (“”): 消息参数
  • Error In (no error): 错误簇

输出控件:

  • error out: 错误簇

CSM - Send Message and Wait for Reply.vi

向指定的CSM发布一条消息并等待回复,相当于同步调用,在指定超时内没有收到返回,将返回超时错误。

输入控件:

  • Target Module: 目标 CSM 模块名称
  • State: 消息字符串
  • Arguments (“”): 消息参数
  • Response Timeout(5000ms): 等待返回的超时设置,默认 5000ms.
  • Error In (no error): 错误簇

输出控件:

  • Arguments: Response returned.
  • error out: 错误簇

CSM - Status Change Event.vi

Obtain CSM Global Log Event Reference.

  • Error in: Error cluster
  • CSM Global Log Event: User event reference for CSM global log.
  • Error out: Error cluster

Inputs:

  • Error in:
  • Name(“” to use uuid) in:

Outputs:

  • Error out:
  • Status Change Event:

CSM - Destroy Status Change Event.vi

Release CSM Global Log Event Reference.

  • CSM Global Log Event:
  • Error in: Error cluster
  • Error out: Error cluster

Inputs:

  • Error in:
  • Status Change Event:

Outputs:

  • Error out:

Side-Loop Support

CSM - Request CSM to Post Message.vi

申请 CSM 发送消息。通常用于和CSM并行的功能循环,这些功能循环和 CSM 一起完成完整模块功能。

Inputs:

  • Module Name:发送状态的CSM
  • Status: 将被广播的状态
  • Arguments (“”): 将被广播的状态参数
  • Target Module:目标模块
  • Error In (no error): 错误簇 -

Outputs:

  • error out: 错误簇

CSM - Request CSM to Broadcast Status Change.vi

申请 CSM 发布状态。通常用于和CSM并行的功能循环,这些功能循环和 CSM 一起完成完整模块功能。

Inputs:

  • Module Name:发送状态的CSM
  • Status: 将被广播的状态
  • Arguments (“”): 将被广播的状态参数
  • Broadcast(T): 控制是否广播的开关输入
  • Error In (no error): 错误簇

Outputs:

  • error out: 错误簇

CSM - Module Turns Invalid.vi

检查CSM是否已经退出。通常用于和CSM并行的功能循环,这些功能循环和 CSM 一起完成完整模块功能。 本VI用于并行循环的退出条件。

Inputs:

  • CSM Name: 模块名称

Outputs:

  • Turn Invalid(Exit)?: 是否已经退出

Global Log Event

CSM - Global Log Event.vi

获取 CSM 全局状态用户事件句柄

输入控件:

  • Error in: 错误簇

输出控件:

  • CSM Global Log Event: CSM 全局状态用户事件句柄
  • Error out: 错误簇

CSM - Destroy Global Log Event.vi

释放 CSM 全局状态用户事件句柄

输入控件:

  • CSM Global Log Event: CSM 全局状态用户事件句柄
  • Error in: 错误簇

输出控件:

  • Error out: 错误簇

CSM - Generate User Global Log.vi

Inputs:

  • Error in:
  • From Who:
  • ModuleName:
  • Log:
  • Arguments:

Outputs:

  • error out:

Utility VIs

Build Error Cluster.vi

创建一个错误簇(error cluster),以标准 LabVIEW 的方式从调用 VI 的调用链中构建源字符串。构建的源字符串形式为: “调用的 VI调用 VI 的调用者->调用 VI 的调用者的调用者->等等…->等等…” 可选的 ‘String to Prepend to source (“”)’ 字符串输入可用于在源字符串中添加额外的描述信息。如果存在这个字符串,它将用括号括起来,并添加到源字符串之前。

输入控件:

  • code: 错误码
  • String to Prepend to source (“”): 错误信息字符串

输出控件:

  • error out: 错误簇

Build Internal State String.vi

构建包含 JKI 状态机状态、参数等信息的字符串。

输入控件:s

  • State: 状态字符串
  • Arguments (“”): State的参数
  • Arg-State (“”): 发送此消息的模块在发送此消息时处于的状态
  • Source (“”): 发送此消息的模块名称

输出控件:

  • State with Arguments: 包含 JKI 状态机状态、参数等信息的字符串

String History Cacher.vi

保存当前输入的字符串到缓存,缓存的历史字符串,当超出最大长度限制时,最先进入的缓存字符串将被覆盖。用于调试CSM的历史状态。

输入控件:

  • String: 待缓存字符串
  • length: 缓存的历史字符串最大字符串长度
  • Include Timestamp(F): 是否在每行开头包含时间戳。

输出控件:

  • String Cache: 缓存的历史字符串

Timeout Selector.vi

用于包含用户事件结构的模板中

输入控件:

  • Timeout Expected: 预期的超时设置
  • Remaining States: 如果还有剩余的状态,输出将为 0,否则输出为预期值

输出控件:

  • Timeout: 仲裁后使用的超时设置

Trim Both Whitespace.vi

string 的开头、结尾或两者同时移除所有 ASCII 空白字符(空格、制表符、回车和换行)。

输入控件:

  • string: 待处理字符串

输出控件:

  • trimmed string: 处理后的字符串

uuid.vi

根据标准方法生成 Universally Unique Identifier(UUID)。 例如:

 - 59703F3AD837
 - 106A470BA5EC
 - 9B781DB313AF

输入控件:

输出控件:

  • UUID: 生成的 UUID

CSM - Broadcast Message Type.ctl

广播消息类型定义。

  • Interrupt: 高优先级,作为中端
  • Status: 普通优先级,作为消息

CSM - Message Type.ctl

消息类型定义。

  • Async: 异步消息 (->)
  • Async without Reply: 无返回异步消息 (->|)
  • Sync: 同步消息 (-@)

Global Log To String.vi

Inputs:

  • Log:

Outputs:

  • String:

results matching ""

    No results matching ""