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.
50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using Rs.Framework;
|
|
using Rs.Motion.Base;
|
|
using Rs.Motion.Ztm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace Rs.Motion.Leisai
|
|
{
|
|
/// <summary>
|
|
/// GLink卡
|
|
/// </summary>
|
|
[XmlInclude(typeof(LeisaiIO))]
|
|
public class LeisaiIOCard : IIOCard
|
|
{
|
|
public override void Init(short cardID,ushort inCount, ushort outCount, ushort slaveNo)
|
|
{
|
|
for (ushort i = 0; i < outCount; i++)
|
|
{
|
|
LeisaiIO io = new LeisaiIO();
|
|
io.SlaveNo = slaveNo;
|
|
io.CardID = cardID;
|
|
io.CardID = (short)CardID;
|
|
io.Name = "Out" + i + "_" + slaveNo;
|
|
io.Index = i;
|
|
DOut.Add(io);
|
|
}
|
|
for (ushort i = 0; i < inCount; i++)
|
|
{
|
|
LeisaiIO io = new LeisaiIO();
|
|
io.SlaveNo=slaveNo;
|
|
io.CardID = cardID;
|
|
io.Card = this;
|
|
io.Name = "In" + i + "_" + slaveNo;
|
|
io.Index = i;
|
|
DIn.Add(io);
|
|
}
|
|
}
|
|
|
|
public override void Save()
|
|
{
|
|
string filename = $"config/motion/io/leisai{CardID}.xml";
|
|
XmlSerializerHelper.Instance.Serialize<LeisaiIOCard>(filename, this);
|
|
}
|
|
}
|
|
}
|