|
|
|
@ -57,7 +57,7 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
|
ioCard.Name = name;
|
|
|
|
|
ioCard.Vender = vender;
|
|
|
|
|
ioCard.IsEtherCat = isEthercat;
|
|
|
|
|
ioCard.Init(inNum, outNum, (ushort)slaveID);
|
|
|
|
|
ioCard.Init((short)cardID,inNum, outNum, (ushort)slaveID);
|
|
|
|
|
bool suc = XmlSerializerHelper.Instance.Serialize<GLinkIOCard>(filename, ioCard);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -78,13 +78,16 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
|
public override ErrorCode Init()
|
|
|
|
|
{
|
|
|
|
|
SqliteHelper db = new SqliteHelper();
|
|
|
|
|
DataTable dt = db.GetDataTable("select * from motioncard where vender='gugao' order by id dec");
|
|
|
|
|
DataTable dt = db.GetDataTable("select * from motioncard where vender='gugao' order by id desc");
|
|
|
|
|
if(dt!=null&&dt.Rows.Count>0)
|
|
|
|
|
{
|
|
|
|
|
foreach (DataRow row in dt.Rows)
|
|
|
|
|
{
|
|
|
|
|
ICard card = new GugaoPulseCard(ushort.Parse(row["cardid"].ToString()), 8, $"gugaopulse{row["cardid"]}.xml");
|
|
|
|
|
card.Init();
|
|
|
|
|
cardDic.Add(ushort.Parse(row["cardid"].ToString()), card);
|
|
|
|
|
//打开运动控制卡
|
|
|
|
|
apiResult = mc_pulse.GT_Open((short)row["cardid"], 0, 1);
|
|
|
|
|
apiResult = mc_pulse.GT_Open(short.Parse(row["cardid"].ToString()), 0, 1);
|
|
|
|
|
if (apiResult != 0)
|
|
|
|
|
{
|
|
|
|
|
return ErrorCode.CardInitFail;
|
|
|
|
@ -95,9 +98,7 @@ namespace Rs.Motion.GugaoPulse
|
|
|
|
|
{
|
|
|
|
|
return ErrorCode.Fail;
|
|
|
|
|
}
|
|
|
|
|
ICard card = new GugaoPulseCard((ushort)row["cardid"], 8, $"gugao{row["cardid"]}.xml");
|
|
|
|
|
card.Init();
|
|
|
|
|
cardDic.Add((ushort)row["cardid"], card);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
IsInitialized = true;
|
|
|
|
|