You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
3.2 KiB
114 lines
3.2 KiB
using Bodk.Device.Storage.EventArgs;
|
|
|
|
namespace Bodk.Device.Storage.Modules;
|
|
|
|
public class CryogenicRackGripper1(
|
|
Action<object?, AlarmChangedEventArg> alarmEventHandler,
|
|
Action<object?, MotionTimeoutAlarmChangedEventArg> motionTimeoutAlarmEventHandler,
|
|
Func<ushort, bool[], Task> writeCoilRegisterFunc,
|
|
Func<ushort, ushort, Task<bool[]>> readCoilRegisterFunc,
|
|
Func<ushort, ushort, Task<ushort[]>> readHoldingRegistersFunc,
|
|
Func<ushort, ushort[], Task> writeHoldingRegistersFunc)
|
|
: ModuleBase(alarmEventHandler, motionTimeoutAlarmEventHandler, writeCoilRegisterFunc, readCoilRegisterFunc,
|
|
readHoldingRegistersFunc, writeHoldingRegistersFunc)
|
|
{
|
|
public override string Name => "CryogenicRackGripper1";
|
|
public override string Descirption => "冻存架夹爪1";
|
|
public override int Id => 2;
|
|
|
|
internal override ushort? EnableAddress => 101;
|
|
|
|
internal override ushort? ResetAddress => 121;
|
|
|
|
internal override ushort? CleanAddress => 141;
|
|
|
|
internal override ushort? GotoOriginAddress => 161;
|
|
|
|
internal override ushort? ForwardAddress => 181;
|
|
|
|
internal override ushort? BackwardAddress => 201;
|
|
|
|
internal override ushort? RelativeMoveAddress => 221;
|
|
|
|
internal override ushort? AbsoluteMoveAddress => 241;
|
|
|
|
internal override ushort? MotionTimeoutAlarmAddress => 281;
|
|
|
|
internal override ushort? AlarmAddress => 301;
|
|
|
|
internal override ushort? IsEnabledAddress => 331;
|
|
|
|
internal override ushort? OriginFlagAddress => 351;
|
|
|
|
internal override ushort? MoveDistanceAddress => 102;
|
|
|
|
internal override ushort? CurrentPositionAddress => 126;
|
|
|
|
internal override ushort? ManualSpeedAddress => 1002;
|
|
|
|
internal override ushort? AutoSpeedAddress => 1042;
|
|
|
|
internal override ushort? AccDecAddress => 1082;
|
|
|
|
internal override ushort? GotoOriginHighSpeedAddress => 1122;
|
|
|
|
internal override ushort? GotoOriginLowSpeedAddress => 1146;
|
|
|
|
internal ushort ReleasePositionAddress => 1370;
|
|
|
|
internal ushort HoldingPositionAddress => 1372;
|
|
|
|
/// <summary>
|
|
/// 松开夹爪
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public async Task Release()
|
|
{
|
|
var des = await ReadFloat(ReleasePositionAddress);
|
|
await AbsoluteMoveAsync(des);
|
|
}
|
|
|
|
public async Task Holding()
|
|
{
|
|
var des = await ReadFloat(HoldingPositionAddress);
|
|
await AbsoluteMoveAsync(des);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 松开位
|
|
/// </summary>
|
|
public float ReleasePosition
|
|
{
|
|
get
|
|
{
|
|
_releasePosition ??= ReadFloat(ReleasePositionAddress).Result;
|
|
return _releasePosition.Value;
|
|
}
|
|
set
|
|
{
|
|
_releasePosition = value;
|
|
WriteFloat(ReleasePositionAddress, value);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 夹紧位
|
|
/// </summary>
|
|
public float HoldingPosition
|
|
{
|
|
get
|
|
{
|
|
_holdingPosition ??= ReadFloat(HoldingPositionAddress).Result;
|
|
return _holdingPosition.Value;
|
|
}
|
|
set
|
|
{
|
|
_holdingPosition = value;
|
|
WriteFloat(HoldingPositionAddress, value);
|
|
}
|
|
}
|
|
|
|
private float? _releasePosition;
|
|
|
|
private float? _holdingPosition;
|
|
}
|