Announcement

Collapse
No announcement yet.

Problems with com program

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with com program

    Hello, I'm new to power basic and I was given the task of
    fixing this program!!

    The program is connecting to a serial buffer device and
    polling records out of the device into the program.
    It appears that the code is making a clean connection and
    the data is comming into the program.

    Here is the code that I have a question about...

    Open "COM1:1200,N,8,1" AS #2
    Open "CALLREC" For Append As #3
    DELAY 3
    Rem
    Rem ********* BEGIN DATA COLLECTION ***********
    Rem
    MAIN:
    If Loc(2) > 20 Then
    'perform logic
    End If


    Through debugging my program using an evaluate on Loc(2), I
    noticed that the value is '?????'

    Does anyone know of any reason that Loc(2) is never receiving
    any of the data from the buffer device?

    Thanks so much for your assistance.

    Bob

    ------------------

  • #2
    I'm no expert on this, but it seems to me you should be using COMM OPEN and COMM SET to make the connection. The PB help file describes it all...


    ------------------
    Trevor
    Trevor

    Comment


    • #3
      Trevor is absolutely correct. The 32-bit PB compilers do not use
      the same comm open syntax and comm parameters setting syntax as
      the PB/DOS compiler does. They are completely different.


      ------------------


      [This message has been edited by Clay Clear (edited August 08, 2003).]

      Comment


      • #4
        Bob, what version of PowerBASIC are you using? I haven't looked at the help
        file for PBDOS in a while, but in Console Compiler and PBWin70 the help section
        for Serial Communications is one of the more accurate write-ups I've been able
        to find.

        Another consideration; is there any type of protocol being used (RTS, CTS, etc)?


        ------------------
        Mark Pruitt
        [email protected]

        [This message has been edited by mark pruitt (edited August 08, 2003).]
        sigpicMark Pruitt
        [email protected]

        http://ezreregister.com
        Manage 3rd party BlackBerry software registration codes.

        It's not the only way to do it...just the EZ way!

        Comment


        • #5
          Sorry everyone for the confusion! Again, I'm a newbie! I'm
          using Power Basic for Dos. Compiler version 3.5. I will repost
          on the PB for Dos board also.

          Thanks Bob.

          ------------------

          Comment


          • #6
            Bob,
            << evaluate on Loc(2), I noticed that the value is '?????'>>

            I don't think you can display a function's value in the debugger, try assigning it to variable and display the variable instead.

            e.g. xx&=loc(2)
            while watching xx& in the debugger.

            Paul.



            ------------------

            Comment

            Working...
            X