纽伯帮忙。发送串行数据 [英] Newbe help. Sending serial data

查看:61
本文介绍了纽伯帮忙。发送串行数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我是视觉VB的新手,我正在尝试与外界建立通信。

。我找到了下面在

Microsoft Visual Basic 2005 Express Edition的帮助部分中列出的示例。使用超级终端

应该能够看到字符串Hello还是我完全离开了基地

?提前感谢所有人和任何帮助。

祝你好运,Ken


Sub SendSerialData(ByVal data As String)

''将字符串发送到串口。

使用com1作为IO.Ports.SerialPort = _

My.Computer.Ports.OpenSerialPort(" COM1")

com1.WriteLine(" Hello")

结束使用

End Sub

Hello everyone,
I''m new to visual VB and I am trying to setup communications to the
outside world. I found the example listed below in the help section of
Microsoft Visual Basic 2005 Express Edition. Using the Hyper Terminal
should I be able to see the string "Hello" or am I completely off base
here? Thank you in advance for all and any help.
Best regards, Ken

Sub SendSerialData(ByVal data As String)
'' Send strings to a serial port.
Using com1 As IO.Ports.SerialPort = _
My.Computer.Ports.OpenSerialPort("COM1")
com1.WriteLine("Hello")
End Using
End Sub

推荐答案

通常一次只有一台计算机可以看到一个串口。

有时您可以找到串行线路分析工具,它们将允许您分析和同时发送,

然而我不知道它们是如何工作的。我不知道

你可能会找到一个与内置端口配合使用的产品。我已经使用了

一些Moxa软件可以让你做到这一点,但很难得到

持有。


更简单的解决办法就是让两台PC'在你的VB端口上通过Comm端口发送



连接到另一端的Comm端口电脑运行

超级终端接收数据。



如果您的电脑有2个通讯端口,请将其中一个连接到另一个

然后您可以使用VB App发送一个

并使用Hyperterminal接收另一个...


希望这有助于

问候

克里斯

Only one computer can see a serial port at a time usually.
Sometimes you can find Serial Line Analysing tools that will
allow you to analyse and send at the same time,
however I''ve no idea how they work. I don''t know
where you might find one that works with built in ports. I have used
some Moxa software that will allow you to do this, but it''s hard to get
hold of.

The easier soloution is to have either 2 PC''s where
you have the VB App sending on a Comm port
connected to a Comm port on the other PC running
Hyperterminal receiving the data.
OR
If your PC has 2 comm ports, connect one to the other
and You can then send on one with the VB App
and use Hyperterminal to receive on the other...

Hope this helps
Regards
Chris


应该阅读的道歉

只有一个;处理"通常可以一次使用串口

你的VB应用程序就是那个进程。

Apologies that should read
Only one "Process" can use a serial port at a time usually
Your VB App would be that Process.


这是你要传达的信息从HyperTerminal获取如果

您尝试从正在发送的端口读取

另一个程序正在使用所选的电话设备

再试一次程序完成后

Here is the message you will get from HyperTerminal If
you try to read from a port that is sending
"Another program is using the selected Telephony Device
Try again after the program completes"


这篇关于纽伯帮忙。发送串行数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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