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.
36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using Mesnac.Action.Base;
|
|
using Mesnac.Equips;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Mesnac.Action.Compressor.Test
|
|
{
|
|
class TestAction : DatabaseAction, IAction
|
|
{
|
|
BaseEquip _equip;
|
|
public void FindPLC(string plcname)
|
|
{
|
|
foreach (BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
{
|
|
if (equip.Name == plcname)
|
|
{
|
|
_equip = equip;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
public void Run(RuntimeParameter runtime)
|
|
{
|
|
base.RunIni(runtime); //必须调用
|
|
ShowMsg("Action事件测试", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
FindPLC("A4");
|
|
object[] data = new object[1];
|
|
data[0] = 9;//对照与PLC定义的点位信息
|
|
bool iflag = _equip.Write(int.Parse(_equip.Group["B2"].Block), _equip.Group["B2"].Start, data);
|
|
}
|
|
}
|
|
}
|