VB6 MSCOMM wroks on one PC and not another


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    31

    Default VB6 MSCOMM wroks on one PC and not another

    I have been using MSCOMM for quite awhile, this problem has dah me stumpped for a week now.
    Properties of MSCOMM:
    DTREnable is True
    EOFEnable is TruHandshaking is 0
    InBufferSize is 3072
    InPutMode is 0
    OutBuffSize is 512
    RThreshold is 1
    RTSEnable
    Settings is 2400, N,8,1
    SThreshold

    Using the same PIC code and same VB code on different machines, I get different results. The only machine that the code operates correctly on is an older machine, x86, Windows 2000 SP2. A second machine running Win2K and a third machine running XP have this problem;
    MSCOMM receives the first 8 characters, processes these 8 characters, then receives the balance. I am testing with 10 characters. I am sending PIC variables from a bit array. I am receiving the data in VB as a srting.
    I have sent the data to HyperTerminal and in every case the correct data is being sent from the PIC. For some unknown reason, on certain machines all the data is not received into the buffer.
    In addition to the slower processor I mentioned ealier, the copy of VB on the slower machine does not have the latest service pack while the other machines do, SP6. Attempting to load SP6 causes some errors and does not load. I don't have the errors handy.
    I have places a Pauseus in the Send routine thinking the slower processor was the issue, but no change.
    Any suggestions are appreciated.

    B

  2. #2
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    What do you have the attribute InputLen set to?

  3. #3
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    31


    Did you find this post helpful? Yes | No

    Default Input Length

    Thanks for the responce. Input Length is set 0.

    I have since sent the input string to a label, visable property set to false, and so far every test I have done, not extensive mind you but progress, has been successful. I don't why the program operates better this way, timing I'm guessing.

    If InputLen should be something other than 0 please let me know. The input length is variable, no telling how many characters.

    Thanks again for the interest.

    B

  4. #4
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cooksydesign View Post
    Thanks for the responce. Input Length is set 0.
    If InputLen should be something other than 0 please let me know. The input length is variable, no telling how many characters.
    For Win XP & 2K2 you definitely want InputLen set to anything other than 0. I lost some hair a few years back when I wrote a piece of software for a serial io controller, worked fine on 9x with InputLen set to 0, but refused to work on XP until I changed it to equal 1.

  5. #5
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    31


    Did you find this post helpful? Yes | No

    Default Length property

    Again, thanks for the interest in my post. Changing the receive length property to 1 did not do any good. I think that tells MSCOM buffer what to expect. If the incoming string was a fixed length it may have helped. I seem to have sorted it out by sending the string to a label first, then work with the data. It has not failed since I started doing it that way. I realize this is a work around, and the true cause is not identified. If there are other suggestions, I will most certainly try them.

    Regards.

    B

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I no longer use MsComm and VB6, i use VBExpress or .Net. From there you can also use the LF interrupt events (comport.ReadLine) which is probably the way to go. Never ever failed for me 'till now. VB6 EOF event is one method... if you can make it work.

    LF event... way easy to code on the PIC side... hserout [whatever, 10]

    There's a lot of different way to have success with VB, i have some applications dealing with MBs and GBs of data transfer... problem-free since years now. Even in VB6.

    I prefer the handshaking method... hardware or software.... and a preamble string never bite anyone yet.
    Last edited by mister_e; - 24th March 2008 at 19:01.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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