コード例 #1
0
        /// <summary>
        /// Read the information of the firmware like version, compiled date
        /// </summary>
        void ReadFirmwareInfo()
        {
            var ret = _controller.ReadFWInfo();

            if (ret)
            {
                Messenger.Default.Send(
                    new NotificationMessage <string>(
                        string.Format("{0}", _controller.FirmwareInfo.ToString()),
                        "MSG"));
            }
            else
            {
                Messenger.Default.Send(
                    new NotificationMessage <string>(
                        string.Format("Unable to read firmware info."),
                        "Error"));
            }
        }
コード例 #2
0
        /// <summary>
        /// Initialize the motion controller
        /// </summary>
        /// <returns></returns>
        protected override bool CustomInitProcess()
        {
            _controller.OpenDevice();
            if (_controller.IsConnected)
            {
                if (_controller.ReadFWInfo())
                {
                    LogHelper.WriteLine("{0}, firmware version {1}", this, _controller.FirmwareInfo);

                    // pass the configurations to the instance of irixi motion controller class
                    for (int i = 0; i < this.AxisCollection.Count; i++)
                    {
                        var axis        = this.AxisCollection[i.ToString()] as IrixiAxis;
                        var axis_of_sdk = _controller.AxisCollection[i];

                        axis_of_sdk.SoftCCWLS         = 0;
                        axis_of_sdk.SoftCWLS          = axis.UnitHelper.MaxSteps;
                        axis_of_sdk.MaxSteps          = axis.UnitHelper.MaxSteps;
                        axis_of_sdk.MaxSpeed          = axis.MaxSpeed;
                        axis_of_sdk.AccelerationSteps = axis.AccelerationSteps;

                        // reverse the drive directoin
                        if (axis.ReverseDriveDirecton)
                        {
                            _controller.ReverseMoveDirection(i, true);
                        }
                    }

                    return(true);
                }
                else
                {
                    LogHelper.WriteLine("{0}, unable to read the firmware info, {1}", this, _controller.LastError);
                    return(false);
                }
            }
            else
            {
                this.LastError = _controller.LastError;
                return(false);
            }
        }