EC_Net 1.0.6
dotnet add package EC_Net --version 1.0.6
NuGet\Install-Package EC_Net -Version 1.0.6
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="EC_Net" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EC_Net" Version="1.0.6" />
<PackageReference Include="EC_Net" />
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 EC_Net --version 1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EC_Net, 1.0.6"
#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 EC_Net@1.0.6
#: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=EC_Net&version=1.0.6
#tool nuget:?package=EC_Net&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EC_Net
简介 Introduction
EC_Net是SOEM包装器,用于win和linux控制EtherCat设备,目前只支持COE和IO从站
EC_Net is SOEM wrapper, used for controlling EtherCat devices on Windows and Linux, currently only supports COE and IO slaves
使用方法 Usage
//初始化主站
EtherCATMaster _etherCATMaster = new EtherCATMaster();
//初始化1个地址为1的驱动器,如果有多个驱动器直接创建对应地址的多个对象即可
EtherCATSlave_COE? _axis = new(_etherCATMaster, 1);
//启动主站,查找从站数量,参数为网卡名称
int Count = _etherCATMaster.StartActivity("EtherCatNet");
//停止主站
_etherCATMaster.StopActivity();
//伺服使能
_axis.PowerOn();
//伺服去使能
_axis.PowerOff();
//绝对位置运动参数为: 位置 速度 加速度 减速度(单位:Puls)
_axis.MoveAbsolute(postion, speed, speed * 10, speed * 10);
//相对位置运动,参数同上
_axis.MoveRelative(postion, speed, speed * 10, speed * 10);
//扭矩控制,目标扭矩,扭矩斜率
_axis.TorqueControl(1000,100);//扭矩控制,单位为百分比
//速度控制,目标速度,加速度,减速度
_axis.VelocityControl(1000, 100, 100);
//伺服复位
_axis.Reset();
//伺服停止
_axis.Stop(1000000);// 停止减速度
//伺服启动回零
_axis.Home();
//写入寄存器,<写入类型>参数:驱动器地址,索引,子索引,值
_axis.Master.WriteSDO<byte>(1, 0x6060, 0x00, 6);
//读寄存器,<读取类型>参数:驱动器地址,索引,子索引
_axis.Master.ReadSDO<int>(1, 0x6060, 0x00);
//获取输入
_axis.Master.GetInputs(1);//伺服地址
//获取输出
_axis.Master.GetOutputs(1);//伺服地址
//初始化完成后可读取参数
从站名:_axis.SlaveName
从站地址:_axis.SlaveAddr
从站状态:_axis.SlaveState
报警代码:_axis.ErrorCode
状态字:_axis.StatusWord
当前模式:_axis.ModesOperationDisplay
当前位置:_axis.PositionActualValue
当前速度:_axis.VelocityActualValue
控制字:_axis.Controlword
设置模式:_axis.ModesOperation
设置位置:_axis.TargetPosition
设置速度:_axis.ProfileVelocity
设置加速度:_axis.ProfileAcceleration
设置减速度:_axis.ProfileDeceleration
快速停机:_axis.QuickOptionCode
停止代码:_axis.HaltOptionCode
伺服无故障:_axis.AxisState.ReadyToSwitchOn
等待打开伺服使能:_axis.AxisState.SwitchedOn
伺服运行:_axis.AxisState.OperationEnabled
故障:_axis.AxisState.Fault
接通主回路电:_axis.AxisState.VoltageEnabled
快速停机:_axis.AxisState.QuickStop
伺服准备好:_axis.AxisState.SwitchOnDisabled
警告:_axis.AxisState.Warning
远程控制:_axis.AxisState.Remote
目前到达:_axis.AxisState.TargetReached
内部软限位状态:_axis.AxisState.InternalLimitActive
回原点完成输出:_axis.AxisState.HomingAttained
初始化主站
EtherCATMaster _etherCATMaster = new EtherCATMaster();
//初始化从站
IEtherCATSlave _etherCATSlave = new EtherCATSlave(_etherCATMaster, 1)
//启动网卡,查找从站数量,参数为网卡名称
int Count = _etherCATMaster.StartActivity("EtherCatNet");
//停止网卡
_etherCATMaster.StopActivity();
//创建输入索引
TransmitPDOMapping in1 = _etherCATSlave.AddTxPDOMapping(0, typeof(byte));// Inputs数组 索引0
//创建输出索引
ReceivePDOMapping out1 = _etherCATSlave.AddRxPDOMapping(0, typeof(byte));
//控制输出
out1.Value = (byte)0;
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
修复找不到资源的bug