public override bool AddBufIo(object objGroup, string strIoName, bool bVal, int nAxisIndexInGroup = 0) { var nIoIndex = IOMgr.GetInstace().GetOutputDic()[strIoName]._IoIndex; LTSMC.smc_conti_write_outbit(_ConnecNo, 0, (ushort)nIoIndex, (ushort)(bVal ? 1 : 0), 0); return(true); }
public override bool AddBufIo(object objGroup, string strIoName, bool bVal, int nAxisIndexInGroup) { bool bFindIo = false; int nAxisIndex = 0, nIoIndex = 0; if (IOMgr.GetInstace().GetOutputDic() != null) { if (IOMgr.GetInstace().GetOutputDic().ContainsKey(strIoName)) { bFindIo = true; nAxisIndex = IOMgr.GetInstace().GetOutputDic()[strIoName]._AxisIndex; nIoIndex = IOMgr.GetInstace().GetOutputDic()[strIoName]._IoIndex; } } if (!bFindIo) { MessageBox.Show("群组中添加Io,Io没有在配置文件中找到", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } if (nAxisIndexInGroup >= 3 || nAxisIndexInGroup < 0) { MessageBox.Show("轴号在群组的索引超出", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } double[] Point1 = new double[3] { 0, 0, 0 }; if (bVal) { Point1[nAxisIndexInGroup] = ((0x1 << nIoIndex)) << 16 | (0x1 << nIoIndex); } else { Point1[nAxisIndexInGroup] = ((0x1 << nIoIndex)) << 16 | (0x0 << nIoIndex); } uint ArraryElements = 3; IntPtr GpHand = (IntPtr)objGroup; ushort Cmd = (ushort)PathCmd.DOControl; uint reslut = 0; reslut = Motion.mAcm_GpAddPath(GpHand, Cmd, 0, 0, 0, Point1, null // new double[] { 0,0} , ref ArraryElements); return(true); }
public static IOMgr GetInstace() { if (_IOObj == null) { lock (_lock) { if (_IOObj == null) { _IOObj = new IOMgr(); return(_IOObj); } else { return(_IOObj); } } } else { return(_IOObj); } }