主要内容

本页采用了机器翻译。点击此处可查看英文原文。

Persistent Variable Write

将持久变量的值写入目标计算机

自 R2022a 起

  • Persistent Variable Write block

库:
Simulink Real-Time / Target Management

描述

Persistent Variable Write 模块在实时应用程序启动和停止时,向选定的持久变量写入值。当 Speedgoat® 目标计算机关闭时,该变量值仍会保留。

使用 getPersistentVariables 函数和 setPersistentVariables 函数访问目标计算机上的持久变量值。

示例

端口

输入

全部展开

Persistent Variable Write 模块输入端口的数据类型继承自其输入信号。信号可以是任意维度。

该模块可处理复数。Persistent Variable Write 模块输入端口的复杂性源自其输入信号。

数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean

参数

全部展开

Variable name 参数提供持久变量的名称。使用此名称访问通过 getPersistentVariables 函数从目标计算机检索到的变量值结构体中的变量。

编程用法

模块参数:varName

扩展功能

全部展开

C/C++ 代码生成
使用 Simulink® Coder™ 生成 C 代码和 C++ 代码。

版本历史记录

在 R2022a 中推出