This commit is contained in:
@@ -17,39 +17,50 @@
|
||||
public ushort PressureRegisterStation1 { get; set; }
|
||||
public ushort PressureRegisterStation2 { get; set; }
|
||||
public ushort PressureRegisterStation3 { get; set; }
|
||||
public ushort PressureModeRegister { get; set; }
|
||||
public ushort PressCoil { get; set; }
|
||||
public ushort StartCoil { get; set; }
|
||||
public ushort EnableCoil { get; set; }
|
||||
public ushort StopCoil { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public ushort PressureUpperLimit { get; set; } = 300;
|
||||
public ushort PressureRate { get; set; } = 280;
|
||||
public ushort PressureCoeff { get; set; } = 282;
|
||||
public ushort HPCoeff1 { get; set; } = 3120;
|
||||
public ushort LPCoeff1 { get; set; } = 3122;
|
||||
public ushort HPCoeff2 { get; set; } = 3124;
|
||||
public ushort LPCoeff2 { get; set; } = 3126;
|
||||
public ushort HPCoeff3 { get; set; } = 3128;
|
||||
public ushort LPCoeff3 { get; set; } = 3130;
|
||||
public ushort LargeFlowCoeff1 { get; set; } = 3048;
|
||||
public ushort SmallFlowCoeff1 { get; set; } = 380;
|
||||
public ushort LargeFlowCoeff2 { get; set; } = 1218;
|
||||
public ushort SmallFlowCoeff2 { get; set; } = 1318;
|
||||
public ushort LargeFlowCoeff3 { get; set; } = 1418;
|
||||
public ushort SmallFlowCoeff3 { get; set; } = 1468;
|
||||
public ushort FlowModeRegister1 { get; set; } = 5; // 工位1流量模式 (0=大,1=小)
|
||||
public ushort FlowModeRegister2 { get; set; } = 6;
|
||||
public ushort FlowModeRegister3 { get; set; } = 7;
|
||||
// 校准系数地址(需与PLC约定)
|
||||
public ushort PressureCalibZero { get; set; } = 3200;
|
||||
public ushort PressureCalibSpan { get; set; } = 3202;
|
||||
public ushort FlowCalibZero { get; set; } = 3204;
|
||||
public ushort FlowCalibSpan { get; set; } = 3206;
|
||||
|
||||
|
||||
// 设备参数地址(示例,请根据实际PLC地址修改)
|
||||
public ushort UpperLampData1 { get; set; } = 350;
|
||||
public ushort UpperLampData2 { get; set; } = 351;
|
||||
public ushort UpperLampData3 { get; set; } = 352;
|
||||
public ushort UpperLampData4 { get; set; } = 353;
|
||||
public ushort UpperLampData5 { get; set; } = 354;
|
||||
public ushort UpperLampData6 { get; set; } = 355;
|
||||
|
||||
public ushort LowerLampData1 { get; set; } = 356;
|
||||
public ushort LowerLampData2 { get; set; } = 357;
|
||||
public ushort LowerLampData3 { get; set; } = 358;
|
||||
public ushort LowerLampData4 { get; set; } = 359;
|
||||
public ushort LowerLampData5 { get; set; } = 360;
|
||||
public ushort LowerLampData6 { get; set; } = 361;
|
||||
|
||||
public ushort LeftEyeAreaCoeff { get; set; } = 212;
|
||||
public ushort RightEyeAreaCoeff { get; set; } = 214;
|
||||
public ushort SaveRateCorrectionCoeff { get; set; } = 428;
|
||||
|
||||
public ushort MiddleLamp1 { get; set; } = 362;
|
||||
public ushort MiddleLamp2 { get; set; } = 363;
|
||||
public ushort MiddleLamp3 { get; set; } = 364;
|
||||
public ushort MiddleLamp4 { get; set; } = 365;
|
||||
public ushort MiddleLamp5 { get; set; } = 366;
|
||||
public ushort MiddleLamp6 { get; set; } = 367;
|
||||
public ushort MiddleLamp7 { get; set; } = 368;
|
||||
|
||||
public ushort MotorLimit { get; set; } = 330;
|
||||
public ushort ResetCompensation { get; set; } = 340; // 新增复位补偿
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +69,11 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
public enum ParameterDataType
|
||||
{
|
||||
Int16, // 16位整数
|
||||
Float32 // 32位浮点数
|
||||
}
|
||||
|
||||
|
||||
public interface IPlcService
|
||||
@@ -75,6 +90,10 @@
|
||||
Task<ushort[]> ReadHoldingRegistersAsync(ushort startAddress, ushort count);
|
||||
|
||||
Task WriteSingleRegisterAsync(ushort registerAddress, ushort value);
|
||||
|
||||
float UshortToFloat(ushort P1, ushort P2);
|
||||
|
||||
Task WriteMultipleRegistersAsync(ushort registerAddress, float value);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user