You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Rs.Framework;
|
|
|
|
|
using Rs.Motion.Base;
|
|
|
|
|
using Rs.Motion.GugaoPulse;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace Rs.Motion.GugaoEcat
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 总线卡
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable]
|
|
|
|
|
[XmlInclude(typeof(ECatIO))]
|
|
|
|
|
public class ECatIOCard : IIOCard
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public ECatIOCard()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Init(short cardID,ushort inCount, ushort outCount, ushort slaveNo)
|
|
|
|
|
{
|
|
|
|
|
ushort i = 0;
|
|
|
|
|
for (; i < outCount; i++)
|
|
|
|
|
{
|
|
|
|
|
ECatIO io = new ECatIO();
|
|
|
|
|
io.CardID= cardID;
|
|
|
|
|
io.SlaveNo = slaveNo;
|
|
|
|
|
io.Offset = 0;
|
|
|
|
|
io.Index = i;
|
|
|
|
|
io.Name = "Out" + i + "_" + slaveNo;
|
|
|
|
|
DOut.Add(io);
|
|
|
|
|
}
|
|
|
|
|
for (; i < outCount + inCount; i++)
|
|
|
|
|
{
|
|
|
|
|
ECatIO io = new ECatIO();
|
|
|
|
|
io.CardID = cardID;
|
|
|
|
|
io.SlaveNo = slaveNo;
|
|
|
|
|
io.Offset = 0;
|
|
|
|
|
io.Index = i;
|
|
|
|
|
io.Name = "In" + i + "_" + slaveNo;
|
|
|
|
|
DIn.Add(io);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public override void Save()
|
|
|
|
|
{
|
|
|
|
|
string filename = $"config/motion/io/gugao_ecat{CardID}.xml";
|
|
|
|
|
XmlSerializerHelper.Instance.Serialize<ECatIOCard>(filename, this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|