示例#1
0
        /// <summary>
        /// 读取PLC中存储的点位数据,以便编辑
        /// </summary>
        private void ReadPLCPointData()
        {
            switch (curReadCoordinate)
            {
            case ReadPointState.None:
                comm.ReadDMDatas(dm250, 5);
                break;

            case ReadPointState.ReadX1:
                comm.ReadDMData(dm2000 + pointIndex * 2);
                break;

            case ReadPointState.ReadZ1:
                comm.ReadDMData(dm2000 + 100 + pointIndex * 2);
                break;

            case ReadPointState.ReadY:
                comm.ReadDMData(dm2000 + 200 + pointIndex * 2);
                break;

            case ReadPointState.ReadX2:
                comm.ReadDMData(dm2000 + 300 + pointIndex * 2);
                break;

            case ReadPointState.ReadZ2:
                comm.ReadDMData(dm2000 + 400 + pointIndex * 2);
                break;

            case ReadPointState.ReadDp:
                comm.ReadDMData(dm2000 + 500 + pointIndex * 2);
                break;

            case ReadPointState.Readm:
                comm.ReadDMData(dm2000 + 600 + pointIndex * 2);
                break;

            default:
                break;
            }
        }