XP中的串行端口访问 [英] Serial Port Access in XP

查看:69
本文介绍了XP中的串行端口访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我想在XP中访问串口。我正在使用Dev-C ++ IDE,

使用Mingw作为编译器。我只是想知道如何在COM1上打开串口

端口并写入一些数据。我在

网页上搜索了一下,找不到任何有用的东西。我不想使用Visual C ++

或者Cygwin,linux等等。如果你们中的任何一个人有一点点代价那么好的b $ b代码对我来说很棒看看。

解决方案

sh * *****@gmail.com 写道:


我试图在XP中访问串口。我正在使用Dev-C ++ IDE,

使用Mingw作为编译器。我只是想知道如何在COM1上打开串口

端口并写入一些数据。



你的帖子是comp.lang.c的偏离主题。请访问

http:// www。 ungerhu.com/jxh/clc.welcome.txt
http:// c -faq.com
http:// benpfaff.org/writings/clc/off-topic.html


用于发布指南和常见问题解答。谢谢。


-

C. Benson Manica |我*应该*知道我在说什么 - 如果我

cbmanica(at)gmail.com |不,我需要知道。火焰欢迎。



sh ****** @ gmail.com 写道:





我想在XP中访问串口。我正在使用Dev-C ++ IDE,

使用Mingw作为编译器。我只是想知道如何在COM1上打开串口

端口并写入一些数据。我在

网页上搜索了一下,找不到任何有用的东西。我不想使用Visual C ++

或者Cygwin,linux等等。如果你们中的任何一个人有一点点代价那么好的b $ b代码对我来说很棒看着。



你好 - 这真的不是太糟糕。看一下本指南:
http://www.robbayer.com/cgi-bin/load.cgi?serial-win.pdf


我假设你不需要重叠

通信(你在同一时间发送和接收)。

如果你这样做,它会变得更复杂,因为你需要申请

多线程。他们在MSDN网站上了解了如何做到这一点。


好​​运!


-Mike


" NL ****** @ gmail.com" < nl ****** @ gmail.comwrites:

sh *** ***@gmail.com 写道:


>我正在尝试访问XP中的串行端口。我正在使用Dev-C ++ IDE,它使用Mingw作为编译器。我只是想知道如何在COM1上打开串口
端口并写入一些数据。我在网页上搜索了很多,找不到任何有用的东西。我不想使用Visual C ++
或Cygwin,linux等等。如果你们中的任何一个人都有一点点代码可以很好看。



你好 - 这真的不是太糟糕。看一下本指南:
http://www.robbayer.com/cgi-bin/load.cgi?serial-win.pdf


我假设你不需要重叠

通信(你在同一时间发送和接收)。

如果你这样做,它会变得更复杂,因为你需要申请

多线程。他们在MSDN网站上讨论了如何做到这一点。



不幸的是,我们这里很少有人能够评估你的建议

是否有效,或者是否有更好的解决方案。 OP应该发布一个处理Windows XP的新闻组。
。很可能他会得到同样的建议,但是Windows专家可以进一步讨论它。


-

Keith Thompson(The_Other_Keith) ks***@mib.org < http:/ /www.ghoti.net/~kst>

圣地亚哥超级计算机中心< *< http://users.sdsc.edu/~kst>

我们必须做一点事。这是事情。因此,我们必须这样做。


Hi,

I am trying to access Serial Port in XP. I am using Dev-C++ IDE that
uses Mingw as a compiler. I just want to know how I can open up serial
port on COM1 and write some data. I have searched quite a bit over the
web and could not find anything useful. I don''t want to use Visual C++
or Cygwin, linux, etc. If any of you guys have some little tid bit of
code that would be great to look at.

解决方案

sh******@gmail.com wrote:

I am trying to access Serial Port in XP. I am using Dev-C++ IDE that
uses Mingw as a compiler. I just want to know how I can open up serial
port on COM1 and write some data.

Your post is off-topic for comp.lang.c. Please visit

http://www.ungerhu.com/jxh/clc.welcome.txt
http://c-faq.com
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.

--
C. Benson Manica | I *should* know what I''m talking about - if I
cbmanica(at)gmail.com | don''t, I need to know. Flames welcome.



sh******@gmail.com wrote:

Hi,

I am trying to access Serial Port in XP. I am using Dev-C++ IDE that
uses Mingw as a compiler. I just want to know how I can open up serial
port on COM1 and write some data. I have searched quite a bit over the
web and could not find anything useful. I don''t want to use Visual C++
or Cygwin, linux, etc. If any of you guys have some little tid bit of
code that would be great to look at.

Hi there - it really ain''t too bad to do. Take a look at this guide:
http://www.robbayer.com/cgi-bin/load.cgi?serial-win.pdf

I am making the assumption that you do not need overlapped
communication (where you are sending and receiving at the same time).
If you do, it gets more complicated as you need the application to be
multi-threaded. They go over how to do that on the MSDN website.

Best of luck!

-Mike


"nl******@gmail.com" <nl******@gmail.comwrites:

sh******@gmail.com wrote:

>I am trying to access Serial Port in XP. I am using Dev-C++ IDE that
uses Mingw as a compiler. I just want to know how I can open up serial
port on COM1 and write some data. I have searched quite a bit over the
web and could not find anything useful. I don''t want to use Visual C++
or Cygwin, linux, etc. If any of you guys have some little tid bit of
code that would be great to look at.


Hi there - it really ain''t too bad to do. Take a look at this guide:
http://www.robbayer.com/cgi-bin/load.cgi?serial-win.pdf

I am making the assumption that you do not need overlapped
communication (where you are sending and receiving at the same time).
If you do, it gets more complicated as you need the application to be
multi-threaded. They go over how to do that on the MSDN website.

Unfortunately, few of us here are able to evaluate whether your advice
is valid, or whether there''s a better solution. The OP should post to
a newsgroup that deals with Windows XP. Quite possibly he''d get the
same advice, but the Windows experts would be able to discuss it
further.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.


这篇关于XP中的串行端口访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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