最近在学视觉手眼标定这块,用的C#联合halcon,C#这块不太熟,在网口通讯这块一直不知道怎么把机器人发回的数据解析显示出来,比如我要实时读取机械手坐标,中间可能又要发指令让机械手移动,或要读取机械中的某个变量,我试过用按钮触发一条发送指令,是没问题的,但接收的数据怎么弄就不知道了,数据会不会堵塞,还是应该每发一条指令立即把数据读出来,还望各位大佬解惑。
2条回答 默认 最新
- 一贝水双鱼 2019-12-29 19:19关注
You have to know some instructions of control robot,
example
1.Set Power On/off send message "@MOTOR ON/OFF\r\n" socket will receive "RUN\r\nEND\r\n"
2.Get Current postion send message "@? WHRXY\r\n" socket will receive "xxxxxxx yyyyyy rrrrrrr zzzzzz" x y r z of number
3.Set jog spedd send message "@MSPEED5\r\n" socket will receive "OK\r\n"
befor example know send message will receive message
if want to use C# socket ,
frist send message use Socket.Send method
second recive message use Socket.Receive method and check end bytes according to messageattention: must set timeout and connnect error
good luck解决 1无用