Hi!
I read from emulated serial port (whit usb).It works correctly but with the condition of waitcommevent doesnt. How can use correct the serial events? - use Win32;
-
use Win32API::CommPort;
-
use Win32API::File;
-
-
-
$PortObj= new Win32API::CommPort ('com4')
-
|| die "Can't open PortName: $^E\n";
-
-
-
while(1)
-
{
-
-
-
if ( ($PortObj->WaitCommEvent('com4', EV_RXCHAR , )) )
-
{
-
$count_in=$PortObj->read_bg( 1);
-
( $done, $count_in, $string_in) = $PortObj->read_done(1);
-
print("$string_in\n");
-
}
-
}
Thanks!
5 2399
I have no idea. Maybe someone else will.
first off use strict if you can,
second:
try put this on one line, - $PortObj= new Win32API::CommPort ('com4')
-
|| die "Can't open PortName: $^E\n";
try - if ( ($PortObj->WaitCommEvent(com4, EV_RXCHAR, ERROR_IO_INCOMPLETE )) )
-
{
don't forget to take out ' ' for your handle.
or - if ( ($PortObj->WaitCommEvent(com4, EV_RXCHAR, )) )
-
{
usage for above: - WaitCommEvent($handle, $Event_Bitmask, $lpOverlapped);
first off use strict if you can,
second:
try put this on one line, - $PortObj= new Win32API::CommPort ('com4')
-
|| die "Can't open PortName: $^E\n";
try - if ( ($PortObj->WaitCommEvent(com4, EV_RXCHAR, ERROR_IO_INCOMPLETE )) )
-
{
don't forget to take out ' ' for your handle.
or - if ( ($PortObj->WaitCommEvent(com4, EV_RXCHAR, )) )
-
{
usage for above: - WaitCommEvent($handle, $Event_Bitmask, $lpOverlapped);
Thanks for help!
I try the code whit use strict but the following message come in promt shell: Bareword "EV_RXCHAR" not allowed while "stricts sub" in use
and same for com4 and ERROR_IO_INCOMPLETE.
Itry this to: -
if ( ($PortObj->WaitCommEvent('com4', 'EV_RXCHAR' , )) )
its run but doesnt work like without strict.
any other idea?
Thanks!
Thanks for help!
Itry this to: -
if ( ($PortObj->WaitCommEvent('com4', 'EV_RXCHAR' , )) )
!
did you try: - if ( ($PortObj->WaitCommEvent(com4, 'EV_RXCHAR' , )) )
if so please get back to me with all errors.
thanks
did you try: - if ( ($PortObj->WaitCommEvent(com4, 'EV_RXCHAR' , )) )
if so please get back to me with all errors.
thanks
yes I try all variations : whit srtict and whitout ' ', combackwhit errror:not allowed while "stricts sub" in use
when i use ' ' its run but doesnt use event
Thank you!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andreas Horneff |
last post by:
Hi @ all,
I've got a problem with serial communication in Borland C++ Builder. I've
already found a
lot of stuff about serial communication in the internet, but it dosen't
work.
What I want...
|
by: carmen |
last post by:
I'm working in an aplication for a Smart Device that need to "talk" with a
printer continuosly through the serial port. I'm trying to use the John
Hint's sample code "Use P/Invoke to develop a .NET...
|
by: Vidya Bhagwath |
last post by:
Hello Experts,
I am porting the C++ code into the Visual C#.NET. My C++ code is
mainly based on the serial communication. So I am using the windows
structure such as DCB.. etc and the windows...
|
by: Leandro Berti via DotNetMonster.com |
last post by:
Hi All,
I wrote a code to do serial communication with an equipament.
When i use the code outside of threaded class it seens work properly,
but when i put inside a class and execute a thread in...
|
by: Manu |
last post by:
Hi,
i need to know how i can interface to RS232 with VC++.NET (MFC). In the old
VC++ 6.0 there is the MSCOMM32 component, i read i can use it but there are
some license problems. Is there some low...
|
by: joe bloggs |
last post by:
I am writing a mobile application to interface with a legacy system and I am
planning to use web services to communicate with this system. The legacy
system receives data through a serial port. ...
|
by: max_mont |
last post by:
Hi all,
I'm a newbie in .NET technology.
I've already developed Serial communication applications in C++
(WIN32).
And I wanted to migrate to .NET technology.
There is a serial component in...
|
by: cnixuser |
last post by:
Hello, I have a basic application written which is designed to data over a serial cable and then receive a response back. I am not getting any triggers to my data received event. I have tried...
|
by: Adrian Chen |
last post by:
please help me! I come across a problem.
Now I develop a finger print management system which is based on B/S.When
users click a button in the web pages, a device connected to the COM1 serial
port...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |