Announcement

Collapse
No announcement yet.

Help with serial communications

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

  • Jim Huguley
    replied
    paulo..

    from: http://www.powerbasic.com/support/pb...hread.php?t=43

    19. comm set
    errata applies to pb/dll 6.0 & pb/cc 2.0
    comm set incorrectly suggests that it is possible to programmatically alter the cd and rlsd parameters - in fact, cd and rlsd are read-only parameters. attempting to change these parameters with comm set will yield a compile-time error 542: may not be altered.

    to check the value of cd (or its synonym rlsd), use the comm() function.



    ------------------
    jim..
    [email protected]

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Sorry, I think I didn't mak e myself clear. I've read the
    help file thoroughly. The first piece of code is the PBDOS
    code.
    In PBDLL60, I use something like this (I don't remeber exactly
    since now I'm home not at the office)

    FN = FREEFILE
    COMM OPEN "COM2" AS #FN

    COMM SET #FN, BAUD = 9600 'OR CBR_9600
    COMM SET #FN, BYTE = 8
    COMM SET #FN, STOP = 2 'And I've tried every other possibility
    COMM SET #FN, PARITYTYPE = 0 'None
    COMM SET #FN, CTSFLOW = 1 'CS option in DOS
    COMM SET #FN, DTSFLOW = 1 'DS option in DOS
    COMM SET #FN, CD = 1 'The code won't compile unless I comment out this line. If not, I get error 542


    Probably I'm missing something very stupid and any help in

    converting the PBDOS code
    OPEN "COM2:9600,N,8,,cs,ds,cd" FOR RANDOM AS #FN

    is welcome

    Thanks guys

    Paulo


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

    Leave a comment:


  • Edwin Knoppert
    replied
    You need to reread the help.

    Use Comm OPEN instead..

    ------------------
    [email protected]

    Leave a comment:


  • Guest's Avatar
    Guest started a topic Help with serial communications

    Help with serial communications

    Hello guys

    I've written a program in PBDOS that does serial communications
    with a data logger. The program works great but I'm trying to
    convert the code to PBDLL60 using the new COMM commands. I have
    had a few problems with that.

    To establish the connection, in PBDOS I use:

    FN = FREEFILE
    OPEN "COM2:9600,N,8,,cs,ds,cd" FOR RANDOM AS #FN

    In PBDLL60, when I try to set: COMM SET #FN, CD = 1 I get the
    compile time error 542: Value may not be altered (the same thing
    happens when I try to modify RLSD)

    Can any one show me how to convert the above PBDOS code to PBDLL60?

    Thanks a lot for any suggestions.




    ------------------
Working...
X