473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Com port and priorities

Hi,
i'm workin to a project where i use a serial port to send and receive data.
My objects send messages to the port by some methods.. no problem till now.
I receive and send data. The problem is that i have to send a string signal
every 25 seconds to tell the remote device i'm still connected.. now the
problem is that i cant control if that signal is sent while my users are
sending some other signals using objects methods. How can i stop all others
to send when my object is sending the keep alive signal?

regards
Gianmaria

Nov 16 '05 #1
1 1246
Hi Gianmaria,

Take a look at using the System.Threading.Monitor class to gain
exclusive access to the serial port.

If the timing of your 25s control signal is extremely sensitive you'll
need to write the other object methods carefully. You need to prevent
another thread from grabbing the Monitor for long periods of time when
it sends user data.

See Jon's document for a good introduction to Monitor:
http://www.yoda.arachsys.com/csharp/multithreading.html

--
Scott
http://www.OdeToCode.com
On Wed, 18 Aug 2004 11:17:30 +0200, "Gianmaria"
<no*************@telenet.it> wrote:
Hi,
i'm workin to a project where i use a serial port to send and receive data.
My objects send messages to the port by some methods.. no problem till now.
I receive and send data. The problem is that i have to send a string signal
every 25 seconds to tell the remote device i'm still connected.. now the
problem is that i cant control if that signal is sent while my users are
sending some other signals using objects methods. How can i stop all others
to send when my object is sending the keep alive signal?

regards
Gianmaria


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: AlanR | last post by:
Hi, I have to implement(or possibly acquire) a queue that manages priorities. Low priority elements cannot get lost in the queue indefinitely if there is a sustained, constant flow of high...
21
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port...
0
by: per.bergstrom | last post by:
To whom it may concern, The serial port server 'cnhd38' has been terminated (on who's initiative, I don't know). It affects the users of the (at least) following nodes: cnhd36, cnhd44, cnhd45,...
6
by: kai | last post by:
Hi, I was tring to run an example (HelloWorld.aspx) from MSPrss book, I get this message: "ASP.NET Development Server faild to start listening port 1034. Error message: An attempt was made...
4
by: H J van Rooyen | last post by:
Hi All, I am writing a polling controller for an RS-485 line that has several addressable devices connected. It is a small access control system. All is well- the code runs for anything from...
25
by: bmearns | last post by:
Is it possible to specify which port to use as the outbound port on a connection? I have the IP address and port number for the computer I'm trying to connect to (not listening for), but it's...
13
by: Rob | last post by:
Hi all, I am fairly new to python, but not programming and embedded. I am having an issue which I believe is related to the hardware, triggered by the software read I am doing in pySerial. I...
3
by: John Nagle | last post by:
There's no way to set thread priorities within Python, is there? We have some threads that go compute-bound, and would like to reduce their priority slightly so the other operations, like...
4
by: RgeeK | last post by:
From my newbie perspective I understand that Javascript is a single threaded environment and so interrupt-driven events are going to be somewhat challenging. But, I have an issue which seems to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.