WPF按钮将字符串发送到串行端口 [英] WPF button that sends string to Serial Port

查看:70
本文介绍了WPF按钮将字符串发送到串行端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有一个有关发送字符串的问题,该字符串将命令旧的80年代机器人.在你们的帮助下,我已经通过USB串行端口与机器人建立了连接:)

Hi there I have a question regarding sending a string that will command an old 80s robot. I have made the connection to the robot via USB-Serial Port with help from you guys :)

现在,我需要分配看起来像这样的不同代码字符串::01013100010010"

Now I need to assign different strings of code that look like this :":01013100010010"

每个代码都控制机器人的六个步进电机之一.

Every single code controls one of the six step-motors of the robot.

我需要帮助为6个(我有6个电机)不同的"+"和-"按钮分配不同的命令,这些按钮将控制机器人向左或向右移动.

I need help assigning different commands to 6 (I have 6 motors) different "+" and "-" buttons that will control the robot to go for example left or right.

我不知道的另一个问题是应该使用"button1_Click"还是"button1_MouseDown and up"?我所需要做的就是单击按钮,然后机器人向左或向右走1步,而不是一直向左或向右走.

Another I don't know is should I use the "button1_Click" or "button1_MouseDown and up"? All I need is to click on the button and the robot to go 1 step left or one step right, not all the way it can go to left or right.

希望你们能提供帮助!

谢谢!

推荐答案

我认为这取决于您控制该设备的设备,该设备可能需要某种驱动程序进行通信,因为由于以下原因,它可能至少需要COM Interop.年龄

I think it depends on the the device your controlling the device would likely need some sort of driver to communicate since it will likely require COM Interop at minimum due to the age

如果您试图通过它来破解自己的方式,除非拥有协议文档,否则您将度过更加艰难的时光

if your trying to hack your way through it your going to have a much more difficult time unless you have the protocol documentation

如果您确定可以与您的BOT通信,则此

if you have determined that you can communicate with your BOT then this article may help you out

如果还有兼容的驱动程序,您可能想要尝试使用Microsoft Robotics Studio,该软件可以帮助您为机器人提供一些控制代码,从听起来似乎不可行的年代开始,

also if there is a compatible driver for it you may want to try out Microsoft Robotics Studio which could help you with some of the cotrol code for your robot, judging from the age it sounds to be a bit unlikely there will be a compatible driver for it tho

这篇关于WPF按钮将字符串发送到串行端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆