APD 추가
- HeadNo(JigNo) PLC API 추가
This commit is contained in:
parent
5b4a856a2e
commit
c6e9783950
@ -33,6 +33,38 @@ namespace ILSOS_CCW_H52A.Device
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
public int WriteWordToBit((eWordOutput addrOffset, int bitNo) address, bool on)
|
||||
{
|
||||
var value = base.ReadWord((int)address.addrOffset, ePLCDevice.W, false);
|
||||
short current = value.data;
|
||||
|
||||
if (on) {
|
||||
current |= (short)(1 << address.bitNo);
|
||||
} else {
|
||||
current &= (short)~(1 << address.bitNo);
|
||||
}
|
||||
|
||||
return base.WriteWord((int)address.addrOffset, current, ePLCDevice.W);
|
||||
}
|
||||
|
||||
public bool ReadWordToBit((eWordInput addrOffset, int bitNo) address)
|
||||
{
|
||||
short current = ReadWord(address.addrOffset).data;
|
||||
return (current & (1 << address.bitNo)) != 0;
|
||||
}
|
||||
public IEnumerable<bool> ReadWordToBits(eWordInput address, bool isLowerFirst = true)
|
||||
{
|
||||
var ret = new List<bool>();
|
||||
int word = ReadWord(address).data;
|
||||
if (isLowerFirst) {
|
||||
for (int idx = 0; idx < 15; idx++)
|
||||
ret.Add((word & (1 << idx)) != 0);
|
||||
} else {
|
||||
for (int idx = 15; idx > 0; idx--)
|
||||
ret.Add((word & (1 << idx)) != 0);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public override void MappingPLCAddr()
|
||||
{
|
||||
|
||||
@ -28,6 +28,7 @@ namespace WeldingCommon.Data
|
||||
table.Columns.Add("Time", typeof(string));
|
||||
table.Columns.Add(nameof(ActualProcessUnit.LotID), typeof(string));
|
||||
table.Columns.Add(nameof(ActualProcessUnit.CellID), typeof(string));
|
||||
table.Columns.Add(nameof(ActualProcessUnit.HeadNo), typeof(string));
|
||||
table.Columns.Add(nameof(ActualProcessUnit.WeldType), typeof(string));
|
||||
table.Columns.Add(nameof(ActualProcessUnit.EncoderCheck), typeof(bool));
|
||||
table.Columns.Add(nameof(ActualProcessUnit.StartPointX), typeof(double));
|
||||
@ -61,7 +62,7 @@ namespace WeldingCommon.Data
|
||||
protected override void InsertItem(int index, ActualProcessUnit item)
|
||||
{
|
||||
base.InsertItem(index, item);
|
||||
table.Rows.Add(item.Date.ToString("yyyy-MM-dd"), item.Date.ToString("HH:mm:ss.fff"), item.LotID, item.CellID, item.WeldType, item.EncoderCheck,
|
||||
table.Rows.Add(item.Date.ToString("yyyy-MM-dd"), item.Date.ToString("HH:mm:ss.fff"), item.LotID, item.CellID, item.HeadNo, item.WeldType, item.EncoderCheck,
|
||||
item.StartPointX, item.StartPointY, item.EndPointX, item.EndPointY,
|
||||
item.WeldCondition, item.LaserOnDelay, item.LaserOffDelay, item.JumpDelay, item.MarkDelay,
|
||||
item.PolygonDelay, item.Power, item.JumpSpeed, item.MarkSpeed, item.JumpX,
|
||||
@ -81,10 +82,10 @@ namespace WeldingCommon.Data
|
||||
private DateTime _Date;
|
||||
public string LotID { get => _LodID; set => SetProperty(ref _LodID, value); }
|
||||
private string _LodID;
|
||||
|
||||
public string CellID { get => _CellID; set => SetProperty(ref _CellID, value); }
|
||||
private string _CellID;
|
||||
|
||||
public string HeadNo { get => _HeadNo; set => SetProperty(ref _HeadNo, value); }
|
||||
private string _HeadNo;
|
||||
public string WeldType { get => _WeldType; set => SetProperty(ref _WeldType, value); }
|
||||
private string _WeldType;
|
||||
public bool EncoderCheck { get => _EncoderCheck; set => SetProperty(ref _EncoderCheck, value); }
|
||||
|
||||
@ -726,6 +726,7 @@ namespace WeldingCommon.Sequences {
|
||||
laserLog.EndPointY = obj.PF2.Y;
|
||||
laserLog.LotID = Status.GetProcessingWeldingData().WorkLotId;
|
||||
laserLog.CellID = Status.GetProcessingWeldingData().WorkCellId;
|
||||
laserLog.HeadNo = Status.GetProcessingWeldingData().WeldingJigNo;
|
||||
Status.GetProcessingWeldingData().APD.Add(laserLog);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user