Results 1 to 11 of 11

Thread: Serial Communications - Out of ressources, Clock falls behind

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    Ottawa
    Posts
    7

    Question Serial Communications - Out of ressources, Clock falls behind

    SITUATION
    Multiple programs need to access the same serial communications port in Windows95.
    I used the "Microsoft Comm Control 6.0" object in my code.

    PROBLEM
    In each program, I open the port, send a command and receive an answer, then close the port. After repeated occurences (over 13000), here is what happens :
    - the system slows down as though its running out of ressources or CPU time,
    - the clock is almost stopped (sometimes hours behind),
    - the free memory is down about 10% and
    - the mouse is freezing up here and there.

    QUESTION
    Does anyone have any solutions to this problem?

  2. #2
    Lively Member dbarr's Avatar
    Join Date
    Oct 2001
    Location
    Syracuse, NY
    Posts
    86
    what do you use to initiate the sequence you have described? a timer? Loop?

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    Ottawa
    Posts
    7
    I use a timer.

    I also made a program using only a loop and onecommunication get the same problem.

    I'll included the code for that program.

    Thank for helping me.

  4. #4
    Lively Member dbarr's Avatar
    Join Date
    Oct 2001
    Location
    Syracuse, NY
    Posts
    86
    Try putting the DoEvents command after each iteration of the loop or upon entering the timer event... I don't get why the timer would cause a problem. How what is the interval you are using for the timer?

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    Ottawa
    Posts
    7
    60 000 miliseconds (1 minute)

  6. #6
    Lively Member dbarr's Avatar
    Join Date
    Oct 2001
    Location
    Syracuse, NY
    Posts
    86
    Have you tried the application on a NT, 2000 or XP box?

  7. #7

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    Ottawa
    Posts
    7
    Not yet. The problem is, it is installed on 100 computers running Windows95.

    I've am currently testing "Sax Comm Object" which is made by a company called "Sax Sofware". The same problem seems to happen but it takes about 40000 communications before it occurs.

    I have in mind to test it on windows 2000 to see if the problem comes from Windows95.

    What do you have in mind?

  8. #8
    Lively Member dbarr's Avatar
    Join Date
    Oct 2001
    Location
    Syracuse, NY
    Posts
    86
    Not sure what is going on at all. Is there ay reason you need to close the comm port? If not try leaving it open and see what happens.

  9. #9

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    Ottawa
    Posts
    7
    I have another program who keeps the communication port opened and it works fine.

    This program, which has the problem, uses it the comm port to retreive information from a device which is also controled by a second program over the same communication port. The device only has one port : the serial comm port.

    The second program has priority over the first one and holds on to the communication port while the device is in operation. During that time the first program waits to access the port. That's why they both have repeatively to open and close the comm port.

  10. #10
    Lively Member dbarr's Avatar
    Join Date
    Oct 2001
    Location
    Syracuse, NY
    Posts
    86
    My guess is that Windows 95 has a problem with it's port being opened and closed so many times.

    I believe what you might want to do is create an ActiveX EXE which can stay open all the time and have multiple threads to the two applications. There is a demo in the MSDN called the Coffee Project which may help you if you choose to look into it.

    Sorry to be vague but I use the Comm port all the time and have never experienced this problem.

  11. #11

    Thread Starter
    New Member
    Join Date
    Mar 2002
    Location
    Ottawa
    Posts
    7
    Thank you very much for your help. I'll probably go with an ActiveX EXE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width