# tiaSnippets **Repository Path**: gokeycolor/code-snippets ## Basic Information - **Project Name**: tiaSnippets - **Description**: 一些在TIA 中 SCL编写的小功能 - **Primary Language**: Pascal - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-19 - **Last Updated**: 2025-09-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # tiaSnippets #### 介绍 一些在TIA 中 SCL编写的小功能 #### SCL 源文件安装说明 按以下三步,即可把 SCL 源文件快速集成到你的项目中。 ##### 1. 下载 - 将仓库克隆或下载到本地,确保 `.scl` 文件已保存在易找的目录。 ##### 2. 导入 - 打开 TIA Portal(或其他支持 SCL 的开发环境)。 - 在项目树 **“外部源文件”**,选择 **“添加外部文件”**,浏览并导入刚才下载的 `.scl` 文件。 ##### 3. 生成块 - 导入完成后,右键该 `.scl` 文件,选择 **“从源生成块”**。 - 按提示完成编译,块即自动添加到项目,可直接在程序中调用。 #### 功能块 1. InitStringVar , ##### 使用示例 ``` "InitStringVar"(str:="data".Static_4); //将 string类型变量"data".Static_4内容初始化为null "data".Static_4 := ''; //将"data".Static_4有效字符长度变为0 ```