HMIPageGenerate.CodeSys
1.0.1
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Framework 4.6.2
This package targets .NET Framework 4.6.2. The package is compatible with this framework or higher.
dotnet add package HMIPageGenerate.CodeSys --version 1.0.1
NuGet\Install-Package HMIPageGenerate.CodeSys -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HMIPageGenerate.CodeSys" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HMIPageGenerate.CodeSys" Version="1.0.1" />
<PackageReference Include="HMIPageGenerate.CodeSys" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HMIPageGenerate.CodeSys --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HMIPageGenerate.CodeSys, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HMIPageGenerate.CodeSys@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HMIPageGenerate.CodeSys&version=1.0.1
#tool nuget:?package=HMIPageGenerate.CodeSys&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FSU组态画面自动生成工具
1. 项目简介
FSU组态画面自动生成工具是一款用于生成FSU组态画面的工具,通过该工具可以快速生成FSU组态画面,减少人工编写的工作量,提高工作效率。
2. 使用说明
引入 Nuget包 HMIPageGenerate.CodeSys
使用示例
using HMIPageGenerate.CodeSys;
using HMIPageGenerate.Core.Enums;
using HMIPageGenerate.Core.Models;
using HMIPageGenerate.Core.Params;
using System;
using System.Collections.Generic;
using System.IO;
namespace ConsoleApp
{
public class Program
{
public static void Main(string[] args)
{
var result = GenerateForCodeSys();
Console.WriteLine($"CodeSys生成文件路径: {result}");
Console.ReadKey();
}
private static string GenerateForCodeSys()
{
// 工位配置参数
var workConfig = GetConfigParam();
var startPageNumber = 200; // 起始页面编号
var outputDir = Path.GetTempPath(); // 输出目录
var tagFilePath = @"C:\Users\Allen\Downloads\CATL_程序模板_20250425.Device.Application.xml"; // 标签文件路径
// 生成FSU组态画面
var generate = new GenerateContent(workConfig, progressCallBack);
var result = generate.GeneratePageContent(startPageNumber, outputDir, tagFilePath);
return result;
}
private static void progressCallBack(double arg1, string arg2)
{
Console.WriteLine($"Time:{DateTime.Now}, Progress: {arg1}, Message: {arg2}");
}
private static List<WorkPageConfigParam> GetConfigParam()
{
// 工位配置参数
var workConfig = new List<WorkPageConfigParam> {
new WorkPageConfigParam
{
WorkIndex = "01", // 工位索引
WorkName = "上料机械手", // 工位名称
SingleAxisData = new List<AxisConfigData> // 单轴数据
{
new AxisConfigData
{
Number = 0, // 轴号
Name = "轴0", // 轴名称
SafePositionDatas = new List<SafePositionData>
{
// 安全位信息
new SafePositionData
{
Number = 0, // 安全位编号
Name = "安全位0", // 安全位名称
},
// 安全位信息
new SafePositionData
{
Number = 2, // 安全位编号
Name = "安全位2", // 安全位名称
},
// 安全位信息
new SafePositionData
{
Number = 5, // 安全位编号
Name = "安全位5", // 安全位名称
},
// 安全位信息
new SafePositionData
{
Number = 3, // 安全位编号
Name = "安全位3", // 安全位名称
}
}
},
new AxisConfigData
{
Number = 1, // 轴号
Name = "轴1", // 轴名称
SafePositionDatas = new List<SafePositionData>
{
// 安全位信息
new SafePositionData
{
Number = 1, // 安全位编号
Name = "安全位1", // 安全位名称
},
// 安全位信息
new SafePositionData
{
Number = 2, // 安全位编号
Name = "安全位2", // 安全位名称
},
// 安全位信息
new SafePositionData
{
Number = 5, // 安全位编号
Name = "安全位5", // 安全位名称
},
// 安全位信息
new SafePositionData
{
Number = 3, // 安全位编号
Name = "安全位3", // 安全位名称
}
}
}
},
CylinderData = new List<CylinderConfigData> // 气缸数据
{
new CylinderConfigData
{
Number = 0, // 气缸号
Name = "气缸1", // 气缸名称
Type = CylinderType.SingleCylinder, // 气缸类型
StatusInfos = new List<CylinderStatusInfo> // 气缸状态信息
{
new CylinderStatusInfo
{
VariableName = "IO点位1",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
VariableName = "IO点位2",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
}
}
},
new CylinderConfigData
{
Number = 1, // 气缸号
Name = "气缸2", // 气缸名称
Type = CylinderType.DoubleCylinder, // 气缸类型
StatusInfos = new List<CylinderStatusInfo> // 气缸状态信息
{
new CylinderStatusInfo
{
VariableName = "IO点位1",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
VariableName = "IO点位2",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
VariableName = "IO点位3",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "状态0" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
VariableName = "IO点位4",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
}
}
},
new CylinderConfigData
{
Number = 1, // 气缸号
Name = "真空阀1", // 气缸名称
IsVaccum = true, // 是真空阀
Type = CylinderType.DoubleCylinder, // 气缸类型
StatusInfos = new List<CylinderStatusInfo> // 气缸状态信息
{
new CylinderStatusInfo
{
VariableName = "IO点位1",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
VariableName = "IO点位2",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
VariableName = "IO点位3",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "状态0" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
VariableName = "IO点位4",
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
},
new CylinderStatusInfo
{
StatusDisplay = new Dictionary<int, string> // 状态显示
{
{ 0, "缩回" },
{ 1, "伸出" }
}
}
}
}
},
MotorData = new List<BaseConfigData> // 变频器数据
{
new BaseConfigData
{
Number = 0, // 变频器编号
Name = "变频器1", // 变频器名称
},
new BaseConfigData
{
Number = 1, // 变频器编号
Name = "变频器11", // 变频器名称
}
},
}
};
return workConfig;
}
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.2
- HMIPageGenerate.Core (>= 1.0.9)
- Nanoid (>= 3.1.0)
- Newtonsoft.Json (>= 13.0.3)
-
net8.0
- HMIPageGenerate.Core (>= 1.0.9)
- Nanoid (>= 3.1.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.