首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使用Zaber控制台脚本保持特定位置?

如何使用Zaber控制台脚本保持特定位置?
EN

Stack Overflow用户
提问于 2017-03-15 23:46:11
回答 1查看 325关注 0票数 1

我正在尝试写一个简单的脚本使用Zaber控制台。我基本上必须把我的机械臂移动到一个特定的位置(即43.9毫米),保持这个位置10分钟,然后回到原来的位置。

我找到了移动的所有命令(快/慢和一定的加速度),但我不能理解如何让机器停留在43.9 to的中毒状态10分钟。

有什么建议吗?我用“这门语言”写代码:

代码语言:javascript
运行
复制
if(PortFacade.Port.IsAsciiMode)
{
    Conversation.Request("move abs", 881890);
    Conversation.PollUntilIdle();
}
else
{
    Conversation.Request(Command.MoveAbsolute, 881890);
}

非常感谢。

里卡多

EN

回答 1

Stack Overflow用户

发布于 2017-03-16 08:19:19

您可以在此处找到脚本页面:http://www.zaber.com/wiki/Software/Zaber_Console/Scripting

脚本中的语言使用的是C#,可以像这样编写一个快速程序来执行您想要做的事情:

代码语言:javascript
运行
复制
#template(simple)
var device1 = PortFacade.GetConversation(1); // This is assuming your device
// is device 1 in the chain. 
// The device list in Zaber Console will let you know the device number.
// Alternatively, you can use the renumber command to change the device number.


device1.Request("move abs 100000"); //the data value for 43.9 mm will vary 
// from device to device. The formula would be 43.9[mm]/ Microstep size[mm] = Data value
// The microstep size can be found on the product page at www.Zaber.com, or 
// email Contact@Zaber.com
Sleep(5000); //Sleep is in milliseconds
device1.Request("move abs 0"); 

如果您有任何问题,请不要犹豫,给Contact@Zaber.com发邮件。

致以敬意,

阿尔伯特

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42814552

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档