Announcement

Collapse
No announcement yet.

Modbus communication

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

  • Tom Hanlin
    replied
    You might start with the TERMINAL.BAS example code, which ought to
    provide a good basic framework for the comm part. You should also
    be aware that the Modbus data needs to be appropriately encoded and
    decoded. For example, that 0A 04 00 00 00 0A 71 76 string goes out
    something like this:
    Code:
    PRINT #1, CHR$(&H0A); CHR$(&H04); CHR$(&H00); CHR$(&H00);
    PRINT #1, CHR$(&H00); CHR$(&H0A); CHR$(&H71); CHR$(&H76);
    ...assuming your comm port was opened as file #1.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Mel Bishop
    replied
    If you are going through an RS-232 converter and you have your
    comm parameters set up correctly, then there should be no
    problem.

    One possibility: If you are using software flow control, send
    the meter an XON character, either chr$(17) or chr$(19) (can't
    remember which).

    Also, check to see that your cable matches the flow control you
    are using. Sometimes, a modem cable is of the 3-wire variety
    which mandates the use of software flow control. If you are
    using hardware flow control, you have to have the RTS/CTS wires
    present in the cable.

    Just a couple of thoughts.
    Cheers


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


    [This message has been edited by Mel Bishop (edited March 21, 2003).]

    Leave a comment:


  • Bruce Meissner
    Guest replied
    The power meter has a Modbus two wire RS-485 output feeding a RS-232
    converter on the IBM compatible PC. The power meter has an address
    of 20. Serial rate is 9600,N,8,1. The meter manual has some info
    but not a lot. Sample inquiry given: 0A 04 00 00 00 0A 71 76.
    0A=periheral number
    04=reading function
    00 00=initial address (first register)
    00 0A=number of registers to be read
    71 76= CRC character

    I use pbasic 3.5, If I can a data string back from the power meter
    then I have no problem dealing with the data. Sending the data
    string to the meter I can't seem to get any response back. I was
    hoping someone may have done this type of communication before.



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

    Leave a comment:


  • Lance Edmonds
    replied
    Are they serial devices, USB devices, or something else?

    Does the manufacturer offer any documentation on interfacing and communicating with them?

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Bruce Meissner
    Guest started a topic Modbus communication

    Modbus communication

    Has anyone used PB Dos to talk to Modbus devices?
    I'm in a crunch to get data from a building power meter.
    I need to know what the data strings would look like to talk to this device.
    I need to get power consumption readings and date stamp them then put them in a file.
    Problem is, getting data to the power meter and gatting back some useful information.
    I appreciate any help available.

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