问题描述
using System;
using zaber.Motion;
using zaber.Motion.Ascii;
namespace zaberMotion
{
class Program
{
static Axis x_axis;
static Device device1;
public static void Main(string[] args)
{
Library.EnableDeviceDbStore();
using (var connection = Connection.OpenSerialPort("COM3"))
{
var deviceList = connection.DetectDevices();
Console.WriteLine($"Found {deviceList.Length} devices.");
var speed = x_axis.Settings.Get("maxspeed",Units.VeLocity_MillimetresPerSecond);
Console.WriteLine("Maximum speed [mm/s]: {0}",speed);
x_axis.Settings.Set("maxspeed",speed /9.0,Units.VeLocity_MillimetresPerSecond);
}
}
}
}
我得到了一个无功速度的空值。简单的错误我不确定如何解决。有小费吗?设备初始化,一切顺利
解决方法
您需要先定义设备和轴,然后才能获得轴的设置。
之后:
var deviceList = connection.DetectDevices();
Console.WriteLine($"Found {deviceList.Length} devices.");
包括:
device1 = deviceList[0];
x_axis = device1.GetAxis(1);
麦克麦克唐纳
Zaber 技术
mike@zaber.com