使用SerialPort.Write()将命令发送到Com端口 [英] Send Command to Com port using SerialPort.Write()

查看:1229
本文介绍了使用SerialPort.Write()将命令发送到Com端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一种软​​件来与访问控制设备进行通信。在满足一些要求后,我需要发送以下命令:## $ 01W#0001 $ 0D $ 0A到rs232端口使用 SerialPort .Write



我试图通过Hercules Utility发送命令,只是为了检查命令是否正常,它是否有效精细。

但我的代码似乎根本不起作用。我做错了什么?

I'm developing a software to comunicate to a access control device. I need, after meet some requirements, to send the following command: "##$01W#0001$0D$0A" to rs232 port using SerialPort.Write.

I've tried to send the command via Hercules Utility, just to check if the command is ok, and it works fine.
But my code doesn't seem to work at all. What am i doing wrong?

SerialPort.Write("##$01W#0001$0D$0A")

推荐答案

01W#0001


0D


0A到rs232端口使用 SerialPort.Write



我试图通过Hercules Utility发送命令,只是为了检查命令是否正常,它运行正常。

但我的代码似乎根本不起作用。我做错了什么?

0A" to rs232 port using SerialPort.Write.

I've tried to send the command via Hercules Utility, just to check if the command is ok, and it works fine.
But my code doesn't seem to work at all. What am i doing wrong?
SerialPort.Write("##


这篇关于使用SerialPort.Write()将命令发送到Com端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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